Bug 1552535 Ci.nsIScriptSecurityManager.NO_APP_ID / UNKNOWN_APP_ID are undefined r=VladBaicu a=jcristau
authorAndrei Lazar <andrei.a.lazar@softvision.ro>
Wed, 22 May 2019 13:11:39 +0000
changeset 536538 f06d92271479ef53a162ce72f3ea95f7bdc7caa4
parent 536537 2aeaee73c3a47e0862cb65177ef3a0126fb735f4
child 536539 33995296c30b7941b2cc285ef6885f99cfb46367
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersVladBaicu, jcristau
bugs1552535
milestone68.0
Bug 1552535 Ci.nsIScriptSecurityManager.NO_APP_ID / UNKNOWN_APP_ID are undefined r=VladBaicu a=jcristau Removed variable that resolved to undefined. Differential Revision: https://phabricator.services.mozilla.com/D32136
mobile/android/components/ContentPermissionPrompt.js
--- a/mobile/android/components/ContentPermissionPrompt.js
+++ b/mobile/android/components/ContentPermissionPrompt.js
@@ -52,18 +52,16 @@ ContentPermissionPrompt.prototype = {
     if (request.window) {
       let requestingWindow = request.window.top;
       return this.getChromeWindow(requestingWindow).wrappedJSObject;
     }
     return request.element.ownerGlobal;
   },
 
   prompt: function(request) {
-    let isApp = request.principal.appId !== Ci.nsIScriptSecurityManager.NO_APP_ID && request.principal.appId !== Ci.nsIScriptSecurityManager.UNKNOWN_APP_ID;
-
     // Only allow exactly one permission rquest here.
     let types = request.types.QueryInterface(Ci.nsIArray);
     if (types.length != 1) {
       request.cancel();
       return;
     }
 
     let perm = types.queryElementAt(0, Ci.nsIContentPermissionType);
@@ -116,17 +114,17 @@ ContentPermissionPrompt.prototype = {
       callback: function(aChecked) {
         let isPermanent = (aChecked || entityName == "desktopNotification2");
         // If the user checked "Don't ask again" or this is a desktopNotification, make a permanent exception
         // Also, we don't want to permanently store this exception if the user is in private mode
         if (!isPrivate && isPermanent) {
           Services.perms.addFromPrincipal(request.principal, perm.type, Ci.nsIPermissionManager.ALLOW_ACTION);
         // If we are in private mode, then it doesn't matter if the notification is desktop and also
         // it shouldn't matter if the Don't show checkbox was checked because it shouldn't be show in the first place
-        } else if (isApp || (isPrivate && isPermanent)) {
+        } else if (isPrivate && isPermanent) {
           // Otherwise allow the permission for the current session if the request comes from an app
           // or if the request was made in private mode
           Services.perms.addFromPrincipal(request.principal, perm.type, Ci.nsIPermissionManager.ALLOW_ACTION, Ci.nsIPermissionManager.EXPIRE_SESSION);
         }
 
         callback(/* allow */ true);
       },
       positive: true,