Prevent Slash Opening QuickFind

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

Stan na 31-10-2015. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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;