71

As of today, Google Instant Search is dead. This is what it used to look like:

https://www.youtube.com/watch?v=ANVT56wlmTo

I never cared much for the instant display of results while I typed. However, I did use, hundreds of times a day, the keyboard shortcuts it allowed.

For those that never used it - with instant search turned on, you could:

  • Press enter after a search, and use the up/down keys to move a 'pointer' down through the results

  • Then press 'enter' to open a search result being pointed at

  • At any point in time, typing letters/numbers on the keyboard would refocus on the search bar

  • Pressing enter with a result highlighted could be combined with the ctrl modifier to open a result in a new tab.

I find the mouse quite difficult to use and try to avoid it when possible. Is there a tool or script I could use to replicate the keyboard behaviour that instant search used to give me?

Previous questions have asked (and been answered) in the era of instant search (e.g. this, this and my previous question here), while I'm looking for a non-google replacement with the same functionality.

I am using Chrome on Ubuntu 15.01.

Bill Cheatham
  • 1,339
  • 2
  • 13
  • 14
  • 2
    You remember correctly, it used to work fine. It seems it has gone away along with the _instant search_. http://searchengineland.com/google-dropped-google-instant-search-279674 . But are you sure the instant search is still working for you, though? For me, it doesn't do a search before I press enter any more. (I like that behaviour, but I want the little blue arrow back, like you do.) – Bloke Jul 26 '17 at 15:11
  • 1
    this is extremely disappointing .... it seems the hotkey to use '/' to return to the search bar has also gone away with instant search – itzjustricky Jul 26 '17 at 15:54
  • 3
    In the same position as you. It's bizarre the most popular web page on the planet has messed up this simple UX design. I'm sure a greasemonkey/tampermonkey script could work but not the most desired solution. – Kable Jul 27 '17 at 07:54
  • You can still navigate the search results using the Tab key. – Seth Jul 27 '17 at 10:30
  • @Seth - I don't think I'm able to do that. What sequence of keystrokes do you use to make this work? If I type into the search box on google.com, then press enter then tab, the focus shifts to a button to the right but it doesn't allow me to open a search result unless I press tab 17 times. Is that the use of tab you mean? – Bill Cheatham Jul 27 '17 at 10:48
  • Yes, it's not attractive but one of the options to navigate the site using a keyboard. – Seth Jul 27 '17 at 11:50
  • Oh dear - so it is official! +1 to Bill for sourcing this article. I was hoping this was a bug that might go away... :-( – Robino Jul 27 '17 at 13:42
  • Actually, Bill. I think you should close this question because it's too similar to this one: https://superuser.com/questions/509192/tab-enter-no-longer-taking-me-to-first-google-search-result-in-chrome – Robino Jul 27 '17 at 13:54
  • 2
    https://chrome.google.com/webstore/detail/keyboard-shortcuts-for-go/naaaebidllcopodoaeeedjnbibinnpid/related?hl=en&gl=US This one works perfectly out of the box for me! Chrome only obvi. – Thalassophobia Jul 28 '17 at 02:47
  • On that same topic, is there any option available for Firefox? – hazerd Jul 30 '17 at 12:17
  • @hazerd You may try [Vimperator](https://addons.mozilla.org/en-US/firefox/addon/vimperator/). The equivalent for Chrome would be [cVim](https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojhcghmfjfneahoeklbjjh?hl=en) – xji Aug 01 '17 at 11:18
  • 1
    [DuckDuckGo](https://duckduckgo.com) has this by default and (!) respects your privacy. – Michael S. Aug 01 '17 at 11:22
  • This answer worked perfectly for me: https://superuser.com/a/1235114/99219 – qwertzguy Aug 22 '17 at 23:18

5 Answers5

27

Google have removed this feature (called Google Instant Prediction), so you can't just turn it out like you used to be able to.

I was so sad to see this feature go that I wrote a hack to re-engineer it last night. So far it only works with Google Chrome, but can be adapted to work with all the others:

  1. Install Chrome extension ShortKeys.
  2. Click on the ShortKeys menu and select "Options" enter image description here
  3. Click on "Add" and fill in the following fields:

Keyboard Shortcut: tab

Behavior: Run JavaScript

Label as: Result Picker

  1. Paste the following JavaScript into the JavaScript code to run:

    document.selectedResultId=0
    function selectResult(newId){
        els = document.querySelectorAll("div.r h3")
        if(newId < 0 || newId >= els.length)
            return  //Could modify for page nav...?
        rp = document.getElementById("result-pointer")
        if(rp != null){
            rp.remove()
        }
        document.selectedResultId=newId
        el = els[newId]
        lnk = el.firstElementChild
        el.innerHTML = "<div id=\"result-pointer\" style=\"position:absolute;left:-15px;\">&gt;</div>" + el.innerHTML
        lnk.focus()
    }
    document.onkeyup=function(event){
        if(event.keyCode==38)
            selectResult(document.selectedResultId-1)
        if(event.keyCode==40)
            selectResult(document.selectedResultId+1)
        if(event.keyCode==13){
          var el = document.querySelectorAll("div.r h3")[document.selectedResultId]
          var lnk = el.parentElement
          var url = lnk.href
          if(event.ctrlKey){
            var win = window.open(url,"_blank")
            win.blur()
            window.open().close()
          }
          else{
            document.location = url
          }
        }
    }
    selectResult(0)
    
  2. Configure the Activation Settings:

Active while in form fields (Checked)

Websites (Only specific sites)

URLS (one per line): *.google.*

This is what the Options page should look like

ShortKeys Options Page

  1. Click Save and then close your browser.

Instructions:

  • When you restart you should see a little blue ">" appear by search results when you hit tab.

  • The up/down arrow keys make it cycle through the results.

  • Hitting "Enter" will navigate to the highlighted result.

  • Hitting "Ctrl+Enter" to open the result in a new tab.

Happy Searching!

Robino
  • 818
  • 8
  • 15
  • 1
    The Chrome extension is no longer available :( https://chrome.google.com/webstore/detail/shortkeys-custom-keyboard/logpjaacgmcbpdkdchjiaagddngobkck – user2205916 Feb 01 '21 at 22:44
  • @user2205916 I hope they bring it back otherwise we'll need to use another extension. Don't forget to follow the question linked at the top; this guy is closed. – Robino Feb 02 '21 at 23:48
18

I've created a Chrome extension that will add back the primary keyboard functionality (that I used at least). If the search box isn't focused, pressing any key will automatically focus it. In addition, arrow keys and tab/shift+tab will let you navigate between results. Hopefully this can help us remain productive until Google (hopefully) adds the functionality back.

https://chrome.google.com/webstore/detail/google-search-result-keyb/iobmefdldoplhmonnnkchglfdeepnfhd?hl=en&gl=US

Here's the code for the extension in case you want to edit it:

(function() {
  'use strict';

  var isResultsPage = document.querySelector('html[itemtype="http://schema.org/SearchResultsPage"]');
  if (!isResultsPage) {
    return;
  }

  var searchbox = document.querySelector('form[role="search"] input[type="text"]:nth-of-type(1)'),
      results = document.querySelectorAll('h3 a'),
      KEY_UP = 38,
      KEY_DOWN = 40,
      KEY_TAB = 9;

  function focusResult(offset) {
    var focused = document.querySelector('h3 a:focus');

    // No result is currently focused. Focus the first one
    if (focused == null) {
      results[0].focus();
    }
    else {
      for (var i = 0; i < results.length; i++) {
        var result = results[i];
        if (result === focused) {
          var focusIndex = i + offset;
          if (focusIndex < 0) focusIndex = 0;
          if (focusIndex >= results.length) focusIndex = results.length - 1;
          results[focusIndex].focus();
        }
      }
    }
  }

  window.addEventListener('keydown', function(e) {
    e = e || window.event;

    var isSearchActive = searchbox === document.activeElement,
        keycode = e.keyCode,
        // From https://stackoverflow.com/questions/12467240/determine-if-javascript-e-keycode-is-a-printable-non-control-character
        isPrintable = (keycode > 47 && keycode < 58)   || // number keys
                      (keycode > 64 && keycode < 91)   || // letter keys
                      (keycode > 95 && keycode < 112)  || // numpad keys
                      (keycode > 185 && keycode < 193) || // ;=,-./` (in order)
                      (keycode > 218 && keycode < 223);   // [\]' (in order)

    if ((!isSearchActive && e.keyCode == KEY_DOWN) || (e.keyCode == KEY_TAB && !e.shiftKey)) {
      e.preventDefault();
      e.stopPropagation();
      focusResult(1); // Focus next
    }
    else if ((!isSearchActive && e.keyCode == KEY_UP) || (e.keyCode == KEY_TAB && e.shiftKey)) {
      e.preventDefault();
      e.stopPropagation();
      focusResult(-1); // Focus previous
    }
    else if (!isSearchActive && isPrintable) {
      // Otherwise, force caret to end of text and focus the search box
      searchbox.value = searchbox.value + " ";
      searchbox.focus();
    }
  });
})();
Jacob Chafik
  • 181
  • 2
  • 1
    The author released [the source code of his extension here](https://github.com/jchafik/google-search-shortcuts). It is slightly more advanced than the code snippet above. – pcworld Sep 10 '17 at 13:51
  • This extension works great, use it almost ever day. – swerly Oct 24 '18 at 03:48
  • almost perfect, what I don't like is it indents forward the current highlighted search result – relG Nov 16 '19 at 13:36
  • I realized this can be configured - if you remove the arrow and "add styling" it's 99.9% optimal. Really nice extension! – relG Nov 16 '19 at 17:48
  • heads up, broken right now! heres an alternative: https://chrome.google.com/webstore/detail/google-search-results-sho/dchaandmcifgjemlhiekookpgjmkcelg/related?hl=en&gl=US – skurp Nov 30 '22 at 04:57
18

As of 2017-07-31, Google removed this feature entirely from search.

I created the open source Web Search Navigator extension to fix this and add extra features (like configurable keyboard shortcuts).

See installation instructions.

Hope you find it useful, but in any case - feedback is welcome!

infokiller
  • 381
  • 2
  • 6
5

For firefox I solve this issue by Google Search Result Keyboard Shortcuts add-on. https://addons.mozilla.org/en-US/firefox/addon/google-search-result-shortcuts/?src=api

valior
  • 151
  • 1
1

You may try extensions that introduce Vim-like keybindings. With them you'll never need to use your mouse again. For example, cVim is the one that's currently most powerful for Chrome, while Vimperator is the one for Firefox.

With such extensions you can access any link on the current page by pressing f (by default) followed by a one/two key combination.

xji
  • 788
  • 11
  • 23