Skip to content

Commit

Permalink
[embedlite-components] Cleanup desktop notifications stuff from Conte…
Browse files Browse the repository at this point in the history
…ntPermissionPrompt.js. Contributes to JB#50930

If the user denied or allowed the request, this will work in any case until the end of the session.
It is necessary to remove unnecessary things for desktop notification.
  • Loading branch information
atatarov committed Oct 30, 2020
1 parent 3788865 commit 6437fce
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions jscomps/ContentPermissionPrompt.js
Expand Up @@ -70,9 +70,7 @@ ContentPermissionPrompt.prototype = {
// If the user checked "Don't ask again", make a permanent exception
if (ret.checkedDontAsk) {
Services.perms.addFromPrincipal(request.principal, perm.type, Ci.nsIPermissionManager.ALLOW_ACTION);
} else if (entityName == "desktopNotification") {
// For notifications, it doesn't make sense to grant permission once. So when the user clicks allow,
// we let the requestor create notifications for the session.
} else {
Services.perms.addFromPrincipal(request.principal, perm.type, Ci.nsIPermissionManager.ALLOW_ACTION,
Ci.nsIPermissionManager.EXPIRE_SESSION);
}
Expand Down

0 comments on commit 6437fce

Please sign in to comment.