action.getUserSettings()

Gets the user-specified settings for the browser action.

Note: This API is available in Manifest V3 or higher.

This is an asynchronous function that returns a Promise.

Syntax

js
let userSettings = await browser.action.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 action is pinned or not:

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

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

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
getUserSettings
Chrome – Full support
Chrome 91 (Release date: 2021-05-25)
footnote Full support
Edge – Full support
Edge 91 (Release date: 2021-05-27)
footnote Full support
Firefox – Full support
Firefox 116 (Release date: 2023-08-01)
footnote Full support
Opera – Full support
Opera 77 (Release date: 2021-06-09)
footnote Full 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 – Full support
Chrome 91 (Release date: 2021-05-25)
footnote Full support
Edge – Full support
Edge 91 (Release date: 2021-05-27)
footnote Full support
Firefox – Full support
Firefox 116 (Release date: 2023-08-01)
footnote Full support
Opera – Full support
Opera 77 (Release date: 2021-06-09)
footnote Full 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.

Note: This API is based on Chromium's chrome.action API.