This commit is contained in:
gorhill 2015-03-31 07:26:43 -04:00
parent 99a0d28c98
commit cd76d79110
2 changed files with 8 additions and 4 deletions

View File

@ -321,7 +321,11 @@ var is3rdParty = function(srcHostname, desHostname) {
} }
var srcDomain = domainFromHostname(srcHostname); var srcDomain = domainFromHostname(srcHostname);
if ( srcDomain === '' ) { if ( srcDomain === '' ) {
srcDomain = desHostname; if ( srcHostname !== '' ) {
srcDomain = srcHostname;
} else {
srcDomain = desHostname;
}
} }
if ( desHostname.slice(0 - srcDomain.length) !== srcDomain ) { if ( desHostname.slice(0 - srcDomain.length) !== srcDomain ) {
return true; return true;

View File

@ -384,8 +384,8 @@ NetFilteringResultCache.prototype.pruneAsyncCallback = function() {
/******************************************************************************/ /******************************************************************************/
NetFilteringResultCache.prototype.lookup = function(url) { NetFilteringResultCache.prototype.lookup = function(context) {
return this.urls[url]; return this.urls[context.requestType + ' ' + context.requestURL];
}; };
/******************************************************************************/ /******************************************************************************/
@ -645,7 +645,7 @@ PageStore.prototype.filterRequest = function(context) {
return ''; return '';
} }
var entry = this.netFilteringCache.lookup(context.requestURL); var entry = this.netFilteringCache.lookup(context);
if ( entry !== undefined ) { if ( entry !== undefined ) {
//console.debug('cache HIT: PageStore.filterRequest("%s")', context.requestURL); //console.debug('cache HIT: PageStore.filterRequest("%s")', context.requestURL);
return entry.result; return entry.result;