您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
19/03/2025 18:14:32: stop websites from overriding common browser keybinds
// ==UserScript== // @name Leave my keybinds alone // @namespace Violentmonkey Scripts // @match http*://*/* // @grant none // @version 1.0 // @author Skyler Grey <[email protected]> // @description 19/03/2025 18:14:32: stop websites from overriding common browser keybinds // @license MIT OR Unlicense OR CC0-1.0 // ==/UserScript== const criticalShortcuts = [ { ctrl: true, key: 'r' }, ]; function stopPropagationOfCriticalShortcuts(event) { for (const shortcut of criticalShortcuts) { if ( event.ctrlKey === shortcut.ctrl && event.key === shortcut.key && !event.defaultPrevented // we're not too late... && event.cancelable // this is a threat... ) { event.stopImmediatePropagation(); return; } } } document.body.addEventListener('keydown', stopPropagationOfCriticalShortcuts, { capture: true });
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址