Closed Bug 1795338 Opened 2 years ago Closed 2 years ago

getSitePermsAddonInstallForWebpage should account for a NullPrincipal aInstallingPrincipal due to permission requested from a sandboxed subframe

Categories

(WebExtensions :: General, defect)

defect

Tracking

(firefox108 fixed)

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: rpl, Assigned: rpl)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

This corner case is currently throwing from the call to aBrowser.contentPrincipal.isThirdPartyPrincipal(aInstallingPrincipal), we should instead check explicitly if aInstallingPrincipal is a NullPrincipal and reject the request explicitly (so that we can also provide a better error message logged in the console to help the webapp developer to understand why the request has been rejected).

STR (with already SitePermsAddonProvider enabled through pref):

Expected behavior:

  • An explicit reason for rejecting the request (e.g. "SitePermsAddons install is disallowed from sandboxed subframes")

(and Bug 1792993 will improve how we surface that to webapp developers by making sure it is going to be visible in the DevTools webconsole panel associated to the tab that is triggering the error).

Whiteboard: [addons-jira]
Assignee: nobody → lgreco
Status: NEW → ASSIGNED
See Also: → 1792993
Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/890fc7c13d31 getSitePermsAddonInstallForWebpage should account for a NullPrincipal aInstallingPrincipal. r=willdurand,nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: