Allow all types in GM_setValue
While https://wiki.greasespot.net/GM.setValue still says: > Strings, booleans, and integers are currently the only allowed data types. https://sourceforge.net/p/greasemonkey/wiki/GM_setValue/ claims: > Prior to version 3.2 simple data objects, such as JSON, were not allowed. And there seem to be scripts actually using those, e.g.: https://greasyfork.org/en/scripts/394820-mouseover-popup-image-viewer
This commit is contained in:
parent
1bea826981
commit
c2ef2a2918
|
|
@ -22,11 +22,6 @@
|
|||
|
||||
function GM_setValue(key, value) {
|
||||
checkKey(key, "GM_setValue");
|
||||
if (typeof value !== "string" &&
|
||||
typeof value !== "number" &&
|
||||
typeof value !== "boolean") {
|
||||
throw new Error(`GM_setValue requires the second parameter to be of type string, number or boolean, not '${typeof value}'`);
|
||||
}
|
||||
localStorage.setItem(_qute_script_id + key, value);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue