| 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-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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 54   } | 54   } | 
| 55 }); | 55 }); | 
| 56 | 56 | 
| 57 function onBeforeRequest(url, type, page, frame) | 57 function onBeforeRequest(url, type, page, frame) | 
| 58 { | 58 { | 
| 59   if (isFrameWhitelisted(page, frame)) | 59   if (isFrameWhitelisted(page, frame)) | 
| 60     return true; | 60     return true; | 
| 61 | 61 | 
| 62   var docDomain = extractHostFromFrame(frame); | 62   var docDomain = extractHostFromFrame(frame); | 
| 63   var key = getKey(page, frame); | 63   var key = getKey(page, frame); | 
|  | 64   var specificOnly = isFrameWhitelisted(page, frame, "GENERICBLOCK"); | 
| 64   var filter = defaultMatcher.matchesAny( | 65   var filter = defaultMatcher.matchesAny( | 
| 65     stringifyURL(url), | 66     stringifyURL(url), | 
| 66     type, docDomain, | 67     type, docDomain, | 
| 67     isThirdParty(url, docDomain), | 68     isThirdParty(url, docDomain), | 
| 68     key | 69     key, | 
|  | 70     specificOnly | 
| 69   ); | 71   ); | 
| 70 | 72 | 
| 71   // We can't listen to onHeadersReceived in Safari so we need to | 73   // We can't listen to onHeadersReceived in Safari so we need to | 
| 72   // check for notifications here | 74   // check for notifications here | 
| 73   if (platform != "chromium" && type == "SUBDOCUMENT") | 75   if (platform != "chromium" && type == "SUBDOCUMENT") | 
| 74   { | 76   { | 
| 75     var notificationToShow = NotificationStorage.getNextToShow(stringifyURL(url)
     ); | 77     var notificationToShow = NotificationStorage.getNextToShow(stringifyURL(url)
     ); | 
| 76     if (notificationToShow) | 78     if (notificationToShow) | 
| 77       showNotification(notificationToShow); | 79       showNotification(notificationToShow); | 
| 78   } | 80   } | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
| 106         processKey(header.value, page, frame); | 108         processKey(header.value, page, frame); | 
| 107     } | 109     } | 
| 108 | 110 | 
| 109     var notificationToShow = NotificationStorage.getNextToShow(stringifyURL(new 
     URL(details.url))); | 111     var notificationToShow = NotificationStorage.getNextToShow(stringifyURL(new 
     URL(details.url))); | 
| 110     if (notificationToShow) | 112     if (notificationToShow) | 
| 111       showNotification(notificationToShow); | 113       showNotification(notificationToShow); | 
| 112   } | 114   } | 
| 113 | 115 | 
| 114   chrome.webRequest.onHeadersReceived.addListener(onHeadersReceived, {urls: ["ht
     tp://*/*", "https://*/*"]}, ["responseHeaders"]); | 116   chrome.webRequest.onHeadersReceived.addListener(onHeadersReceived, {urls: ["ht
     tp://*/*", "https://*/*"]}, ["responseHeaders"]); | 
| 115 } | 117 } | 
| OLD | NEW | 
|---|