Home > database >  Why 404 error showing if I go to inspection tool?
Why 404 error showing if I go to inspection tool?

Time:05-02

I found that on this page Screenshot

CodePudding user response:

They are using this DevTools detector. If DevTools are detected, they redirect the player frame to ../player/includes/template/no_video.html:

    <script type="text/javascript">
      !function() {
        navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i) || (devtoolsDetector.addListener(function(t, e) {
          t && (document.location.href = "../player/includes/template/no_video.html")
        }),
        devtoolsDetector.launch())
      }();
    </script>

You can use some browser extensions which is capable of blocking requests and block https://loading.su/player/assets/devtools-detector/devtools-detector.min.js which is where they load the script from. For example, AdBlock Plus configured with "Fanboy's Annoyance List" does successfully block it for me.

Looking at their code, this doesn't happen if a mobile user agent is detected, so what also works is enabling mobile view in DevTools, reloading the page, and then disabling mobile view again while page is already open (because this check is only done once when the video is loaded).

  • Related