mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-23 19:03:02 +01:00
Support AdGuard's emptyArr
/emptyObj
for increased compatibility
Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/2411
This commit is contained in:
parent
bfb66297dd
commit
a4f8ec6d54
@ -414,9 +414,9 @@ function setConstantCore(
|
||||
cValue = null;
|
||||
} else if ( cValue === "''" || cValue === '' ) {
|
||||
cValue = '';
|
||||
} else if ( cValue === '[]' ) {
|
||||
} else if ( cValue === '[]' || cValue === 'emptyArr' ) {
|
||||
cValue = [];
|
||||
} else if ( cValue === '{}' ) {
|
||||
} else if ( cValue === '{}' || cValue === 'emptyObj' ) {
|
||||
cValue = {};
|
||||
} else if ( cValue === 'noopFunc' ) {
|
||||
cValue = cloakFunc(function(){});
|
||||
@ -830,6 +830,13 @@ function setLocalStorageItemFn(
|
||||
) {
|
||||
if ( key === '' ) { return; }
|
||||
|
||||
// For increased compatibility with AdGuard
|
||||
if ( value === 'emptyArr' ) {
|
||||
value = '[]';
|
||||
} else if ( value === 'emptyObj' ) {
|
||||
value = '{}';
|
||||
}
|
||||
|
||||
const trustedValues = [
|
||||
'',
|
||||
'undefined', 'null',
|
||||
|
Loading…
Reference in New Issue
Block a user