mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 17:17:57 +01:00
this fixes #277
This commit is contained in:
parent
013b077656
commit
e8e14c7d70
1 changed files with 12 additions and 3 deletions
|
@ -120,17 +120,26 @@
|
|||
}
|
||||
|
||||
var result = JSON.parse(JSON.stringify(µb.remoteBlacklists));
|
||||
var builtinPath;
|
||||
var defaultState;
|
||||
var entry, builtinPath, defaultState;
|
||||
|
||||
for ( var path in result ) {
|
||||
if ( result.hasOwnProperty(path) === false ) {
|
||||
continue;
|
||||
}
|
||||
entry = result[path];
|
||||
// https://github.com/gorhill/uBlock/issues/277
|
||||
// uBlock's filter lists are always enabled by default, so we
|
||||
// have to include in backup only those which are turned off.
|
||||
if ( path.lastIndexOf('assets/ublock/', 0) === 0 ) {
|
||||
if ( entry.off !== true ) {
|
||||
delete result[path];
|
||||
}
|
||||
continue;
|
||||
}
|
||||
builtinPath = path.replace(/^assets\/thirdparties\//, '');
|
||||
defaultState = builtin.hasOwnProperty(builtinPath) === false ||
|
||||
builtin[builtinPath].off === true;
|
||||
if ( result[path].off === true && result[path].off === defaultState ) {
|
||||
if ( entry.off === true && entry.off === defaultState ) {
|
||||
delete result[path];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue