Bug 1611035 - Grant "desktop-notification" when delivering Web Push in GeckoView r=geckoview-reviewers,agi

Differential Revision: https://phabricator.services.mozilla.com/D76218
This commit is contained in:
James Willcox 2020-05-21 20:20:40 +00:00
parent 99cc4bf60e
commit b4862ab01a

View File

@ -47,6 +47,15 @@ const GeckoViewPushController = {
const [url, principal] = createScopeAndPrincipal(scope);
// Grant this since there is no way for the worker
// to prompt for permission.
Services.perms.addFromPrincipal(
principal,
"desktop-notification",
Services.perms.ALLOW_ACTION,
Services.perms.EXPIRE_SESSION
);
if (!data) {
PushNotifier.notifyPush(url, principal);
return;