Bug 1345687 - Allow identity popup to be shown irrespective of pageproxystate if a permission has been granted to the current site. r=johannh draft
authorNihanth Subramanya <nhnt11@gmail.com>
Wed, 29 Mar 2017 21:04:32 +0530
changeset 553960 222b450ffe9df611b1456a13ee766d5c5b0542a2
parent 552691 272ce6c2572164f5f6a9fba2a980ba9ccf50770c
child 622257 28440834a2bb6f67917809998578eaae8fa8191f
push id51846
push usernhnt11@gmail.com
push dateFri, 31 Mar 2017 04:45:12 +0000
reviewersjohannh
bugs1345687
milestone55.0a1
Bug 1345687 - Allow identity popup to be shown irrespective of pageproxystate if a permission has been granted to the current site. r=johannh MozReview-Commit-ID: 4Bjnkgf1m16
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -7431,18 +7431,24 @@ var gIdentityHandler = {
     event.stopPropagation();
 
     if ((event.type == "click" && event.button != 0) ||
         (event.type == "keypress" && event.charCode != KeyEvent.DOM_VK_SPACE &&
          event.keyCode != KeyEvent.DOM_VK_RETURN)) {
       return; // Left click, space or enter only
     }
 
-    // Don't allow left click, space or enter if the location has been modified.
-    if (gURLBar.getAttribute("pageproxystate") != "valid") {
+    // Don't allow left click, space or enter if the location has been modified,
+    // so long as we're not sharing any devices.
+    // If we are sharing a device, the identity block is prevented by CSS from
+    // being focused (and therefore, interacted with) by the user. However, we
+    // want to allow opening the identity popup from the device control menu,
+    // which calls click() on the identity button, so we don't return early.
+    if (!this._sharingState &&
+        gURLBar.getAttribute("pageproxystate") != "valid") {
       return;
     }
 
     this._popupTriggeredByKeyboard = event.type == "keypress";
 
     // Make sure that the display:none style we set in xul is removed now that
     // the popup is actually needed
     this._identityPopup.hidden = false;