LEFT | RIGHT |
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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 FilterNotifier.triggerListeners("filter.hitCount", filter, 0, 0, page); | 58 FilterNotifier.triggerListeners("filter.hitCount", filter, 0, 0, page); |
59 } | 59 } |
60 | 60 |
61 function onBeforeRequest(url, type, page, frame) | 61 function onBeforeRequest(url, type, page, frame) |
62 { | 62 { |
63 if (isFrameWhitelisted(page, frame)) | 63 if (isFrameWhitelisted(page, frame)) |
64 return true; | 64 return true; |
65 | 65 |
66 var docDomain = extractHostFromFrame(frame); | 66 var docDomain = extractHostFromFrame(frame); |
67 var key = getKey(page, frame); | 67 var key = getKey(page, frame); |
68 var specificOnly = isFrameWhitelisted(page, frame, RegExpFilter.typeMap.GENERI
CBLOCK); | 68 var specificOnly = isFrameWhitelisted(page, frame, |
| 69 RegExpFilter.typeMap.GENERICBLOCK); |
69 var filter = defaultMatcher.matchesAny( | 70 var filter = defaultMatcher.matchesAny( |
70 stringifyURL(url), | 71 stringifyURL(url), |
71 RegExpFilter.typeMap[type], docDomain, | 72 RegExpFilter.typeMap[type], docDomain, |
72 isThirdParty(url, docDomain), | 73 isThirdParty(url, docDomain), |
73 key, | 74 key, |
74 specificOnly | 75 specificOnly |
75 ); | 76 ); |
76 | 77 |
77 setTimeout(onBeforeRequestAsync, 0, url, type, page, filter); | 78 setTimeout(onBeforeRequestAsync, 0, url, type, page, filter); |
78 | 79 |
(...skipping 24 matching lines...) Expand all Loading... |
103 | 104 |
104 chrome.webRequest.onHeadersReceived.addListener( | 105 chrome.webRequest.onHeadersReceived.addListener( |
105 onHeadersReceived, | 106 onHeadersReceived, |
106 { | 107 { |
107 urls: ["http://*/*", "https://*/*"], | 108 urls: ["http://*/*", "https://*/*"], |
108 types: ["main_frame", "sub_frame"] | 109 types: ["main_frame", "sub_frame"] |
109 }, | 110 }, |
110 ["responseHeaders"] | 111 ["responseHeaders"] |
111 ); | 112 ); |
112 } | 113 } |
LEFT | RIGHT |