From 24cc7650270347dc9011548ba68e0b98a843a68f Mon Sep 17 00:00:00 2001 From: Recursing Date: Wed, 22 Jun 2022 20:19:57 +0200 Subject: [PATCH] Don't fill history with garbage --- packages/website/src/pages/playground.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/website/src/pages/playground.js b/packages/website/src/pages/playground.js index 661aeedd..fa39977f 100644 --- a/packages/website/src/pages/playground.js +++ b/packages/website/src/pages/playground.js @@ -23,7 +23,11 @@ function getHashData() { function setHashData(data) { const text = JSON.stringify({ ...getHashData(), ...data }); const compressed = deflate(text, { level: 9 }); - window.location.hash = encodeURIComponent(fromByteArray(compressed)); + window.history.replaceState( + undefined, + "", + "#" + encodeURIComponent(fromByteArray(compressed)) + ); } export default function PlaygroundPage() {