为什么我去检查工具显示404错误?

Why 404 error showing if I go to inspection tool?

我发现在此页面上 https://www.ofwteleserye.su/its-showtime-may-2-2022/ 如果我尝试转到检查工具,此页面的视频会立即显示“404 未找到视频”。这背后的原因是什么?如何解决这个问题?我尝试了不同的浏览器,但发现了同样的问题。我对 HTML 没有详细的了解。附上图片。

他们正在使用 this DevTools detector。如果检测到 DevTools,它们会将播放器框架重定向到 ../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>

您可以使用一些能够阻止请求的浏览器扩展程序,并阻止 https://loading.su/player/assets/devtools-detector/devtools-detector.min.js 他们加载脚本的地方。例如,AdBlock Plus configured with "Fanboy's Annoyance List"确实为我成功阻止了它。

查看他们的代码,如果检测到移动用户代理,则不会发生这种情况,因此同样有效的方法是在 DevTools 中启用移动视图,重新加载页面,然后在页面已打开时再次禁用移动视图 (因为此检查仅在加载视频时进行一次。