Bug 1383908 check if we're running in a main window before using CUI, r=Gijs

MozReview-Commit-ID: K8H4IesdQsV

--HG--
extra : rebase_source : c5a44859b33bcf3aa96df46be2422580b03d748b
This commit is contained in:
Shane Caraveo 2017-07-26 10:09:23 -07:00
parent 9b2a8970fa
commit e9bcff21e9

View File

@ -362,7 +362,7 @@ SocialShare = {
// 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)