Prevent Slash Opening QuickFind

When the / key is received outside a text entry field, discard it

Verze ze dne 31. 10. 2015. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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
// @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") return;
  if (key.which == 191){ // code for / key on my Windows 7, your keyCode may vary?
    key.stopPropagation();
    key.preventDefault();
    return false;
  }
}
document.onkeydown = PSOQ_KeyCheck;