You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files.
paramName
( optional enumerated Type array of paramType )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
Parameters

Google Chrome Extensions (Labs)

chrome.experimental.omnibox

For information on how to use experimental APIs, see the chrome.experimental.* APIs page.

The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.

A screenshot showing suggestions related to the keyword 'Chromium Search'

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.

Manifest

To use the omnibox API, your manifest must declare the "experimental" permission and specify an omnibox_keyword field. You should also specify a 16x16-pixel icon, which will be displayed in the omnibox when suggesting users enter keyword mode.

For example:

{
  "name": "Aaron's omnibox extension",
  "version": "1.0",
  "permissions": ["experimental"],
  "omnibox_keyword": "aaron",
  "icons": {
    "16": "16-full-color.png"
  },
  "background_page": "background.html"
}

Note: Google Chrome automatically creates a greyscale 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

You can find samples of this API on the sample page.

API reference: chrome.experimental.omnibox

Methods

styleDim

void chrome.experimental.omnibox.styleDim(, integer offset)

Constructor for the descriptionStyles parameter of the suggest callback. This style designates a region of dim helper text.

Parameters

offset
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Returns

Callback function

The callback parameter should specify a function that looks like this:

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...};

This function was added in version . If you require this function, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

styleMatch

void chrome.experimental.omnibox.styleMatch(, integer offset)

Constructor for the descriptionStyles parameter of the suggest callback. This style designates a region of text matching what the user typed.

Parameters

offset
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Returns

Callback function

The callback parameter should specify a function that looks like this:

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...};

This function was added in version . If you require this function, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

styleNone

void chrome.experimental.omnibox.styleNone(, integer offset)

Constructor for the descriptionStyles parameter of the suggest callback.

Parameters

offset
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Returns

Callback function

The callback parameter should specify a function that looks like this:

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...};

This function was added in version . If you require this function, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

styleUrl

void chrome.experimental.omnibox.styleUrl(, integer offset)

Constructor for the descriptionStyles parameter of the suggest callback. This style designates a region of text matching a URL or filename.

Parameters

offset
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Returns

Callback function

The callback parameter should specify a function that looks like this:

If you specify the callback parameter, it should specify a function that looks like this:

function(Type param1, Type param2) {...};

This function was added in version . If you require this function, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

Events

onInputCancelled

chrome.experimental.omnibox.onInputCancelled.addListener(function() {...});

User has ended the keyword input session without accepting the input.

Parameters

onInputChanged

chrome.experimental.omnibox.onInputChanged.addListener(function(string text, function suggest) {...});

User has changed what is typed into the omnibox.

Parameters

text
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
suggest
( Type array of function )
A callback passed to the onInputChanged event used for sending suggestions back to the browser.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
Parameters
requestId
( Type array of integer )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
paramName
( Type array of SuggestResult array of paramType paramType )
Array of suggest results
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

onInputEntered

chrome.experimental.omnibox.onInputEntered.addListener(function(string text) {...});

User has accepted what is typed into the omnibox.

Parameters

text
( Type array of string )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.

onInputStarted

chrome.experimental.omnibox.onInputStarted.addListener(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.

Parameters

Types

SuggestResult

paramName
( Type array of object )
A suggest result.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
content
( Type array of string )
The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
description
( Type array of string )
The text that is displayed in the URL dropdown. Can optionally be stylized by the descriptionStyles parameter.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.
descriptionStyles
( optional Type array of Type array of object paramType )
Undocumented.
Description of this parameter from the json schema.
This parameter was added in version . You must omit this parameter in earlier versions, and you may omit it in any version. If you require this parameter, the manifest key minimum_chrome_version can ensure that your extension won't be run in an earlier browser version.