title: Enable and disable window.location.href
body: <p>Recently, YouTube introduced the new Autoplay feature and I got jealous.</p>
  
  <p><img src="https://i.stack.imgur.com/A7Tkim.png" alt="enter image description here"></p>
  
  <p>I implemented it on my tube site. My site uses jwplayer as a video player, it has a very beautiful and easy API where a function there is called onComplete, where it will execute my javascript queries at the end of the video. </p>
  
  <p>What I did is this:</p>
  
  <pre><code>onComplete:function() {
  //Video has ended, now we redirect to the new video
  window.location.href = "//www.mysite.com/video?id=33412";
  }
  </code></pre>
  
  <p>So, using this, my site will successfully redirect to a new video, and so on. But, what if the user turns off the  "Autoplay" feature as shown in the image. How can I disable the window.location.href?</p>
  
  <p>Other stackoverflow answers <a href="https://stackoverflow.com/a/18285835/2922834">said</a>:</p>
  
  <blockquote>
    <p>You can't change the window.location prototype, because this a "native property" of window and it is not configurable.</p>
  </blockquote>
  
  <p>What would be the solution in my case? A solution using Jquery is okay for me too.</p>