OLD | NEW |
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 22 matching lines...) Expand all Loading... |
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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 port.on("request.websocket", (msg, sender) => | 163 port.on("request.websocket", (msg, sender) => |
162 { | 164 { |
163 return ext.webRequest.onBeforeRequest._dispatch( | 165 return ext.webRequest.onBeforeRequest._dispatch( |
164 new URL(msg.url), | 166 new URL(msg.url), |
165 "WEBSOCKET", | 167 "WEBSOCKET", |
166 sender.page, | 168 sender.page, |
167 sender.frame | 169 sender.frame |
168 ).indexOf(false) != -1; | 170 ).indexOf(false) != -1; |
169 }); | 171 }); |
170 } | 172 } |
OLD | NEW |