May '10
Customize Chrome Omnibar
by Frank Spychalski filed under google

I love Chrome! But one thing drove me crazy: we have numerous internal web-apps running on different hosts. From Firefox was easy to get to these tools by just typing the toolname (not the FQDN) in the url bar. Chrome knows it better and assumes that I want to search for toolname. A moment later it asked me if I meant toolname/ and remebers this choice (at least it annoys me only once per tool).

Yesterday I I got an idea and tryed a snippet of javascript as a search engine and was happy to see that it worked as intended. A few minutes of javascript hacking later the omnibar behaved the way I like it:

  • multiple words are a search query
  • single words are URLs, even without the trailing slash, always!
  • fix broken http at the start of an URL (happens to me sometimes when I cut’n'paste)

This is the current version of my default search engine, feel free to criticize, I’m a JS noob:
javascript:query="%s"; if (\s/) != -1) { window.location="" + query; } else { query = query.replace(/^h?t?t?p?:///, ""); window.location="http://"+query; }

Enjoy and let me know if you have other ideas on how to improve this!

2 Responses to “Customize Chrome Omnibar”

  1. 1

    i would like to know if there is a chance to use “instant search” only for special urls or if its possible to exclude some urls… do you know anything here ? (

    micha (October 21st, 2011 at 13:29)
  2. 2

    Sorry, don’t know.

    Frank Spychalski (December 1st, 2011 at 17:14)

Any comments? Or questions? Just leave a Reply: