How to fetch website permissions as a browser extension

1 day ago 3
ARTICLE AD BOX

I'm writing my first browser extensions using Manifest Version 3.

I'm trying to manipulate the website permissions, the same shown in the Firefox's Page Info:

enter image description here

I found the source code here:

https://github.com/mozilla-firefox/firefox/blob/main/browser/base/content/pageinfo/permissions.js#L17

There is some interesting code browsing to resource:///modules/SitePermissions.sys.mjs too.

Using the about:debugging in the Inspect button I'm able to access the browser global object.

There are several interesting settings on browser.privacy.websites and browser.privacy.network , but they are global (I need a domain/website granular permission), and even the tabs (browser.tabs.query({})) don't have such permissions.

The browser.permission is related to the extension permission itself and not site permissions, this makes the research about the topic harder.

Is there a way to manipulate the same information we see in the Page Info as a web extension?

Read Entire Article