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

Delta Between Two Patch Sets: lib/requestBlocker.js

Issue 29463558: Issue 5300 - Add feature detection for object_subrequest (Closed)
Left Patch Set: Created June 12, 2017, 9:51 a.m.
Right Patch Set: fix nit Created June 12, 2017, 3:37 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 14 matching lines...) Expand all
25 const {FilterNotifier} = require("filterNotifier"); 25 const {FilterNotifier} = require("filterNotifier");
26 const {Prefs} = require("prefs"); 26 const {Prefs} = require("prefs");
27 const {checkWhitelisted, getKey} = require("whitelisting"); 27 const {checkWhitelisted, getKey} = require("whitelisting");
28 const {stringifyURL, extractHostFromFrame, isThirdParty} = require("url"); 28 const {stringifyURL, extractHostFromFrame, isThirdParty} = require("url");
29 const {port} = require("messaging"); 29 const {port} = require("messaging");
30 const devtools = require("devtools"); 30 const devtools = require("devtools");
31 31
32 // Chrome can't distinguish between OBJECT_SUBREQUEST and OBJECT requests. 32 // Chrome can't distinguish between OBJECT_SUBREQUEST and OBJECT requests.
33 if (!("OBJECT_SUBREQUEST" in chrome.webRequest.ResourceType)) 33 if (!("OBJECT_SUBREQUEST" in chrome.webRequest.ResourceType))
34 RegExpFilter.typeMap.OBJECT_SUBREQUEST = RegExpFilter.typeMap.OBJECT; 34 RegExpFilter.typeMap.OBJECT_SUBREQUEST = RegExpFilter.typeMap.OBJECT;
35
Sebastian Noack 2017/06/12 12:20:43 Nit: The extra blank line added here is redundant.
Jon Sonesen 2017/06/12 15:37:47 Acknowledged.
36 35
37 // Map of content types reported by the browser to the respecitve content types 36 // Map of content types reported by the browser to the respecitve content types
38 // used by Adblock Plus. Other content types are simply mapped to OTHER. 37 // used by Adblock Plus. Other content types are simply mapped to OTHER.
39 let resourceTypes = new Map(function*() 38 let resourceTypes = new Map(function*()
40 { 39 {
41 for (let type in RegExpFilter.typeMap) 40 for (let type in RegExpFilter.typeMap)
42 yield [type.toLowerCase(), type]; 41 yield [type.toLowerCase(), type];
43 42
44 yield ["sub_frame", "SUBDOCUMENT"]; 43 yield ["sub_frame", "SUBDOCUMENT"];
45 44
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 if (msg.requestType.toUpperCase() in chrome.webRequest.ResourceType) 189 if (msg.requestType.toUpperCase() in chrome.webRequest.ResourceType)
191 return false; 190 return false;
192 191
193 return ext.webRequest.onBeforeRequest._dispatch( 192 return ext.webRequest.onBeforeRequest._dispatch(
194 new URL(msg.url), 193 new URL(msg.url),
195 msg.requestType, 194 msg.requestType,
196 sender.page, 195 sender.page,
197 sender.frame 196 sender.frame
198 ).includes(false); 197 ).includes(false);
199 }); 198 });
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld