Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What algorithm does google use to make Chrome browser's address bar to act as a default search bar for many websites?

I am wondering what algorithm does google use to make chrome browser's address bar to act as a default search bar for many websites like SO, Quroa etc. but not for facebook, metastackoverflow etc..

For example if you want to search for a topic in stackoverflow, you can do like this in chorme.

enter image description here

And the search results will directly take you to the stackoverflow page. i.e.

enter image description here

The same will happen if you choose to search quora.com also in chrome's address bar. But this won't happen if you search like facebook.com in the address bar and many other websites that have a search bar.

How is this happening? What algorithm does google use to make this happen?

Hope I am clear with my question? Any help would be appreciated.

like image 219
user1518659 Avatar asked Jan 07 '13 12:01

user1518659


People also ask

What is the Chrome browser address bar?

Updated: 12/31/2020 by Computer Hope. The term address bar refers to the text field in a web browser that identifies the user's location on the web and allows them to access different websites. The address bar is known as a location bar, and in Google Chrome, it's called the omnibox.

Why does Google type in the address bar?

Google Chrome has a feature that lets you bring Google's instant search to the address bar. By default it's turned off, and for possible good reason. The Chrome address bar instant search essentially allows Google (or your current search engine) to track everything you type into the address bar.


2 Answers

This feature is powered by what is known as OpenSearch. It allows you to specify how queries are supposed to be formed when searching a website. You can read the documentation here: http://www.opensearch.org/Home

For example, StackOverflow has the following in their HTML source code:

<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml">

If you then open the file /opensearch.xml you can see the following:

<?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
  <ShortName>Stack Overflow</ShortName>
  <Description>Search Stack Overflow: Q&amp;A for professional and enthusiast programmers</Description>
  <InputEncoding>UTF-8</InputEncoding>
  <Image width="16" height="16" type="image/x-icon">http://sstatic.net/stackoverflow/img/favicon.ico</Image>
  <Url type="text/html" method="get" template="http://stackoverflow.com/search?q={searchTerms}"></Url>
</OpenSearchDescription>

The most important part is the line that specifies the search term string in line 7.

like image 198
Ryan Tse Avatar answered Oct 18 '22 21:10

Ryan Tse


Chrome uses search engines mechanism. It is described here how to use it http://support.google.com/chrome/bin/answer.py?hl=en&answer=95653&topic=14676&ctx=topic

Chrome automatically identifies search boxes and adds corresponding rules to search engines list. Maybe it's engine relies on document parsing. Hense a particular site may be added or not because of it's search box markup. https://superuser.com/questions/276069/google-chrome-automatically-adding-websites-to-my-list-of-search-engines

If you want to know about parsing algorithm, the only way i see is to dig through chrome sources

Also, you can edit search engine list manually.

PS: And it's not only chrome's feature, other browsers have similar things. Opera as an example http://tech.gaeatimes.com/index.php/archive/how-to-easily-use-manage-your-search-engines-in-opera-browser/

like image 2
Юра Евтушенко Avatar answered Oct 18 '22 22:10

Юра Евтушенко