diff options
Diffstat (limited to 'src/js/storage.js')
-rw-r--r-- | src/js/storage.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/js/storage.js b/src/js/storage.js index 8854fe9..66ec143 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -91,6 +91,26 @@ /******************************************************************************/ +// This will remove all unused filter list entries from +// µBlock.remoteBlacklists`. This helps reduce the size of backup files. + +µBlock.extractSelectedFilterLists = function() { + var r = JSON.parse(JSON.stringify(this.remoteBlacklists)); + + for ( var path in r ) { + if ( r.hasOwnProperty(path) === false ) { + continue; + } + if ( r[path].off !== false ) { + delete r[path]; + } + } + + return r; +}; + +/******************************************************************************/ + µBlock.saveUserFilters = function(content, callback) { return this.assets.put(this.userFiltersPath, content, callback); }; |