
'content': '' + encodeURIComponent(text), The background page for our extensions would like so:Ĭ( In the API, we have access to event handlers dealing with various stages of the user entering content (for example, when the user has started entering text, when the user has finished typing, when the text has changed, when the text entered is accepted, etc.)įor our example, we will use the onInputEntered event handler to take the user’s input and take the user to the search page. So let’s make an extension which takes the text and searches this site for content. One of the most common use cases for the chrome.omnibox API would be to take the text and search a certain website with it.

Great! Now let’s go on and actually process the text to do something useful. We have used the manifest to define the keyword we’ll use. In the icons field, we specify what icon comes up in the address bar when your keyword is entered. In our case, we are using the keyword extdocs - so whenever the user enters extdocs, the extension kicks in, ready to process whatever text comes next.

Inside this field, you need to define your keyword inside the keyword subfield. As you can note from the example, you need to use the omnibox field.
