The opposite question (Is there keyboard shortcut to move input focus to the Google Search box?) has the accepted answer that amounts to "... just begin typing again".
How can you prevent this? I'd like to re-enter the search box only manually, using only a specific shortcut (e.g. / or ESC) and still be able use a type-to-navigate browser extension.
I'm mostly interested in Safari
, but a general answer would be welcome as well, since the default behaviour is the same also in Chrome
and Firefox
.
Safari
For Safari
, this NinjaKit script should disable hotkeys on StackExchange:
(typeof unsafeWindow !== 'undefined' ? unsafeWindow : window).$(function() {
var p = document.getElementById('wmd-input');
if (!p)
return;
p = p.parentNode;
function ignore(e) { e.stopPropagation(); }
p.addEventListener('keydown', ignore, true);
p.addEventListener('keypress', ignore, true);
p.addEventListener('keyup', ignore, true);
});
What is the equivalent of StackExchange's 'wmd-input'
in Google Search .js
? I don't know where to look in their .js
files, since it's all obfuscated. For instance, there's this:
_.um = function(a) {
if (48 <= a && 57 >= a || 96 <= a && 106 >= a || 65 <= a && 90 >= a || _.Pb && 0 == a) return !0;
switch (a) {
case 32:
case 63:
case 107:
case 109:
case 110:
case 111:
case 186:
case 59:
case 189:
case 187:
case 61:
case 188:
case 190:
case 191:
case 192:
case 222:
case 219:
case 220:
case 221:
return !0;
default:
return !1
}
};