73

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.

13
  • 2
    You remember correctly, it used to work fine. It seems it has gone away along with the instant search. searchengineland.com/… . 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, 2017 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 Jul 26, 2017 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, 2017 at 7:54
  • 2
    chrome.google.com/webstore/detail/keyboard-shortcuts-for-go/… This one works perfectly out of the box for me! Chrome only obvi. Jul 28, 2017 at 2:47
  • 1
    DuckDuckGo has this by default and (!) respects your privacy.
    – Michael S.
    Aug 1, 2017 at 11:22

5 Answers 5

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!

2
19

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!

5
  • 3
    This is brilliant! More people should be aware of it.
    – SlavaSt
    Jan 7, 2018 at 19:34
  • The Chrome-link is 404 now
    – Rheven
    Sep 27, 2018 at 7:35
  • @Rheven see updated answer
    – infokiller
    Oct 1, 2018 at 10:54
  • It works in 2022. Dec 22, 2022 at 1:32
  • Still shines in 2024! Feb 21 at 19:20
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();
    }
  });
})();
5
  • 1
    The author released the source code of his extension here. It is slightly more advanced than the code snippet above.
    – pcworld
    Sep 10, 2017 at 13:51
  • This extension works great, use it almost ever day.
    – swerly
    Oct 24, 2018 at 3:48
  • almost perfect, what I don't like is it indents forward the current highlighted search result
    – relG
    Nov 16, 2019 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, 2019 at 17:48
  • heads up, broken right now! heres an alternative: chrome.google.com/webstore/detail/google-search-results-sho/…
    – skurp
    Nov 30, 2022 at 4:57
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

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.

Not the answer you're looking for? Browse other questions tagged .