JavaScript обнаружил смену хэша URL

window.addEventListener("onhashchange", function(){
    //url hash # has changed
});
Grepper