Index: lib/requestBlocker.js |
=================================================================== |
--- a/lib/requestBlocker.js |
+++ b/lib/requestBlocker.js |
@@ -12,27 +12,25 @@ |
* GNU General Public License for more details. |
* |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
/** @module requestBlocker */ |
-"use strict"; |
- |
-const {Filter, RegExpFilter, BlockingFilter} = require("filterClasses"); |
-const {Subscription} = require("subscriptionClasses"); |
-const {defaultMatcher} = require("matcher"); |
-const {FilterNotifier} = require("filterNotifier"); |
-const {Prefs} = require("prefs"); |
-const {checkWhitelisted, getKey} = require("whitelisting"); |
-const {stringifyURL, extractHostFromFrame, isThirdParty} = require("url"); |
-const {port} = require("messaging"); |
-const devtools = require("devtools"); |
+import {Filter, RegExpFilter, BlockingFilter} from "filterClasses"; |
+import {Subscription} from "subscriptionClasses"; |
+import {defaultMatcher} from "matcher"; |
+import {FilterNotifier} from "filterNotifier"; |
+import {Prefs} from "prefs"; |
+import {checkWhitelisted, getKey} from "whitelisting"; |
+import {stringifyURL, extractHostFromFrame, isThirdParty} from "url"; |
+import {port} from "messaging"; |
+import devtools from "devtools"; |
// Chrome can't distinguish between OBJECT_SUBREQUEST and OBJECT requests. |
if (!browser.webRequest.ResourceType || |
!("OBJECT_SUBREQUEST" in browser.webRequest.ResourceType)) |
{ |
RegExpFilter.typeMap.OBJECT_SUBREQUEST = RegExpFilter.typeMap.OBJECT; |
} |
@@ -48,17 +46,17 @@ |
// Treat navigator.sendBeacon() the same as <a ping>, it's essentially the |
// same concept - merely generalized. |
yield ["beacon", "PING"]; |
// Treat <img srcset> and <picture> the same as other images. |
yield ["imageset", "IMAGE"]; |
}()); |
-exports.filterTypes = new Set(function*() |
+export const filterTypes = new Set(function*() |
{ |
// Microsoft Edge does not have webRequest.ResourceType or the devtools panel. |
// Since filterTypes is only used by devtools, we can just bail out here. |
if (!(browser.webRequest.ResourceType)) |
return; |
for (let type in browser.webRequest.ResourceType) |
yield resourceTypes.get(browser.webRequest.ResourceType[type]) || "OTHER"; |