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 419825 39b5cf816c131724eb42a4f1b3a46b1c1be9c964
parent 419824 4df14467e14cd45297ff6fb096f9f4340e79144a
child 419826 d18e2a7fb353cef42ae6c21b76022b45b3cf89c7
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [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() {