From e7a8e99039046856ae9a22231afe5d003699d4c0 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 28 Jan 2022 20:26:22 -0400 Subject: [PATCH] Do not store JSON documents as URL strings Only works for small documents, otherwise the max URL size is hit and the app breaks completely. I experimented with `localStorage`, but the max quota there also imposes a too-strict limit on the document size. Let's disable document saving for now. See: https://github.com/sourcemeta/json-taxonomy/issues/4 Signed-off-by: Juan Cruz Viotti --- www/app.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/www/app.js b/www/app.js index ec3cd6c..a30a344 100644 --- a/www/app.js +++ b/www/app.js @@ -169,11 +169,6 @@ function safeJSON (string) { } function onAnalyze (value) { - // For shareability purposes - const url = new URL(window.location.href) - url.searchParams.set('json', value) - window.history.replaceState({ value }, '', url.href) - const jsonDocument = safeJSON(value) if (typeof jsonDocument === 'undefined') { document.getElementById('json-error').style.display = 'block' @@ -187,9 +182,4 @@ document.getElementById('analyze').addEventListener('click', () => { return onAnalyze(code.getValue()) }) -const urlValue = new URL(window.location.href).searchParams.get('json') -if (urlValue) { - code.setValue(urlValue) -} - onAnalyze(code.getValue())