I am planning to write a Chrome extension to jump to a bookmark from the omnibox. I want to use the chrome omnibox APIs (see Chrome omnibox APIs). What the extension wants to do is:
1) type the search keyword “jb” (jump to bookmark) and type TAB to enter the extension;
2) before hitting any key, I want the omnibox give the suggestions from the bookmarks;
3) type any term in the omnibox; and update the suggestions.
The function is very simple. But I do not know how to implement the step #2 using the existing omnibox APIs. The method chrome.omnibox.onInputStarted.addListener does not accept to give suggestions. Suggestions are only allowed when some term is entered (via chrome.omnibox.onInputChanged.addListener).
Any help is appreciated.
After pressing a tab key
chrome.omnibox.onInputChanged.addListeneris fired with an emptytext, so you can return default suggestions.