This commit is contained in:
gorhill 2017-09-16 07:49:43 -04:00
parent f632171566
commit 2c4faaa84d
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 20 additions and 16 deletions

View File

@ -120,8 +120,8 @@ var µBlock = (function() { // jshint ignore:line
// read-only // read-only
systemSettings: { systemSettings: {
compiledMagic: 'pwvcdyqfkuek', compiledMagic: 'yfmwhprwlqes',
selfieMagic: 'pwvcdyqfkuek' selfieMagic: 'yfmwhprwlqes'
}, },
restoreBackupSettings: { restoreBackupSettings: {

View File

@ -69,11 +69,12 @@ var typeNameToTypeValue = {
'popunder': 12 << 4, 'popunder': 12 << 4,
'main_frame': 13 << 4, // start of 1st-party-only behavorial filtering 'main_frame': 13 << 4, // start of 1st-party-only behavorial filtering
'generichide': 14 << 4, 'generichide': 14 << 4,
'inline-script': 15 << 4, 'inline-font': 15 << 4,
'data': 16 << 4, // special: a generic data holder 'inline-script': 16 << 4,
'redirect': 17 << 4, 'data': 17 << 4, // special: a generic data holder
'webrtc': 18 << 4, 'redirect': 18 << 4,
'unsupported': 19 << 4 'webrtc': 19 << 4,
'unsupported': 20 << 4
}; };
var otherTypeBitValue = typeNameToTypeValue.other; var otherTypeBitValue = typeNameToTypeValue.other;
@ -92,11 +93,12 @@ var typeValueToTypeName = {
12: 'popunder', 12: 'popunder',
13: 'document', 13: 'document',
14: 'generichide', 14: 'generichide',
15: 'inline-script', 15: 'inline-font',
16: 'data', 16: 'inline-script',
17: 'redirect', 17: 'data',
18: 'webrtc', 18: 'redirect',
19: 'unsupported' 19: 'webrtc',
20: 'unsupported'
}; };
var BlockAnyTypeAnyParty = BlockAction | AnyType | AnyParty; var BlockAnyTypeAnyParty = BlockAction | AnyType | AnyParty;
@ -234,9 +236,9 @@ var toLogDataInternal = function(categoryBits, tokenHash, filter) {
} else if ( categoryBits & 0x004 ) { } else if ( categoryBits & 0x004 ) {
opts.push('first-party'); opts.push('first-party');
} }
var type = (categoryBits >>> 4) & 0x1F; var type = categoryBits & 0x1F0;
if ( type !== 0 && type !== 16 /* data */ ) { if ( type !== 0 && type !== typeNameToTypeValue.data ) {
opts.push(typeValueToTypeName[type]); opts.push(typeValueToTypeName[type >>> 4]);
} }
if ( logData.opts !== undefined ) { if ( logData.opts !== undefined ) {
opts.push(logData.opts); opts.push(logData.opts);
@ -1349,6 +1351,7 @@ FilterParser.prototype.toNormalizedType = {
'genericblock': 'unsupported', 'genericblock': 'unsupported',
'generichide': 'generichide', 'generichide': 'generichide',
'image': 'image', 'image': 'image',
'inline-font': 'inline-font',
'inline-script': 'inline-script', 'inline-script': 'inline-script',
'media': 'media', 'media': 'media',
'object': 'object', 'object': 'object',
@ -2219,6 +2222,7 @@ FilterContainer.prototype.fromCompiledContent = function(reader) {
filterPairId = FilterPair.fid, filterPairId = FilterPair.fid,
filterBucketId = FilterBucket.fid, filterBucketId = FilterBucket.fid,
filterDataHolderId = FilterDataHolder.fid, filterDataHolderId = FilterDataHolder.fid,
redirectTypeValue = typeNameToTypeValue.redirect,
args, bits, bucket, entry, args, bits, bucket, entry,
tokenHash, fdata, fingerprint; tokenHash, fdata, fingerprint;
@ -2233,7 +2237,7 @@ FilterContainer.prototype.fromCompiledContent = function(reader) {
// Special cases: delegate to more specialized engines. // Special cases: delegate to more specialized engines.
// Redirect engine. // Redirect engine.
if ( (bits >>> 4) === 17 ) { if ( (bits & 0x1F0) === redirectTypeValue ) {
µb.redirectEngine.fromCompiledRule(args[1]); µb.redirectEngine.fromCompiledRule(args[1]);
continue; continue;
} }