Avoid/Bypass Dev tools detection in Chrome?
Asked Answered
R

3

9

I've been trying to get a video source from a web site but when I open the dev tools to do so, It shows me this message: "Dont open Developer Tools".

So far I have tried:

  • Turn off javascript ->doesn't work, doesn't load the video.

  • Find the function:

olplayer.src({type:"application/x-mpegURL",src:"https://127.0.0.1/no_video.mp4.m3u8"});
document.body.innerHTML="";
document.write(" Dont open Developer Tools. ");
throw new Error(" Dont open Developer Tools. ");
self.location.replace('https:'+window.location.href.substring(window.location.protocol.length));

set a breakpoint and reload, run:

Object.defineProperty(window, "console", {configurable: false});

Any ideas how to bypass this protection?

Rozanne answered 14/12, 2019 at 19:29 Comment(1)
Can you send the website / link?Incurvate
I
5

You are probably talking about a video hosted on hqq.tv. Their code uses a check() function which does all the nasty magic to block all hacking attempts, so the easiest way to bypass the protection altogether is to disable this function.

Since recently, Chrome supports local overrides for javascript code (I found out about this from this SO thread). A bit nicer explanation on how this works can be found on Medium.

So I went ahead and located the check() function (in my case it was hqq.tv/js/embed.129.js) and added it to Overrides. In the overridden version I found the check() function and added return true; to its beginning:

function check(){return true; var element=new Image(); ...

However, this only disables the Dev Tool protection, but doesn't make your life much easier in terms of saving the video. My own solution doesn't work on hqq.tv, nor had I any luck with the solution suggested on videohelp forum. However, I was able to capture the stream using Stream Recorder Chrome extension.

Indeciduous answered 14/2, 2021 at 11:25 Comment(0)
M
0

I Found a bypass for the detection, use FireBug Lite extension for chrome (or the browser u prefer). It bypasses the detection because it is an extension

Magner answered 22/6, 2022 at 13:51 Comment(5)
The site I'm trying to open dev tools on, refuses to load if FireBug is installed...Rhinitis
Damn new ways.. what if firebug is already open before you load it or open after you load it?Magner
Tried both ways didn't work, but anyways I figured out a way to open dev tools (by using a proxy to manipulate the javascript file that prevents me from opening dev tools)Rhinitis
@SujalSingh Can you expand on how your solution works?Yeaton
@Yeaton 1) capture the requests generated by the website which is preventing you from opening dev tools with something like mitmproxy. 2) In the captured traffic, look for the file containing the code which is preventing you from opening dev tools. 3) Modify the code such that it won't work and instruct mitmproxy to replace the original file with the modified file on the fly. Done :)Rhinitis
L
0

So you are trying to get the m3u8 link from hqq.tv website. Maybe I got something helpful

    import axios from "axios";
    const response = await axios.get(
      "https://hqq.tv/player/embed_player.php?vid=QkNSWnNReXIxVHNGbmhuWWRaR1E4dz09",  //example hqq url
      {
        headers: {
          Referer: "https://tioanime.com/",
        },
      }
    );
    const regexPattern = /olplayer\.src\(\s*({[^]*?})\s*\);/g;
    const regex = new RegExp(regexPattern);
    const matches = response.data.matchAll(regex);
    let finalResponse = "";
    for (const match of matches) {
      const extractedContent = match[1].trim();
      if (extractedContent === "{ type: 'application/x-mpegURL', src:vurl}") {
        continue;
      }
      finalResponse += extractedContent;
    }
    const streamUrl = finalResponse
         .replace(/(\w+):\s/g, '"$1":')
         .replace(/'/g, '"')
         .replace(/\\/g,'\/')

    console.log(JSON.parse(streamUrl));

this code will give you the final m3u8 link

Lavaliere answered 11/2, 2024 at 6:9 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.