From c61ca9cc2b15a4a955f6a954310c56c987224ae9 Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 15 Jul 2014 07:38:34 -0400 Subject: [PATCH] this fixes #67 --- js/traffic.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/js/traffic.js b/js/traffic.js index 1d4ba3e68..c6aac99d1 100644 --- a/js/traffic.js +++ b/js/traffic.js @@ -62,15 +62,25 @@ var onBeforeRootDocument = function(tabId, details) { if ( referrer === '' ) { return; } + + // https://github.com/gorhill/uBlock/issues/67 + // We need to pass the details of the page which opened this popup, + // so that the `third-party` option works. + var µburi = µb.URI; + var referrerHostname = µburi.hostnameFromURI(referrer); + var pageDetails = { + pageHostname: referrerHostname, + pageDomain: µburi.domainFromHostname(referrerHostname) + }; //console.debug('Referrer="%s"', referrer); var reason = false; if ( µb.getNetFilteringSwitch(pageStore.pageHostname) ) { reason = µb.abpFilters.matchString( - pageStore, + pageDetails, requestURL, 'popup', - µb.URI.hostnameFromURI(requestURL) + µburi.hostnameFromURI(requestURL) ); }