Add suggestion URL for custom search engine in chrome -
i have local search engine backed elasticsearch , thin nodejs api search. want able search documents google chrome (builds available google, not chromium) directly. in use case, use chrome only search engine, don't want use omnibox keyword search api. want same behavior while choosing default search engine in chrome. is
- start typing in omnibox , shows list of suggestions.
- hit enter , takes search results page
i got #2 working adding new search engine under settings , providing search api's url. can't #1 working.
the 2 urls exposed server are:
http://localhost:3000/complete?query=my (this returns list of search suggestions want show while typing in omnibox).
http://localhost:3000/results?query=my+sample+query (this returns actual search results web page, working)
things have tried:
added search engine using window.externals.addsearchprovider opensearchdescription.xml link. xml has suggestions url well.
tried writing background extension omnibox not allow me search without using keyword
i searched through chromium , found json file
but don't know how can use (or if possible in official builds of chrome).
i found solution.
the opensearch.xml
document reference can used link in head section of html page. contains 2 url schemes, 1 search results , other suggestions.
the details can found here: opensearch document specs.
as updated index.html
, opened page in chrome, chrome automatically added new search engine. didn't show there suggestions url under settings > manage search engines.
next, chose engine default search engine clicking on make default , done! can see search suggestions in omnibox without using keyword.
Comments
Post a Comment