Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/requestBlocker.js

Issue 29715577: Issue 6449 - Switch to Harmony modules (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Add lib/.eslintrc.json Created March 6, 2018, 10:30 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« lib/.eslintrc.json ('K') | « lib/prefs.js ('k') | lib/stats.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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";
« lib/.eslintrc.json ('K') | « lib/prefs.js ('k') | lib/stats.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld