The state of an engagement made with the urlbar by the user. start: The user has started an engagement. engagement: The user has completed an engagement by picking a result. abandonment: The user has abandoned their engagement, for example by blurring the urlbar. discard: The engagement ended in a way that should be ignored by listeners.
Possible types of results. dynamic: A result whose view and payload are specified by the extension. remote_tab: A synced tab from another device. search: A search suggestion from a search engine. tab: An open tab in the browser. tip: An actionable message to help the user with their query. url: A URL that's not one of the other types.
Possible sources of results. bookmarks: The result comes from the user's bookmarks. history: The result comes from the user's history. local: The result comes from some local source not covered by another source type. network: The result comes from some network source not covered by another source type. search: The result comes from a search engine. tabs: The result is an open tab in the browser or a synced tab from another device.
ConstengagementEnables or disables the engagement telemetry.
ConstonBefore a query starts, this event is fired for the given provider. Its purpose is to request the provider's behavior for the query. The listener should return a behavior in response. By default, providers are inactive, so if your provider should always be inactive, you don't need to listen for this event.
ConstonThis event is fired when the user starts and ends an engagement with the urlbar.
ConstonThis event is fired for the given provider when a query is canceled. The listener should stop any ongoing fetch or creation of results and clean up its resources.
ConstonTypically, a provider includes a url property in its results' payloads. When the user picks a result with a URL, Firefox automatically loads the URL. URLs don't make sense for every result type, however. When the user picks a result without a URL, this event is fired. The provider should take an appropriate action in response. Currently the only applicable ResultTypes are dynamic and tip.
ConstonWhen a query starts, this event is fired for the given provider if the provider is active for the query and there are no other providers that are restricting. Its purpose is to request the provider's results for the query. The listener should return a list of results in response.
Closes the urlbar view in the current window.
Focuses the urlbar in the current window.
Optionalselect: boolean
If true, the text in the urlbar will also be selected.
Starts a search in the urlbar in the current window.
The search string.
Optionaloptions: SearchOptions
Options for the search.
Use the
browser.urlbarAPI to experiment with new features in the URLBar. Restricted to Mozilla privileged WebExtensions.Permissions:
urlbarNot allowed in: Content scripts, Devtools pages