summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-09-20 13:37:29 +0200
committerFlorian Bruhin <me@the-compiler.org>2021-09-20 13:52:29 +0200
commitc2ef2a2918bdc3b1b3316052ae73cfc98083f598 (patch)
treeeb25846b371c3ab86379a7ca9b22573820e4ede3
parent1bea82698153ba3e20529e010bc3f254b9904231 (diff)
downloadqutebrowser-c2ef2a2918bdc3b1b3316052ae73cfc98083f598.tar.gz
qutebrowser-c2ef2a2918bdc3b1b3316052ae73cfc98083f598.zip
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
-rw-r--r--qutebrowser/javascript/greasemonkey_wrapper.js5
1 files changed, 0 insertions, 5 deletions
diff --git a/qutebrowser/javascript/greasemonkey_wrapper.js b/qutebrowser/javascript/greasemonkey_wrapper.js
index ced4e1063..46d452efe 100644
--- a/qutebrowser/javascript/greasemonkey_wrapper.js
+++ b/qutebrowser/javascript/greasemonkey_wrapper.js
@@ -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);
}