 Issue 5138680696012800:
  Issue 616 - Enforce $generichide and $genericblock in Chrome  (Closed)
    
  
    Issue 5138680696012800:
  Issue 616 - Enforce $generichide and $genericblock in Chrome  (Closed) 
  | Index: popupBlocker.js | 
| diff --git a/popupBlocker.js b/popupBlocker.js | 
| index f33e381acee581b43989bbba632c10db7b73e005..b65010c212d9af7a81304d4bb80ccd6a4fdc7ba1 100644 | 
| --- a/popupBlocker.js | 
| +++ b/popupBlocker.js | 
| @@ -31,8 +31,14 @@ if (require("info").platform == "chromium") | 
| if (!documentHost) | 
| return; | 
| - tabsLoading[details.tabId] = documentHost; | 
| - checkPotentialPopup(details.tabId, details.url, documentHost); | 
| + var specificOnly = isFrameWhitelisted(sourcePage, sourceFrame, | 
| + RegExpFilter.typeMap.GENERICBLOCK); | 
| + | 
| + tabsLoading[details.tabId] = { | 
| + documentHost: documentHost, | 
| + specificOnly: specificOnly | 
| + }; | 
| + checkPotentialPopup(details.tabId, details.url, documentHost, specificOnly); | 
| }); | 
| chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) | 
| @@ -44,20 +50,25 @@ if (require("info").platform == "chromium") | 
| } | 
| if ("url" in changeInfo) | 
| - checkPotentialPopup(tabId, tab.url, tabsLoading[tabId]); | 
| + { | 
| + var source = tabsLoading[tabId]; | 
| 
Thomas Greiner
2015/09/02 16:28:20
Would make sense to check for `tabId in tabsLoadin
 
kzar
2015/09/05 14:53:44
I think that check is already carried out just abo
 
Thomas Greiner
2015/09/18 17:41:05
Don't know how I missed that. You're right.
 | 
| + checkPotentialPopup(tabId, tab.url, source.documentHost, | 
| + source.specificOnly); | 
| + } | 
| if ("status" in changeInfo && changeInfo.status == "complete" && tab.url != "about:blank") | 
| delete tabsLoading[tabId]; | 
| }); | 
| } | 
| -function checkPotentialPopup(tabId, url, documentHost) | 
| +function checkPotentialPopup(tabId, url, documentHost, specificOnly) | 
| { | 
| url = new URL(url || "about:blank"); | 
| var filter = defaultMatcher.matchesAny( | 
| stringifyURL(url), RegExpFilter.typeMap.POPUP, | 
| - documentHost, isThirdParty(url, documentHost) | 
| + documentHost, isThirdParty(url, documentHost), | 
| + null, specificOnly | 
| ); | 
| if (filter instanceof BlockingFilter) |