diff --git a/src/js/dynamic-net-filtering.js b/src/js/dynamic-net-filtering.js index dcace3433..1dd6c273a 100644 --- a/src/js/dynamic-net-filtering.js +++ b/src/js/dynamic-net-filtering.js @@ -321,7 +321,11 @@ var is3rdParty = function(srcHostname, desHostname) { } var srcDomain = domainFromHostname(srcHostname); if ( srcDomain === '' ) { - srcDomain = desHostname; + if ( srcHostname !== '' ) { + srcDomain = srcHostname; + } else { + srcDomain = desHostname; + } } if ( desHostname.slice(0 - srcDomain.length) !== srcDomain ) { return true; diff --git a/src/js/pagestore.js b/src/js/pagestore.js index 69d2be91d..d5d1e4418 100644 --- a/src/js/pagestore.js +++ b/src/js/pagestore.js @@ -384,8 +384,8 @@ NetFilteringResultCache.prototype.pruneAsyncCallback = function() { /******************************************************************************/ -NetFilteringResultCache.prototype.lookup = function(url) { - return this.urls[url]; +NetFilteringResultCache.prototype.lookup = function(context) { + return this.urls[context.requestType + ' ' + context.requestURL]; }; /******************************************************************************/ @@ -645,7 +645,7 @@ PageStore.prototype.filterRequest = function(context) { return ''; } - var entry = this.netFilteringCache.lookup(context.requestURL); + var entry = this.netFilteringCache.lookup(context); if ( entry !== undefined ) { //console.debug('cache HIT: PageStore.filterRequest("%s")', context.requestURL); return entry.result;