NovelAI Disable Backward

Disable Backward on NovelAI's image generation screen. This prevents the deletion of generated images due to browser backward operations.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         NovelAI Disable Backward
// @name:ja      NovelAI 戻るボタン無効化
// @name:en      NovelAI Disable Backward
// @namespace    https://github.com/Takenoko3333/NAI-disable-backward
// @version      1.0.0
// @description  Disable Backward on NovelAI's image generation screen. This prevents the deletion of generated images due to browser backward operations.
// @description:ja  NovelAIの画像生成画面において、戻るボタンを無効化します。これにより、ブラウザの戻るボタン操作による生成画像削除を防止します。
// @description:en  Disable Backward on NovelAI's image generation screen. This prevents the deletion of generated images due to browser backward operations.
// @author       Takenoko3333
// @match        https://novelai.net/image
// @icon         https://www.google.com/s2/favicons?sz=64&domain=novelai.net
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    history.pushState(null, null, location.href);
    window.addEventListener('popstate', function(e) {
      history.pushState(null, null, null);
      alert('ブラウザバック無効\nDisable Backward');
      history.go(1);
    });
})();