aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2015-06-19 07:35:03 -0400
committergorhill <rhill@raymondhill.net>2015-06-19 07:35:03 -0400
commit4a563538b0eb8372312d1704b5e6e9d1fd2e6a56 (patch)
tree3ec2bec5120d1d4560a2f793b7ecca71a8b838de
parentc07095b7373c88c4857d6919163a11ec83f67715 (diff)
downloaduBlock-4a563538b0eb8372312d1704b5e6e9d1fd2e6a56.zip
uBlock-4a563538b0eb8372312d1704b5e6e9d1fd2e6a56.tar.gz
uBlock-4a563538b0eb8372312d1704b5e6e9d1fd2e6a56.tar.bz2
this fixes #372
-rw-r--r--src/js/static-net-filtering.js76
1 files changed, 38 insertions, 38 deletions
diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js
index fa8c945..c684e9a 100644
--- a/src/js/static-net-filtering.js
+++ b/src/js/static-net-filtering.js
@@ -2242,15 +2242,15 @@ FilterContainer.prototype.matchStringExactType = function(context, requestURL, r
// https://github.com/chrisaljoudi/uBlock/issues/139
// Test against important block filters
- key = toHex(BlockAnyParty | Important | type);
- if ( bucket = categories[key] ) {
+ key = BlockAnyParty | Important | type;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
return true;
}
}
- key = toHex(BlockAction | Important | type | party);
- if ( bucket = categories[key] ) {
+ key = BlockAction | Important | type | party;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
return true;
@@ -2258,15 +2258,15 @@ FilterContainer.prototype.matchStringExactType = function(context, requestURL, r
}
// Test against block filters
- key = toHex(BlockAnyParty | type);
- if ( bucket = categories[key] ) {
+ key = BlockAnyParty | type;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
}
}
if ( this.fRegister === null ) {
- key = toHex(BlockAction | type | party);
- if ( bucket = categories[key] ) {
+ key = BlockAction | type | party;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
}
@@ -2279,15 +2279,15 @@ FilterContainer.prototype.matchStringExactType = function(context, requestURL, r
}
// Test against allow filters
- key = toHex(AllowAnyParty | type);
- if ( bucket = categories[key] ) {
+ key = AllowAnyParty | type;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
return false;
}
}
- key = toHex(AllowAction | type | party);
- if ( bucket = categories[key] ) {
+ key = AllowAction | type | party;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
return false;
@@ -2354,29 +2354,29 @@ FilterContainer.prototype.matchString = function(context) {
// The purpose of the `important` option is to reverse the order of
// evaluation. Normally, it is "evaluate block then evaluate allow", with
// the `important` property it is "evaluate allow then evaluate block".
- key = toHex(BlockAnyTypeAnyParty | Important);
- if ( bucket = categories[key] ) {
+ key = BlockAnyTypeAnyParty | Important;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
return true;
}
}
- key = toHex(BlockAnyType | Important | party);
- if ( bucket = categories[key] ) {
+ key = BlockAnyType | Important | party;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
return true;
}
}
- key = toHex(BlockAnyParty | Important | type);
- if ( bucket = categories[key] ) {
+ key = BlockAnyParty | Important | type;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
return true;
}
}
- key = toHex(BlockAction | Important | type | party);
- if ( bucket = categories[key] ) {
+ key = BlockAction | Important | type | party;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
return true;
@@ -2384,29 +2384,29 @@ FilterContainer.prototype.matchString = function(context) {
}
// Test against block filters
- key = toHex(BlockAnyTypeAnyParty);
- if ( bucket = categories[key] ) {
+ key = BlockAnyTypeAnyParty;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
}
}
if ( this.fRegister === null ) {
- key = toHex(BlockAnyType | party);
- if ( bucket = categories[key] ) {
+ key = BlockAnyType | party;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
}
}
if ( this.fRegister === null ) {
- key = toHex(BlockAnyParty | type);
- if ( bucket = categories[key] ) {
+ key = BlockAnyParty | type;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
}
}
if ( this.fRegister === null ) {
- key = toHex(BlockAction | type | party);
- if ( bucket = categories[key] ) {
+ key = BlockAction | type | party;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
}
@@ -2421,29 +2421,29 @@ FilterContainer.prototype.matchString = function(context) {
}
// Test against allow filters
- key = toHex(AllowAnyTypeAnyParty);
- if ( bucket = categories[key] ) {
+ key = AllowAnyTypeAnyParty;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
return false;
}
}
- key = toHex(AllowAnyType | party);
- if ( bucket = categories[key] ) {
+ key = AllowAnyType | party;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
return false;
}
}
- key = toHex(AllowAnyParty | type);
- if ( bucket = categories[key] ) {
+ key = AllowAnyParty | type;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
return false;
}
}
- key = toHex(AllowAction | type | party);
- if ( bucket = categories[key] ) {
+ key = AllowAction | type | party;
+ if ( bucket = categories[toHex(key)] ) {
if ( this.matchTokens(bucket, url) ) {
this.keyRegister = key;
return false;
@@ -2463,11 +2463,11 @@ FilterContainer.prototype.toResultString = function(verbose) {
if ( this.fRegister === null ) {
return '';
}
- var s = this.keyRegister & 0x01 ? 'sa:' : 'sb:';
+ var s = this.keyRegister & 0x01 ? 'sa:' : 'sb:';
if ( !verbose ) {
return s;
}
- s += this.keyRegister + '\v' + this.tokenRegister + '\v';
+ s += toHex(this.keyRegister) + '\v' + this.tokenRegister + '\v';
if ( this.tokenRegister === '.' ) {
s += this.fRegister.rtCompile();
} else {