mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-04 10:09:38 +02:00
code review: #433
This commit is contained in:
parent
1fe7045b92
commit
b49b0864d3
@ -296,7 +296,7 @@ PageStore.factory = function(tabId, pageURL) {
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
PageStore.prototype.bitFromRequestType = {
|
||||
PageStore.prototype.bitFromResult = {
|
||||
'': 1,
|
||||
'sb': 2,
|
||||
'sa': 4,
|
||||
@ -320,8 +320,8 @@ PageStore.prototype.init = function(tabId, pageURL) {
|
||||
|
||||
// This is part of the filtering evaluation context
|
||||
this.requestURL = this.requestHostname = this.requestType = '';
|
||||
this.requestHostnames = {};
|
||||
|
||||
this.requestHostnames = {};
|
||||
this.frames = {};
|
||||
this.netFiltering = true;
|
||||
this.netFilteringReadTime = 0;
|
||||
@ -452,9 +452,9 @@ PageStore.prototype.filterRequest = function(context) {
|
||||
|
||||
var requestHostname = context.requestHostname;
|
||||
if ( this.requestHostnames.hasOwnProperty(requestHostname) ) {
|
||||
this.requestHostnames[requestHostname] |= this.bitFromRequestType[result.slice(0, 2)];
|
||||
this.requestHostnames[requestHostname] |= this.bitFromResult[result.slice(0, 2)];
|
||||
} else {
|
||||
this.requestHostnames[requestHostname] = this.bitFromRequestType[result.slice(0, 2)];
|
||||
this.requestHostnames[requestHostname] = this.bitFromResult[result.slice(0, 2)];
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -371,20 +371,18 @@ var matchWhitelistDirective = function(url, hostname, directive) {
|
||||
if ( df.mustBlockOrAllow() ) {
|
||||
return df.toFilterString();
|
||||
}
|
||||
}
|
||||
|
||||
if ( requestType === 'sub_frame' ) {
|
||||
} else if ( requestType === 'sub_frame' ) {
|
||||
if ( this.isFirstParty(rootHostname, requestHostname) === false ) {
|
||||
df.evaluateCellZY(rootHostname, requestHostname, '3p-frame');
|
||||
if ( df.mustBlockOrAllow() ) {
|
||||
return df.toFilterString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
df.evaluateCellZY(rootHostname, requestHostname, requestType);
|
||||
if ( df.mustBlockOrAllow() ) {
|
||||
return df.toFilterString();
|
||||
} else {
|
||||
df.evaluateCellZY(rootHostname, requestHostname, requestType);
|
||||
if ( df.mustBlockOrAllow() ) {
|
||||
return df.toFilterString();
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Static filtering never override dynamic filtering
|
||||
|
Loading…
Reference in New Issue
Block a user