always use deepCopy for prefs.values for safety
This commit is contained in:
parent
bc8d8b235c
commit
7d18376cf2
|
@ -59,7 +59,7 @@ window.API_METHODS = Object.assign(window.API_METHODS || {}, {
|
||||||
parseCss({code}) {
|
parseCss({code}) {
|
||||||
return backgroundWorker.parseMozFormat({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),
|
setPref: (key, value) => prefs.set(key, value),
|
||||||
|
|
||||||
openEditor,
|
openEditor,
|
||||||
|
|
|
@ -137,7 +137,9 @@ window.INJECTED !== 1 && (() => {
|
||||||
const prefs = window.prefs = {
|
const prefs = window.prefs = {
|
||||||
initializing,
|
initializing,
|
||||||
defaults,
|
defaults,
|
||||||
values,
|
get values() {
|
||||||
|
return deepCopy(values);
|
||||||
|
},
|
||||||
get(key) {
|
get(key) {
|
||||||
return isKnown(key) && values[key];
|
return isKnown(key) && values[key];
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user