It it used history.replaceState it could not only manipulate the URL completely but also it wouldn't make history events so the back button would work!
location.replace("#...");