bjobjo
Junior Member
- Jul 6, 2012
- 101
- 20
Hi - this code makes the back button load dummyurl.co.uk.
Obviously this is naughty. Will it cause a Google slap, will it be detected by something Google does, am I asking for trouble?
Code is all from http://stackoverflow.com/questions/30990027/back-button-redirect-script ... by the way
Obviously this is naughty. Will it cause a Google slap, will it be detected by something Google does, am I asking for trouble?
Code:
<script>
(function(window, location) {
history.replaceState(null, document.title, location.pathname+"#!/history");
history.pushState(null, document.title, location.pathname);
window.addEventListener("popstate", function() {
if(location.hash === "#!/history") {
history.replaceState(null, document.title, location.pathname);
setTimeout(function(){
location.replace("http://www.dummyurl.co.uk");
},0);
}
}, false);
}(window, location));
</script>
Code is all from http://stackoverflow.com/questions/30990027/back-button-redirect-script ... by the way