Index: lib/filterComposer.js |
=================================================================== |
--- a/lib/filterComposer.js |
+++ b/lib/filterComposer.js |
@@ -179,31 +179,36 @@ |
page.contextMenus.remove(contextMenuItem); |
if (typeof filter == "undefined") |
filter = checkWhitelisted(page); |
if (!filter && Prefs.shouldShowBlockElementMenu && readyPages.has(page)) |
page.contextMenus.create(contextMenuItem); |
} |
-FilterNotifier.on("page.WhitelistingStateRevalidate", updateContextMenu); |
- |
-Prefs.on("shouldShowBlockElementMenu", () => |
+if ("contextMenus" in chrome) |
{ |
- ext.pages.query({}, pages => |
+ FilterNotifier.on("page.WhitelistingStateRevalidate", updateContextMenu); |
+ |
+ Prefs.on("shouldShowBlockElementMenu", () => |
{ |
- for (let page of pages) |
- updateContextMenu(page); |
+ ext.pages.query({}, pages => |
+ { |
+ for (let page of pages) |
+ updateContextMenu(page); |
+ }); |
}); |
-}); |
+} |
port.on("composer.ready", (message, sender) => |
{ |
readyPages.set(sender.page, null); |
- updateContextMenu(sender.page); |
+ |
+ if ("contextMenus" in chrome) |
+ updateContextMenu(sender.page); |
}); |
port.on("composer.openDialog", (message, sender) => |
{ |
return new Promise(resolve => |
{ |
ext.windows.create({ |
url: ext.getURL("composer.html"), |