OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the Adblock Plus extension, | 2 * This file is part of the Adblock Plus extension, |
3 * Copyright (C) 2006-2012 Eyeo GmbH | 3 * Copyright (C) 2006-2012 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 26 matching lines...) Expand all Loading... |
37 { | 37 { |
38 if (!(tabId in tabsLoading)) | 38 if (!(tabId in tabsLoading)) |
39 { | 39 { |
40 // Not a pop-up we've previously seen | 40 // Not a pop-up we've previously seen |
41 return; | 41 return; |
42 } | 42 } |
43 | 43 |
44 if ("url" in changeInfo) | 44 if ("url" in changeInfo) |
45 checkPotentialPopup(tabId, tab.url, tabsLoading[tabId]); | 45 checkPotentialPopup(tabId, tab.url, tabsLoading[tabId]); |
46 | 46 |
47 if ("status" in changeInfo && changeInfo.status == "complete") | 47 if ("status" in changeInfo && changeInfo.status == "complete" && tab.url != "a
bout:blank") |
48 delete tabsLoading[tabId]; | 48 delete tabsLoading[tabId]; |
49 }); | 49 }); |
50 | 50 |
51 | 51 |
52 function checkPotentialPopup(tabId, url, opener) | 52 function checkPotentialPopup(tabId, url, opener) |
53 { | 53 { |
54 var requestHost = extractHostFromURL(url); | 54 var requestHost = extractHostFromURL(url); |
55 var documentHost = extractHostFromURL(opener); | 55 var documentHost = extractHostFromURL(opener); |
56 var thirdParty = isThirdParty(requestHost, documentHost); | 56 var thirdParty = isThirdParty(requestHost, documentHost); |
57 var filter = defaultMatcher.matchesAny(url || "about:blank", "POPUP", document
Host, thirdParty); | 57 var filter = defaultMatcher.matchesAny(url || "about:blank", "POPUP", document
Host, thirdParty); |
58 if (filter instanceof BlockingFilter) | 58 if (filter instanceof BlockingFilter) |
59 chrome.tabs.remove(tabId); | 59 chrome.tabs.remove(tabId); |
60 } | 60 } |
OLD | NEW |