Can't access browserAction in Firefox extension browser object

27 Views Asked by At

How to access the browserAction on a Firefox extension while using manifest version 3?

From the background.js trying to access the browserAction as documented here, it shows as undefined.

1

There are 1 best solutions below

0
weshouman On

In manifest version 3, Chrome replaced browserAction and pageAction with a unified action API. For example, in a Chrome MV3 extension, one would use chrome.action instead of chrome.browserAction.

Which seems to be mirrored in Mozilla Firefox manifest version 3 adaptation, while still not having the documentation updated.