From 2c4faaa84dc11a19a083e1f33e2961737cfe5e46 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 16 Sep 2017 07:49:43 -0400 Subject: [PATCH] fix #3020 --- src/js/background.js | 4 ++-- src/js/static-net-filtering.js | 32 ++++++++++++++++++-------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/js/background.js b/src/js/background.js index c2b6a8cfe..7c526f419 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -120,8 +120,8 @@ var µBlock = (function() { // jshint ignore:line // read-only systemSettings: { - compiledMagic: 'pwvcdyqfkuek', - selfieMagic: 'pwvcdyqfkuek' + compiledMagic: 'yfmwhprwlqes', + selfieMagic: 'yfmwhprwlqes' }, restoreBackupSettings: { diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index 0a2176d52..85f05d7fc 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -69,11 +69,12 @@ var typeNameToTypeValue = { 'popunder': 12 << 4, 'main_frame': 13 << 4, // start of 1st-party-only behavorial filtering 'generichide': 14 << 4, - 'inline-script': 15 << 4, - 'data': 16 << 4, // special: a generic data holder - 'redirect': 17 << 4, - 'webrtc': 18 << 4, - 'unsupported': 19 << 4 + 'inline-font': 15 << 4, + 'inline-script': 16 << 4, + 'data': 17 << 4, // special: a generic data holder + 'redirect': 18 << 4, + 'webrtc': 19 << 4, + 'unsupported': 20 << 4 }; var otherTypeBitValue = typeNameToTypeValue.other; @@ -92,11 +93,12 @@ var typeValueToTypeName = { 12: 'popunder', 13: 'document', 14: 'generichide', - 15: 'inline-script', - 16: 'data', - 17: 'redirect', - 18: 'webrtc', - 19: 'unsupported' + 15: 'inline-font', + 16: 'inline-script', + 17: 'data', + 18: 'redirect', + 19: 'webrtc', + 20: 'unsupported' }; var BlockAnyTypeAnyParty = BlockAction | AnyType | AnyParty; @@ -234,9 +236,9 @@ var toLogDataInternal = function(categoryBits, tokenHash, filter) { } else if ( categoryBits & 0x004 ) { opts.push('first-party'); } - var type = (categoryBits >>> 4) & 0x1F; - if ( type !== 0 && type !== 16 /* data */ ) { - opts.push(typeValueToTypeName[type]); + var type = categoryBits & 0x1F0; + if ( type !== 0 && type !== typeNameToTypeValue.data ) { + opts.push(typeValueToTypeName[type >>> 4]); } if ( logData.opts !== undefined ) { opts.push(logData.opts); @@ -1349,6 +1351,7 @@ FilterParser.prototype.toNormalizedType = { 'genericblock': 'unsupported', 'generichide': 'generichide', 'image': 'image', + 'inline-font': 'inline-font', 'inline-script': 'inline-script', 'media': 'media', 'object': 'object', @@ -2219,6 +2222,7 @@ FilterContainer.prototype.fromCompiledContent = function(reader) { filterPairId = FilterPair.fid, filterBucketId = FilterBucket.fid, filterDataHolderId = FilterDataHolder.fid, + redirectTypeValue = typeNameToTypeValue.redirect, args, bits, bucket, entry, tokenHash, fdata, fingerprint; @@ -2233,7 +2237,7 @@ FilterContainer.prototype.fromCompiledContent = function(reader) { // Special cases: delegate to more specialized engines. // Redirect engine. - if ( (bits >>> 4) === 17 ) { + if ( (bits & 0x1F0) === redirectTypeValue ) { µb.redirectEngine.fromCompiledRule(args[1]); continue; }