1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 07:22:28 +02:00
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);
if ( srcDomain === '' ) {
srcDomain = desHostname;
if ( srcHostname !== '' ) {
srcDomain = srcHostname;
} else {
srcDomain = desHostname;
}
}
if ( desHostname.slice(0 - srcDomain.length) !== srcDomain ) {
return true;

View File

@ -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;