Bug 1712754 - Do not autogrant permissions in GV push notification code. r=aklotz

Differential Revision: https://phabricator.services.mozilla.com/D116293
This commit is contained in:
Dylan Roeh 2021-06-07 17:57:26 +00:00
Родитель bbdf0480b8
Коммит eaaaa8490a
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

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