“FunnelFlux Zeydoo
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

Back Button Redirect Script (Chrome)

Discussion in 'Programming and Scripts' started by Daniel Hegner, Jun 27, 2020.

  1. Daniel Hegner

    Daniel Hegner Affiliate affiliate

    3
    4
    3
    Hi guys,

    I implemented several back button redirect scrips on my landers.

    They all work fine, except on chrome. Does chrome block this kind of "sneaky" scripts?

    And if so, is there a script that still works in the google chrome browser?

    Thanks in advance! :)
     
    Honeybadger and James Polk like this.
  2. AdCombo
  3. Certified
    T J Tutor

    T J Tutor GM Administrator Certified Vendor Dojo Master affiliate

    12,229
    7,072
    113
    many have found this issue with Chrome.

    I can only guess that a developer could write a script, but if Chrome finds you are circumventing them, they may ban you.
     
    Honeybadger and James Polk like this.
  4. Graybeard

    Graybeard Well-Known Member affiliate

    8,391
    6,190
    113
    Remember porn dialers :D
    Cheap shots don't last
     
    Honeybadger and T J Tutor like this.
  5. Yellow Web

    Yellow Web Affiliate affiliate

    18
    18
    3
    Try this one.
    HTML:
    <script type = "text/javascript">
    (function(window, location) {
        var base=document.getElementsByTagName('base');
        var hasBase = base.length==1;
        var baseHref='';
        if (hasBase){
            baseHref = base.href;
            base[0].remove();
        }
        history.replaceState(null, document.title, location.pathname+"#!/stealingyourhistory");
        history.pushState(null, document.title, location.pathname);
        if (hasBase){
            var newbase = document.createElement('base');
            newbase.href = baseHref;
            document.head.appendChild(newbase);
        }
    
        window.addEventListener("popstate", function() {
          if(location.hash === "#!/stealingyourhistory") {
                history.replaceState(null, document.title, location.pathname);
                setTimeout(function(){
                  location.replace("https://google.com");
                },0);
          }
        }, false);
    }(window, location));
    </script>
     
    Paid Affs likes this.
  6. jeremielp

    jeremielp Affiliate affiliate

    22
    14
    3
    I tested it today:
    • working on chrome 87.0.4280.88 ONLY AFTER interaction with page (like a click on a popup at the beginning)
    • working on ff 83.0 OK
    • working on edge 87.0.664.55 ONLY AFTER interaction with page (like a click on a popup at the beginning)
     
  7. Graybeard

    Graybeard Well-Known Member affiliate

    8,391
    6,190
    113
    I guess if you don't want to ever get return traffic --this is a good thing ...
     
    Honeybadger likes this.
  8. jeremielp

    jeremielp Affiliate affiliate

    22
    14
    3
    I don't understand your comment ?
     
  9. Graybeard

    Graybeard Well-Known Member affiliate

    8,391
    6,190
    113
    hijacking the back button on browsers leads to problems --in fact that may make the website to be classified a "hostile" --good luck
     
    Honeybadger and T J Tutor like this.
  10. zero2000

    zero2000 Affiliate affiliate

    2
    0
    1
    Thank you very much, I was looking for this script...
     
banners