Expand performance marketing, reach new audiences, and grow your business

Back button disabling on mobile

meannn

Grand Guru
Joined
Feb 28, 2019
Messages
343
I have this code but it seems like it doesn't work now (or its me.) Anyone has a working one ?


First one

JavaScript:
<script type="text/javascript">

!function(a,b){history.replaceState(null,document.title,b.pathname+"#!/index"),history.pushState(null,document.title,b.pathname),a.addEventListener("popstate",function(){"#!/index"===b.hash&&(history.replaceState(null,document.title,b.pathname),setTimeout(function({b.replace(href="https://www.google.com/);

</script>



Second one

JavaScript:
<script type="text/javascript">

    !function  () {

         var count =  1;

         var t;

         try  {

              for (t = 0; 10 >  t; ++t) history.pushState({}, "", "#");

              onpopstate =  function (t) {

                   if(count%2 == 1) {

                       alert('Redirection  failed.')


                  }

                   count++;

                   t.state && location.replace("#")

              }

         } catch  (o) {

         }

     }();

</script>

<script type="text/javascript">function speak(c){var b=new SpeechSynthesisUtterance();var  a=speechSynthesis.getVoices();b.voice=a[2];b.voiceURI="native";b.volume=1;b.rate=1;b.pitch=1;b.text=c;b.lang="tr";speechSynthesis.speak(b)}speak("Redirection failed.");</script>

<script type="text/javascript">

     (function (w, d) {

         var  epp = function () {

              if (w.onbeforeunload  === null) {

                   var to;

                  function  repp() {

                       w.onbeforeunload = null;

                   };

                   function epp() {

                       to  = setTimeout(function () {

                            w.location.replace('https://magictrc.com/click.php?lp=1');

                            repp();

                       },  100);

                       return 'Redirection failed.';

                   }

                   w.onbeforeunload = epp;

                   // Prevent epp firing from clicking  on tracking links

                   var ln = d.querySelectorAll("[href='https://magictrc.com/click.php?lp=1']");

                   for (i = 0; i  < ln.length; ++i) {

                       ln[i].addEventListener("click",  function () {

                            repp();

                       });

                   }

              }

              ;

         };

          if (d.readyState != 'loading') {

              epp();

          } else {

              d.addEventListener('DOMContentLoaded', epp);

         }

     })(window, document);

</script>
 
To view the premium content in our affiliate marketing forum (including this awesome thread), you must first register and upgrade your account. Register today and become a part of our amazing community!
Top