Some websites override the behavior of the '/' key in Firefox. Normally this opens the incremental search toolbar at the bottom of the page. But on some websites it places the cursor in a search box on the site itself. How can I prevent this?
2 Answers
I got annoyed by a website taking over my slash yet again (youtube this time), went researching and landed here, saw there was no good answer, so decided to try and figure it out.
Turns out it's not actually that hard. Just install Greasemonkey (or equivalent js userscript addon), make a New user script, paste:
// ==UserScript==
// @name disable websites intercepting slash
// @description "/" slash should always bring up FF quickfind
// @run-at document-start
// @include *
// @grant none
// ==/UserScript==
document.addEventListener('keydown', function(e) {
e.keyCode==191 && e.stopImmediatePropagation();
return false;
}, true);
Save, go reload page in question.. hey, works for me. Created/tested on Firefox 97. YMMV.
Fair warning, this is barely tested, no idea if it'll muck with unrelated browser behavior. Will edit this post if it needs patching.
- 21
This Q is definitely addressed by the comments, so I'll rehash in a useful way:
You can disable gmail's shortcuts with Mail Settings -> General -> Keyboard Shortcuts if that's interferring.
You can always use ctrl+F or just the ' (apostrophe character) too.
If you have further examples, put some out there, but I haven't found this behavior.
Useful links:
Firefox's help on searching
Syntax to tweak your about:config data in Firefox here
- 2,546
- 7
- 27
- 39