3

I have a website and I want to know how many people open the web developer tools to check my HTML and Javascript code in my web page. So I need to add an event listener, but it seems like Google chrome and a lot of browser do not offer any api about this. How could I get this event?

Sugar
  • 130
  • 10
  • Basically there is no such callback. People are trying to make it happen comparing window and body sizes. Doesn't seem to be that great... – Flash Thunder Apr 03 '16 at 11:36

1 Answers1

2

This might be helpful, https://github.com/sindresorhus/devtools-detect

Here is direct link to demo

UPDATE:

This might resolve no logging issue, if undocked, https://github.com/NeekSandhu/DevtoolsDetect/

Here is direct link to demo

Previous version won't work if dev tools were undocked the last time user used them. I've reworked his version, which resolves the issue. But still with some caveats, listed in the demo.

Neek Sandhu
  • 91
  • 1
  • 5
  • This actually works... until dev tools are docked :) – Flash Thunder Apr 03 '16 at 11:37
  • This has the same caveheast as stated on other threads, if it's undocked, you can get false positives – Sami Triki Apr 03 '16 at 12:00
  • I see the source code of this repo. I found that it test the width and height of window to detect the DevTool is open or not. So, if the DevTool undocks, it can not detect anymore. Is there any way to detect when DevTool undock? – Sugar Apr 05 '16 at 03:17
  • Fixed no detection, while undocked. Now if undocked it will atleast report that user had an interation with devtools. – Neek Sandhu Apr 05 '16 at 11:11