您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Ask for confirmation before refreshing the page, help to not lose all generated images data to reload page...
- // ==UserScript==
- // @name HotPot.ai Confirm Page Refresh
- // @namespace Wizzergod
- // @version 1.0.2
- // @description Ask for confirmation before refreshing the page, help to not lose all generated images data to reload page...
- // @icon https://www.google.com/s2/favicons?sz=64&domain=hotpot.ai
- // @license MIT
- // @author Wizzergod
- // @match *://hotpot.ai/art-generator*
- // @match *://hotpot.ai/remove-background*
- // @match *://hotpot.ai/anime-generator*
- // @match *://hotpot.ai/logo-generator*
- // @match *://hotpot.ai/headshot/train*
- // @match *://hotpot.ai/colorize-picture*
- // @match *://hotpot.ai/restore-picture*
- // @match *://hotpot.ai/enhance-face*
- // @match *://hotpot.ai/drive*
- // @match *://hotpot.ai/s/*
- // @match *://hotpot.ai/upscale-photo*
- // @match *://hotpot.ai/sparkwriter*
- // @match *://hotpot.ai/background-generator*
- // @match *://hotpot.ai/lunar-new-year-headshot*
- // @match *://hotpot.ai/ai-avatar*
- // @grant GM_setValue
- // @grant GM_getValue
- // @run-at document-start
- // ==/UserScript==
- (function() {
- 'use strict';
- function showConfirmation() {
- return window.confirm("Вы точно хотите обновить страницу?");
- }
- window.addEventListener('beforeunload', function(event) {
- if (showConfirmation()) {
- // Keep this part if you want to perform additional actions before the page refresh
- } else {
- event.preventDefault();
- event.returnValue = '';
- }
- });
- })();