Stay organized with collections Save and categorize content based on your preferences.
DescriptionThe omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.
When the user enters your extension's keyword, the user starts interacting solely with your extension. Each keystroke is sent to your extension, and you can provide suggestions in response.
The suggestions can be richly formatted in a variety of ways. When the user accepts a suggestion, your extension is notified and can take action.
ManifestThe following keys must be declared in the manifest to use this API.
"omnibox"
You must include an "omnibox.keyword"
field in the manifest to use the omnibox API. You should also specify a 16 by 16-pixel icon, which will be displayed in the address bar when suggesting that users enter keyword mode.
For example:
{
"name": "Aaron's omnibox extension",
"version": "1.0",
"omnibox": { "keyword" : "aaron" },
"icons": {
"16": "16-full-color.png"
},
"background": {
"persistent": false,
"scripts": ["background.js"]
}
}
Note: Chrome automatically creates a grayscale version of your 16x16-pixel icon. You should provide a full-color version so that it can also be used in other situations that require color. For example, the context menus API also uses a 16x16-pixel icon, but it is displayed in color. Examples
To try this API, install the omnibox API example from the chrome-extension-samples repository.
Types DefaultSuggestResultA suggest result.
PropertiesThe text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match.
The style type.
OnInputEnteredDispositionThe window disposition for the omnibox query. This is the recommended context to display results. For example, if the omnibox command is to navigate to a certain URL, a disposition of 'newForegroundTab' means the navigation should take place in a new selected tab.
Enum"currentTab"
"newForegroundTab"
"newBackgroundTab"
A suggest result.
PropertiesThe text that is put into the URL bar, and that is sent to the extension when the user chooses this entry.
deletable
boolean optional
Whether the suggest result can be deleted by the user.
The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. You must escape the five predefined entities to display them as text: stackoverflow.com/a/1091953/89484
chrome.omnibox.setDefaultSuggestion(
suggestion: DefaultSuggestResult,
): Promise<void>
Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar.
ParametersA partial SuggestResult object, without the 'content' parameter.
chrome.omnibox.onDeleteSuggestion.addListener(
callback: function,
)
User has deleted a suggested result.
ParametersThe callback
parameter looks like:
(text: string) => void
chrome.omnibox.onInputCancelled.addListener(
callback: function,
)
User has ended the keyword input session without accepting the input.
ParametersThe callback
parameter looks like:
() => void
chrome.omnibox.onInputChanged.addListener(
callback: function,
)
User has changed what is typed into the omnibox.
ParametersThe callback
parameter looks like:
(text: string, suggest: function) => void
The suggest
parameter looks like:
(suggestResults: SuggestResult[]) => void
chrome.omnibox.onInputEntered.addListener(
callback: function,
)
User has accepted what is typed into the omnibox.
onInputStartedchrome.omnibox.onInputStarted.addListener(
callback: function,
)
User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once per input session, and before any onInputChanged events.
ParametersThe callback
parameter looks like:
() => void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-11 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4