xxxxxxxxxx
var url = window.location.origin + '/foo/foo.php';
history.pushState({}, null, url);
xxxxxxxxxx
window.navigation.addEventListener("navigate", (event) => {
console.log('location changed!');
})
xxxxxxxxxx
$(document).ready(function(){
window.history.pushState('page2', 'Title', '/');
});
xxxxxxxxxx
var pushState = history.pushState;
history.pushState = function () {
pushState.apply(history, arguments);
fireEvents('pushState', arguments); // Some event-handling function
};