Use the browser.pageAction API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages.

Manifest keys: page_action

Not allowed in: Content scripts, Devtools pages

_GetPopupDetails
_GetTitleDetails
_IsShownDetails
_SetIconDetails
_SetPopupDetails
_SetTitleDetails
OnClickData
_OnClickDataModifiers
ImageDataType
onClicked
getPopup
getTitle
hide
isShown
openPopup
setIcon
setPopup
setTitle
show
_OnClickDataModifiers: "Shift" | "Alt" | "Command" | "Ctrl" | "MacCtrl"
ImageDataType: ImageData

Pixel data for an image. Must be an ImageData object (for example, from a canvas element).

onClicked: WebExtEvent<
    (tab: Tab, info?: browser.pageAction.OnClickData) => void,
>

Fired when a page action icon is clicked. This event will not fire if the page action has a popup.

  • Gets the html document set as the popup for this page action.

    Parameters

    Returns Promise<string>

  • Hides the page action.

    Parameters

    • tabId: number

      The id of the tab for which you want to modify the page action.

    Returns Promise<void>

  • Checks whether the page action is shown.

    Parameters

    Returns Promise<boolean>

  • Opens the extension page action in the active window.

    Returns Promise<void>

  • Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.

    Parameters

    Returns Promise<void>

  • Shows the page action. The page action is shown whenever the tab is selected.

    Parameters

    • tabId: number

      The id of the tab for which you want to modify the page action.

    Returns Promise<void>