Back button hijack.

bjobjo

Junior Member
Joined
Jul 6, 2012
Messages
101
Reaction score
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:
<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
 
Do you know that google crawler can emulate all button clicks? :)
Use encription for domain and cloak this code...
 
Big websites do this.No seo penalty so far
My profile pic will give you a clue about which websites I am talking about :cool:
 
i feel like an idiot but if i have an index.html, where do i insert this script?
 
Back
Top