MDN self-hosted library · e01.org

omnibox.setDefaultSuggestion()

Set the default suggestion to appear in the address bar drop-down list when the user starts interacting with your extension.

Open notebook · 1 cells webextension-api-function upstream source

Set the default suggestion to appear in the address bar drop-down list when the user starts interacting with your extension.

After the user enters your keyword and starts interacting with your extension, the default suggestion appears first in the drop-down list. Unlike the suggestions you supply in omnibox.onInputChanged, this item can't be selected. Use it to guide the user on what to type and what they can expect to see.

Syntax

let settingDefaultSuggestion = browser.omnibox.setDefaultSuggestion(
  suggestion            // object
)

Parameters

  • suggestion
  • : object. An object containing a string property description, which displays as the first item in the drop-down when the user starts interacting with your extension.

Return value

A Promise that is fulfilled with no arguments when the default suggestion is set.

Examples

browser.omnibox.setDefaultSuggestion({
  description: "Type the name of a CSS property",
});

Browser compatibility

[!NOTE] This API is based on Chromium's chrome.omnibox API.