mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-18 17:02:27 +02:00
Save only modified immediate hidden settings
This commit is contained in:
parent
34073b41df
commit
a992875c94
@ -197,14 +197,23 @@
|
|||||||
// through the vAPI.localStorage. Add/remove settings as needed.
|
// through the vAPI.localStorage. Add/remove settings as needed.
|
||||||
|
|
||||||
µBlock.saveImmediateHiddenSettings = function() {
|
µBlock.saveImmediateHiddenSettings = function() {
|
||||||
vAPI.localStorage.setItem(
|
const props = [
|
||||||
'immediateHiddenSettings',
|
'consoleLogLevel',
|
||||||
JSON.stringify({
|
'disableWebAssembly',
|
||||||
consoleLogLevel: this.hiddenSettings.consoleLogLevel,
|
'suspendTabsUntilReady',
|
||||||
disableWebAssembly: this.hiddenSettings.disableWebAssembly,
|
];
|
||||||
suspendTabsUntilReady: this.hiddenSettings.suspendTabsUntilReady,
|
const toSave = {};
|
||||||
})
|
for ( const prop of props ) {
|
||||||
);
|
if ( this.hiddenSettings[prop] !== this.hiddenSettingsDefault[prop] ) {
|
||||||
|
toSave[prop] = this.hiddenSettings[prop];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( Object.keys(toSave).length !== 0 ) {
|
||||||
|
vAPI.localStorage.setItem(
|
||||||
|
'immediateHiddenSettings', JSON.stringify(toSave));
|
||||||
|
} else {
|
||||||
|
vAPI.localStorage.removeItem('immediateHiddenSettings');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user