Bug 1383908 check if we're running in a main window before using CUI, r?Gijs draft
authorShane Caraveo <scaraveo@mozilla.com>
Wed, 26 Jul 2017 10:09:23 -0700
changeset 616015 4656cb40e52a084d23d311cd8497ae516bf7f5fe
parent 614544 462d7561089c98e33382384896434861ad7bc491
child 639346 883428ceaec7f6339f5853dcf4d2fcd61440fe56
push id70552
push usermixedpuppy@gmail.com
push dateWed, 26 Jul 2017 17:09:45 +0000
reviewersGijs
bugs1383908
milestone56.0a1
Bug 1383908 check if we're running in a main window before using CUI, r?Gijs MozReview-Commit-ID: K8H4IesdQsV
browser/base/content/browser-social.js
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -357,17 +357,17 @@ SocialShare = {
     }
     this.defaultButton.setAttribute("checked", "true");
   },
 
   get shareButton() {
     // web-panels (bookmark/sidebar) don't include customizableui, so
     // nsContextMenu fails when accessing shareButton, breaking
     // browser_bug409481.js.
-    if (!window.CustomizableUI)
+    if (document.documentElement.getAttribute("windowtype") !== "navigator:browser")
       return null;
     let widget = CustomizableUI.getWidget("social-share-button");
     if (!widget || !widget.areaType)
       return null;
     return widget.forWindow(window).node;
   },
 
   _onclick() {