您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Stop websites from highjacking keyboard shortcuts
当前为
// ==UserScript== // @name Disable keyboard shortcuts // @description Stop websites from highjacking keyboard shortcuts // // @run-at document-start // @include * // @grant none // @inject-into content // @version 0.0.1.20181203152600 // @namespace https://greasyfork.org/users/30 // ==/UserScript== // // @inject-into content - fixes ViolentMonkey+Firefox CSP issue var keycodes = [191,111,27] // Keycode for '/', add more keycodes to disable other key captures // 27 - ESC // 111 - / on numpad // 191 - / document.addEventListener('keydown', function(e) { // alert(e.keyCode); //uncomment to find out the keycode for any given key if (keycodes.indexOf(e.keyCode) != -1) { e.cancelBubble = true; e.stopPropagation(); e.stopImmediatePropagation(); //return false; // hmm, I don't remember why it's needed } });