Scenario:
New web pages are opened, and randomly given hashes.
var urlNoHash = location.href;
history.replaceState(null, null, urlNoHash + "#" + Math.random() );
window.addEventListener("hashchange", myFunction());
function myFunction() {
alert("hashchange");
}
hashchange is fired when adding new hashes, but not when navigating back with the browser's "Back Button".