document.querySelectorAll("a").forEach(item => {
item.addEventListener("click", e => {
e.preventDefault();
if(history.pushState) {
history.pushState(null, null, e.target.href);
}
return false;
});
});