Bug 1552535 Ci.nsIScriptSecurityManager.NO_APP_ID / UNKNOWN_APP_ID are undefined r=VladBaicu
authorAndrei Lazar <andrei.a.lazar@softvision.ro>
Wed, 22 May 2019 13:11:39 +0000
changeset 474958 423af5a3c7e2ea11d43d93bca16ce52247b866ee
parent 474957 ba6a5d200cc5ce1992e159379d637f506d6e0c6c
child 474959 e6649a41094ee994770ee580f74ecf9c63c8d586
push id36052
push userbtara@mozilla.com
push dateThu, 23 May 2019 04:37:46 +0000
treeherdermozilla-central@d12917561f27 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersVladBaicu
bugs1552535
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1552535 Ci.nsIScriptSecurityManager.NO_APP_ID / UNKNOWN_APP_ID are undefined r=VladBaicu 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,