-4

I'm trying to figure out which code is used to disable the back button of browser on this website: turkish airlines desktop website ( https://p.turkishairlines.com/ )

Once the main landing page loads the site doesn't let you go back. I've examined many different codes that disables the back function of the browser but this website doesn't seem to be using any of them.

I would really appreciate it if you can help me. Thanks in advance.

  • 2
    Why would you want to do this? It's horrible UX. – jhpratt Dec 17 '17 at 20:20
  • They are one of our agencies clients. – TheOptimizer Dec 17 '17 at 20:22
  • It's a simple redirect - it doesn't disable back, it makes you go forward again, so when you click back you actually go back to the same site which then pops you forward again. Right click the back button and you'll see it. You can do this with a `refresh meta`: https://stackoverflow.com/questions/5411538/redirect-from-an-html-page – freedomn-m Dec 17 '17 at 20:26
  • @freedomn-m I know you can do it with `refresh meta` but **this website** doesn't use this method. Thanks for the answer though. – TheOptimizer Dec 17 '17 at 20:31
  • Noooooo! I believe a part of the problem is `T.history=function(){return!!e.history&&!!history.pushState}`, please remove it >_< ... seriously, why ask us to dig into minified source code? – René Dec 17 '17 at 20:33
  • Well, your question is a little low on the details of what you've actually tried / reviewed. – freedomn-m Dec 17 '17 at 21:01

1 Answers1

1

Hi you can use this script to disable the back button

<script>
 $(document).ready(function() {
    function disableBack() { window.history.forward() }

    window.onload = disableBack();
    window.onpageshow = function(evt) { if (evt.persisted) 
  disableBack() }
 });
</script>
  • Thanks for the answer Kumar but what i really need is the specific script that this website is using. It doesn't seem to be using the script you offered. – TheOptimizer Dec 17 '17 at 20:29