您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Warns user before going back when browsing on your Synology DSM NAS
// ==UserScript== // @name Warn/Prevent Back button for Synology DSM // @version 1.5 // @grant none // @match *://192.168.1.106:5001/* // @description Warns user before going back when browsing on your Synology DSM NAS // @namespace https://gf.qytechs.cn/users/1476593 // @license MIT // ==/UserScript== (function() { 'use strict'; // Push a dummy state to capture back button window.addEventListener('load', function() { history.pushState({page: 1}, '', ''); }); // Capture popstate (back/forward) window.addEventListener('popstate', function(e) { if (confirm('Are you sure you want to leave this page?')) { // User confirmed - allow navigation history.go(-1); } else { // User cancelled - stay here history.pushState({page: 1}, '', ''); } }); // Block other navigation methods window.onbeforeunload = function() { return 'Are you sure you want to leave?'; }; })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址