Closed Bug 1811555 Opened 2 years ago Closed 2 years ago

Investigate how the MV3 permission API works on desktop

Categories

(GeckoView :: Extensions, task)

All
Android
task

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: amejia, Unassigned)

References

Details

(Whiteboard: [geckoview:m111])

Attachments

(1 file)

Key points.

  • How we know if the extension requires permissions for a host.
  • How we can give temporary access for a host.
  • How we can always give access for a host.
  • How we can query "Required", "Optional" and "Read and changes website data"
  • How we can update an "Optional" permission.
  • How we can update "Read and changes website data".

What are these questions referring to? "Website" as in "what is displayed in the current tab" or as in "a URL"?

The title here references the "permission API". I think that you may either be referring to the permissions API (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions). But there are also non-API, user-facing ways to change permissions (which extensions can detect by using permissions.onAdded/onRemoved). Furthermore, there is also the concept of "active tab" (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#activetab_permission), in which extensions are granted (scripting) access to a tab without necessarily receiving access to the URL.

Thanks for the details. I was trying to find which APIs we use on the add-ons button in desktop.

Looks like the that information is coming from ExtensionPermissions#OriginControls.

How we know if the extension requires permissions for a host.

OriginControls.getState()

How we can give temporary access for a host.

OriginControls.setWhenClicked

How we can always give access for a host.

OriginControls.setAlwaysOn

How we can query "Required", "Optional" and "Read and changes website data"

An example can be found here

How we can update an "Optional" permission.

Here is an example of how the about:addons page updates permissions for an add-on

How we can update "Read and changes website data".

An example can be found here

I think we can close this :)

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Whiteboard: [geckoview:m111]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: