1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 07:22:28 +02:00

this fixes #82

This commit is contained in:
gorhill 2014-07-18 20:15:35 -04:00
parent 2725832b78
commit 183be0a201

View File

@ -269,7 +269,8 @@
// https://adblockplus.org/en/filter-cheatsheet // https://adblockplus.org/en/filter-cheatsheet
// https://adblockplus.org/en/filters // https://adblockplus.org/en/filters
var abpFilters = this.abpFilters; var abpFilters = this.abpFilters;
var abpHideFilters = this.userSettings.parseAllABPHideFilters ? this.abpHideFilters : null; var abpHideFilters = this.abpHideFilters;
var parseAllABPHideFilters = this.userSettings.parseAllABPHideFilters;
var duplicateCount = abpFilters.duplicateCount + abpHideFilters.duplicateCount; var duplicateCount = abpFilters.duplicateCount + abpHideFilters.duplicateCount;
var acceptedCount = abpFilters.acceptedCount + abpHideFilters.acceptedCount; var acceptedCount = abpFilters.acceptedCount + abpHideFilters.acceptedCount;
var reLocalhost = /(^|\s)(localhost\.localdomain|localhost|local|broadcasthost|0\.0\.0\.0|127\.0\.0\.1|::1|fe80::1%lo0)(?=\s|$)/g; var reLocalhost = /(^|\s)(localhost\.localdomain|localhost|local|broadcasthost|0\.0\.0\.0|127\.0\.0\.1|::1|fe80::1%lo0)(?=\s|$)/g;
@ -304,7 +305,7 @@
// 2014-05-18: ABP element hide filters are allowed to contain space // 2014-05-18: ABP element hide filters are allowed to contain space
// characters // characters
if ( abpHideFilters !== null ) { if ( parseAllABPHideFilters ) {
if ( abpHideFilters.add(line) ) { if ( abpHideFilters.add(line) ) {
continue; continue;
} }
@ -341,10 +342,8 @@
// Likely an ABP net filter? // Likely an ABP net filter?
if ( reAdblockFilter.test(line) ) { if ( reAdblockFilter.test(line) ) {
if ( abpFilters !== null ) { if ( abpFilters.add(line) ) {
if ( abpFilters.add(line) ) { continue;
continue;
}
} }
// rhill 2014-01-22: Transpose possible Adblock Plus-filter syntax // rhill 2014-01-22: Transpose possible Adblock Plus-filter syntax
// into a plain hostname if possible. // into a plain hostname if possible.