Add support for optional-only permissions
Categories
(WebExtensions :: General, enhancement, P2)
Tracking
(firefox134 fixed)
Tracking | Status | |
---|---|---|
firefox134 | --- | fixed |
People
(Reporter: zombie, Assigned: robwu)
References
Details
(Keywords: dev-doc-complete, Whiteboard: [addons-jira])
Attachments
(1 file)
We need a way to support trial/experimental APIs, and our approach will be a permission which can only be requested at at runtime, not as part of initial install.
Updated•5 months ago
|
Updated•5 months ago
|
Assignee | ||
Comment 1•3 months ago
|
||
As discussed with Tom, I'm going to implement this, starting with the trialML permission for bug 1917799. The final string for that is at https://mozilla-hub.atlassian.net/browse/WEBEXT-1994
Assignee | ||
Comment 2•3 months ago
|
||
This patch adds the OptionalOnlyPermission type of permission, with
trialML as an example.
Assignee | ||
Comment 3•3 months ago
|
||
More context for the permission string is at bug 1932463. My patch contains the same string already; in case the patch here cannot be approved in time (by tomorrow), then the other patch needs to land first because string freeze starts on Friday.
Reporter | ||
Updated•3 months ago
|
Comment 6•3 months ago
|
||
We normally don't include a description in the manifest documentation for optional permissions. However, all other permissions are referenced from the relevant API documentation. As this one isn't (unless there's a documentation request I've missed), should we include a comment about its purpose or rely on that from some other source? Also, is this valid for MV2 and MV3?
Assignee | ||
Comment 7•3 months ago
|
||
The purpose of this documentation request is to document that the concept of optional-only permissions exist. An optional-only permission is a permission that can only be listed in optional_permissions
in the manifest.json file, but not in permissions
. This means that the permission cannot be granted at install time, and the extension developer needs to check for permission availability via permissions.contains()
and request the permission via permissions.request()
. Another special aspect is that the permissions.request()
call can only take one permission when requesting an optional-only permission (ordinarily, permissions.request()
takes multiple).
As for concrete examples - that is a tougher question. All APIs with optional-only permissions are still behind a flag.
The patch here introduces the "trialML" permission. We should not document this one yet, since the feature is still in development.
Bug 1917000 adds the "userScripts" permission. This one is optional-only in Firefox, but a regular permission in Chrome (with its own special API constraints).
The userScripts API itself is behind a pref too, and not officially released yet. I'm considering to already document it since Chrome has an implementation of the API (with some missing parts - I am documenting the differences and handing that over to Simeon since he is already familiar with the API).
Comment 9•3 months ago
|
||
Documentation changes in PR Optional-only permissions #36988.
Comment 10•1 month ago
|
||
A reminder that documentation changes are awaiting to be reviewed Optional-only permissions #36988
Assignee | ||
Comment 11•1 month ago
|
||
The PR was already reviewed, approved and merged last month. Changing dev-doc-needed to dev-doc-complete to reflect that.
Description
•