diff options
author | gorhill <rhill@raymondhill.net> | 2015-03-09 23:00:52 -0400 |
---|---|---|
committer | gorhill <rhill@raymondhill.net> | 2015-03-09 23:00:52 -0400 |
commit | bf50e87dffc0c2286ef72890b629a0b5b15d0cd8 (patch) | |
tree | f60bad814e97ffba38938355d9915d4fba046094 /src | |
parent | cad5a6cbf6b62ac5f9b62176e75df6f577a77f84 (diff) | |
download | uBlock-bf50e87dffc0c2286ef72890b629a0b5b15d0cd8.zip uBlock-bf50e87dffc0c2286ef72890b629a0b5b15d0cd8.tar.gz uBlock-bf50e87dffc0c2286ef72890b629a0b5b15d0cd8.tar.bz2 |
this fixes #976
Diffstat (limited to 'src')
-rw-r--r-- | src/js/storage.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/js/storage.js b/src/js/storage.js index c759801..f791229 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -99,8 +99,8 @@ /******************************************************************************/ -µBlock.appendUserFilters = function(content) { - if ( content.length === 0 ) { +µBlock.appendUserFilters = function(filter) { + if ( filter.length === 0 ) { return; } @@ -130,10 +130,11 @@ if ( details.error ) { return; } - if ( details.content.indexOf(content.trim()) !== -1 ) { - return; - } - µb.saveUserFilters(details.content.trim() + '\n\n' + content.trim(), onSaved); + // https://github.com/gorhill/uBlock/issues/976 + // If we reached this point, the filter quite probably needs to be + // added for sure: do not try to be too smart, trying to avoid + // duplicates at this point may lead to more issues. + µb.saveUserFilters(details.content.trim() + '\n\n' + filter.trim(), onSaved); }; this.loadUserFilters(onLoaded); |