Bug 1037128 - Regression: Contact API usage is being prompt on webpages r=fabrice
☠☠ backed out by ae4192ba2824 ☠ ☠
authorMark Finkle <mfinkle@mozilla.com>
Mon, 14 Jul 2014 10:31:16 -0700
changeset 215799 1a9546b1b79d6b65b038e3329942281ccf89a467
parent 215798 bd68bbc99e5d5d190e834a3f7046172e04b24032
child 215800 5d15054bce20bc6b9c160301ca8eae0143b9882c
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs1037128
milestone33.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 1037128 - Regression: Contact API usage is being prompt on webpages r=fabrice
dom/contacts/ContactManager.js
--- a/dom/contacts/ContactManager.js
+++ b/dom/contacts/ContactManager.js
@@ -245,18 +245,20 @@ ContactManager.prototype = {
     // Shortcut for ALLOW_ACTION so we avoid a parent roundtrip
     let principal = this._window.document.nodePrincipal;
     let type = "contacts-" + access;
     let permValue =
       Services.perms.testExactPermissionFromPrincipal(principal, type);
     if (permValue == Ci.nsIPermissionManager.ALLOW_ACTION) {
       aAllowCallback();
       return;
-    } else if (permValue == Ci.nsIPermissionManager.DENY_ACTION) {
-      aCancelCallback();
+    } else if (permValue == Ci.nsIPermissionManager.DENY_ACTION ||
+               permValue == Ci.nsIPermissionManager.UNKNOWN_ACTION) {
+       aCancelCallback();
+      return;
     }
 
     // Create an array with a single nsIContentPermissionType element.
     let type = {
       type: "contacts",
       access: access,
       options: [],
       QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionType])