Bug 1383908 check if we're running in a main window before using CUI, r=Gijs
authorShane Caraveo <scaraveo@mozilla.com>
Wed, 26 Jul 2017 10:09:23 -0700
changeset 371216 39b5cf816c131724eb42a4f1b3a46b1c1be9c964
parent 371215 4df14467e14cd45297ff6fb096f9f4340e79144a
child 371217 d18e2a7fb353cef42ae6c21b76022b45b3cf89c7
push id93049
push usercbook@mozilla.com
push dateThu, 27 Jul 2017 09:30:07 +0000
treeherdermozilla-inbound@5e9f7561c2eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1383908
milestone56.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 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() {