add localstorage hack - randomcrap - random crap programs of varying quality
(HTM) git clone git://git.codemadness.org/randomcrap
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 372c03151bff2e14c68ff0eaa7d25cabc79001da
(DIR) parent 6d603adc3aef0041e67655fd409e9d54a9e473d4
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Thu, 3 Jul 2025 19:00:12 +0200
add localstorage hack
For example useful to resume Lichess Puzzle streak sessions when I don't have
enough time.
Diffstat:
A localstorage.js | 8 ++++++++
1 file changed, 8 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/localstorage.js b/localstorage.js
@@ -0,0 +1,8 @@
+Copies localstorage along with code to import it to the clipboard,
+for use in Web Inspector console (F12).
+
+Adapted from: https://stackoverflow.com/questions/13335967/how-can-you-import-export-the-entire-localstorage
+
+Code:
+
+copy('var d='+JSON.stringify(localStorage)+';Object.keys(d).forEach(function(k){localStorage.setItem(k,d[k]);});');