pageAction.hide()

Hides the page action for a given tab.

hide() overrides pattern matching, so the page action will not be shown in the specified tab even if its URL is matched by show_matches.

Syntax

js
browser.pageAction.hide(
  tabId // integer
)

Parameters

tabId

integer. The ID of the tab for which you want to hide the page action.

Examples

Hide the page action for the current tab when the user clicks it:

js
browser.pageAction.onClicked.addListener((tab) => {
  browser.pageAction.hide(tab.id);
});

Example extensions

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
hide
Chrome – Full support
Chrome 4 (Release date: 2010-01-25)
footnote Full support
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote Full support
Firefox – Full support
Firefox 45 (Release date: 2016-03-08)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – No support
Safari
footnote No support
Firefox for Android – Full support
Firefox for Android 50 (Release date: 2016-11-15)
footnote
footnote Before version 56, the 'tabId' parameter was ignored, and the page action was hidden for all tabs.
Safari on iOS – No support
Safari on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

Note: This API is based on Chromium's chrome.pageAction API. This documentation is derived from page_action.json in the Chromium code.