diff --git a/background/background.js b/background/background.js index 109123f2..d90a63be 100644 --- a/background/background.js +++ b/background/background.js @@ -59,7 +59,7 @@ window.API_METHODS = Object.assign(window.API_METHODS || {}, { parseCss({code}) { return backgroundWorker.parseMozFormat({code}); }, - getPrefs: () => prefs.values, // will be deepCopy'd by invokeAPI handler + getPrefs: () => prefs.values, setPref: (key, value) => prefs.set(key, value), openEditor, diff --git a/js/prefs.js b/js/prefs.js index c3f19485..cba6e0d9 100644 --- a/js/prefs.js +++ b/js/prefs.js @@ -137,7 +137,9 @@ window.INJECTED !== 1 && (() => { const prefs = window.prefs = { initializing, defaults, - values, + get values() { + return deepCopy(values); + }, get(key) { return isKnown(key) && values[key]; },