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

Side by Side Diff: lib/requestBlocker.js

Issue 29374674: Issue 4864 - Start using ESLint for adblockpluschrome (Closed)
Patch Set: Rebased. Created Feb. 28, 2017, 3:47 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/prefs.js ('k') | lib/subscriptionInit.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 22 matching lines...) Expand all
33 RegExpFilter.typeMap.OBJECT_SUBREQUEST = RegExpFilter.typeMap.OBJECT; 33 RegExpFilter.typeMap.OBJECT_SUBREQUEST = RegExpFilter.typeMap.OBJECT;
34 34
35 function onBeforeRequestAsync(page, url, type, docDomain, 35 function onBeforeRequestAsync(page, url, type, docDomain,
36 thirdParty, sitekey, 36 thirdParty, sitekey,
37 specificOnly, filter) 37 specificOnly, filter)
38 { 38 {
39 if (filter) 39 if (filter)
40 FilterNotifier.emit("filter.hitCount", filter, 0, 0, page); 40 FilterNotifier.emit("filter.hitCount", filter, 0, 0, page);
41 41
42 if (devtools) 42 if (devtools)
43 {
43 devtools.logRequest( 44 devtools.logRequest(
44 page, url, type, docDomain, 45 page, url, type, docDomain,
45 thirdParty, sitekey, 46 thirdParty, sitekey,
46 specificOnly, filter 47 specificOnly, filter
47 ); 48 );
49 }
48 } 50 }
49 51
50 ext.webRequest.onBeforeRequest.addListener((url, type, page, frame) => 52 ext.webRequest.onBeforeRequest.addListener((url, type, page, frame) =>
51 { 53 {
52 if (checkWhitelisted(page, frame)) 54 if (checkWhitelisted(page, frame))
53 return true; 55 return true;
54 56
55 let urlString = stringifyURL(url); 57 let urlString = stringifyURL(url);
56 let docDomain = extractHostFromFrame(frame); 58 let docDomain = extractHostFromFrame(frame);
57 let thirdParty = isThirdParty(url, docDomain); 59 let thirdParty = isThirdParty(url, docDomain);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 156
155 port.on("request.websocket", (msg, sender) => 157 port.on("request.websocket", (msg, sender) =>
156 { 158 {
157 return ext.webRequest.onBeforeRequest._dispatch( 159 return ext.webRequest.onBeforeRequest._dispatch(
158 new URL(msg.url), 160 new URL(msg.url),
159 "WEBSOCKET", 161 "WEBSOCKET",
160 sender.page, 162 sender.page,
161 sender.frame 163 sender.frame
162 ).indexOf(false) != -1; 164 ).indexOf(false) != -1;
163 }); 165 });
OLDNEW
« no previous file with comments | « lib/prefs.js ('k') | lib/subscriptionInit.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld