0

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
        }
    };
1

Yes, in chrome://flags disable the Enable distance field text flag.

  • In chrome://flags I only find this: **Enable distance field text**: If enabled, text is rendered with signed distance fields rather than bitmap alpha masks. – Blaz May 28 '15 at 14:59
  • that is it, it allows it to make it like a "clickable" not always there – linuxdev2013 May 28 '15 at 16:30
  • Didn't work for me: disabled the above flag, restarted (the latest) Chrome, and Google search box still refocuses on every key/letter. – Blaz May 28 '15 at 17:12
  • what is 'answers in search' set to? – linuxdev2013 May 28 '15 at 17:16
  • It seems that the Answers in Suggest flag isn't available on OS X: Sorry, this experiment is not available on your platform. I presume then that your answer is working on Linux and Windows, but not (yet) on OS X. – Blaz May 28 '15 at 17:17
0

According to this forum, there is a firefox addon called GoogleEnhancer that has this as a side effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.