mirror of https://github.com/gorhill/uBlock.git
this fixes #976
This commit is contained in:
parent
cad5a6cbf6
commit
bf50e87dff
|
@ -99,8 +99,8 @@
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
µBlock.appendUserFilters = function(content) {
|
µBlock.appendUserFilters = function(filter) {
|
||||||
if ( content.length === 0 ) {
|
if ( filter.length === 0 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,10 +130,11 @@
|
||||||
if ( details.error ) {
|
if ( details.error ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( details.content.indexOf(content.trim()) !== -1 ) {
|
// https://github.com/gorhill/uBlock/issues/976
|
||||||
return;
|
// 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
|
||||||
µb.saveUserFilters(details.content.trim() + '\n\n' + content.trim(), onSaved);
|
// duplicates at this point may lead to more issues.
|
||||||
|
µb.saveUserFilters(details.content.trim() + '\n\n' + filter.trim(), onSaved);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.loadUserFilters(onLoaded);
|
this.loadUserFilters(onLoaded);
|
||||||
|
|
Loading…
Reference in New Issue