Index: popupBlocker.js |
diff --git a/popupBlocker.js b/popupBlocker.js |
index 2735f0a987d5d6dbdd093efe9c5d51cfaaeb3be6..7c3ddab799cfa24b2606713adfd3f9f56e448afa 100644 |
--- a/popupBlocker.js |
+++ b/popupBlocker.js |
@@ -31,8 +31,19 @@ if (require("info").platform == "chromium") |
if (!documentHost) |
return; |
- tabsLoading[details.tabId] = documentHost; |
- checkPotentialPopup(details.tabId, details.url, documentHost); |
+ var frame = sourceFrame; |
+ var specificOnly = false; |
+ while (frame && !specificOnly) |
+ { |
+ specificOnly = isFrameWhitelisted(sourcePage, frame, "GENERICBLOCK"); |
+ frame = frame.parent; |
+ } |
+ |
+ tabsLoading[details.tabId] = { |
+ documentHost: documentHost, |
+ specificOnly: specificOnly |
+ }; |
+ checkPotentialPopup(details.tabId, details.url, specificOnly, documentHost); |
}); |
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) |
@@ -44,20 +55,24 @@ if (require("info").platform == "chromium") |
} |
if ("url" in changeInfo) |
- checkPotentialPopup(tabId, tab.url, tabsLoading[tabId]); |
+ { |
+ var source = tabsLoading[tabId]; |
+ checkPotentialPopup(tabId, tab.url, source.specificOnly, source.documentHost); |
+ } |
if ("status" in changeInfo && changeInfo.status == "complete" && tab.url != "about:blank") |
delete tabsLoading[tabId]; |
}); |
} |
-function checkPotentialPopup(tabId, url, documentHost) |
+function checkPotentialPopup(tabId, url, specificOnly, documentHost) |
{ |
url = new URL(url || "about:blank"); |
var filter = defaultMatcher.matchesAny( |
stringifyURL(url), "POPUP", |
- documentHost, isThirdParty(url, documentHost) |
+ documentHost, isThirdParty(url, documentHost), |
+ undefined, specificOnly |
); |
if (filter instanceof BlockingFilter) |