FYI, <a href="https://rustpad.io" rel="nofollow">https://rustpad.io</a> breaks the back button by updating the URL hash to a new document every time I try to go back. Use location.replace() <a href="https://developer.mozilla.org/en-US/docs/Web/API/Location/replace" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API/Location/re...</a> or history.replaceState() <a href="https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API/History/rep...</a> to avoid that, instead of assigning to window.location.hash.