mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-11-11 15:48:51 +01:00
Do not struggle on unknown settings.
Fixes #169 Fixes #168 Fixes #164 Fixes #170
This commit is contained in:
parent
4348c71b55
commit
19a7a32e0f
@ -338,6 +338,7 @@
|
|||||||
const resetSymbol = Symbol("reset");
|
const resetSymbol = Symbol("reset");
|
||||||
function changeValue(name, newValue){
|
function changeValue(name, newValue){
|
||||||
var settingDefinition = scope.getDefinition(name);
|
var settingDefinition = scope.getDefinition(name);
|
||||||
|
if (settingDefinition){
|
||||||
var oldValue = settings[name];
|
var oldValue = settings[name];
|
||||||
if (newValue === resetSymbol){
|
if (newValue === resetSymbol){
|
||||||
newValue = settingDefinition.defaultValue;
|
newValue = settingDefinition.defaultValue;
|
||||||
@ -357,6 +358,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
logging.verbose("registering storage onchange listener");
|
logging.verbose("registering storage onchange listener");
|
||||||
browser.storage.onChanged.addListener(function(changes, area){
|
browser.storage.onChanged.addListener(function(changes, area){
|
||||||
|
Loading…
Reference in New Issue
Block a user