Skip to content

Commit e7a8e99

Browse files
committed
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: #4 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent d3b5206 commit e7a8e99

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

www/app.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,6 @@ function safeJSON (string) {
169169
}
170170

171171
function onAnalyze (value) {
172-
// For shareability purposes
173-
const url = new URL(window.location.href)
174-
url.searchParams.set('json', value)
175-
window.history.replaceState({ value }, '', url.href)
176-
177172
const jsonDocument = safeJSON(value)
178173
if (typeof jsonDocument === 'undefined') {
179174
document.getElementById('json-error').style.display = 'block'
@@ -187,9 +182,4 @@ document.getElementById('analyze').addEventListener('click', () => {
187182
return onAnalyze(code.getValue())
188183
})
189184

190-
const urlValue = new URL(window.location.href).searchParams.get('json')
191-
if (urlValue) {
192-
code.setValue(urlValue)
193-
}
194-
195185
onAnalyze(code.getValue())

0 commit comments

Comments
 (0)