您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
When the / key is received outside a text entry field, discard it
当前为
- // ==UserScript==
- // @name Prevent Slash Opening QuickFind
- // @author Jefferson "jscher2000" Scher
- // @namespace JeffersonScher
- // @description When the / key is received outside a text entry field, discard it
- // @include *
- // @version 0.9.2
- // @grant none
- // @copyright Copyright 2015 Jefferson Scher
- // @license BSD 3-clause
- // ==/UserScript==
- function PSOQ_KeyCheck(key){
- if (key.target.nodeName == "INPUT" || key.target.nodeName == "TEXTAREA" || key.target.nodeName == "SELECT") return;
- if (key.target.hasAttribute("contenteditable") && key.target.getAttribute("contenteditable") == "true") return;
- if (key.ctrlKey || key.shiftKey || key.altKey || key.metaKey) return;
- // codes for / and ' key on my Windows 7, your keyCode may vary?
- if (key.which == 191 || key.which == 222){
- key.stopPropagation();
- key.preventDefault();
- return false;
- }
- }
- document.onkeydown = PSOQ_KeyCheck;