Index: lib/main.js |
=================================================================== |
--- a/lib/main.js |
+++ b/lib/main.js |
@@ -15,13 +15,7 @@ |
Prefs.migrate("extensions.adblockplus.ehh.showhelp", "showhelp"); |
// Window types to attach to |
-let knownWindowTypes = |
-{ |
- "navigator:browser": true, |
- "mail:3pane": true, |
- "mail:messageWindow": true, |
- __proto__: null |
-}; |
+let knownWindowTypes = new Set(["navigator:browser", "mail:3pane", "mail:messageWindow"]); |
// Use random marker class |
let elementMarkerClass = null; |
@@ -48,7 +42,7 @@ |
let styleService = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService); |
let styleURI = Services.io.newURI("data:text/css," + encodeURIComponent(data), null, null); |
styleService.loadAndRegisterSheet(styleURI, Ci.nsIStyleSheetService.USER_SHEET); |
- onShutdown.add(function() styleService.unregisterSheet(styleURI, Ci.nsIStyleSheetService.USER_SHEET)); |
+ onShutdown.add(() => styleService.unregisterSheet(styleURI, Ci.nsIStyleSheetService.USER_SHEET)); |
}, false); |
request.send(null); |
@@ -68,7 +62,7 @@ |
applyToWindow: function(window) |
{ |
let type = window.document.documentElement.getAttribute("windowtype"); |
- if (!(type in knownWindowTypes) || window._ehhWrapper) |
+ if (!knownWindowTypes.has(type) || window._ehhWrapper) |
return; |
window.document.documentElement.appendChild(overlay.cloneNode(true)); |