browserAction.getUserSettings()

Gets the user-specified settings for the browser action.

This is an asynchronous function that returns a Promise.

Syntax

js
let userSettings = await browser.browserAction.getUserSettings();

Parameters

This function takes no parameters.

Return value

A Promise that fulfills with an object with these properties:

userSettings

An object containing the user-specified settings for the browser action with these properties:

isOnToolbar Optional

boolean. Whether the user has pinned the action's icon to the browser UI. This setting does not indicate whether the action icon is visible. The icon's visibility depends on the size of the browser window and the layout of the browser UI.

Examples

This code logs a message indicating whether the browser action is pinned or not:

js
function gotSettings(userSettings) {
  if (userSettings.isOnToolbar) {
    console.log("Browser action is pinned to toolbar.");
  } else {
    console.log("Browser action is not pinned to toolbar.");
  }
}

let gettingUserSettings = browser.browserAction.getUserSettings();
gettingUserSettings.then(gotSettings);

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
getUserSettings
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 116 (Release date: 2023-08-01)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote
footnote See bug 294444
Firefox for Android – Full support
Firefox for Android 116 (Release date: 2023-08-01)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote
footnote See bug 294444
userSettings.isOnToolbar in returned object
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 116 (Release date: 2023-08-01)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
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.