DEV Community

Discussion on: A simple way to detect devtools.

Collapse
 
matiaslopezd profile image
Matías López Díaz

This not works to "protect the code", it only crashes the app. You can continue using, except for real-time apps because if I change the var "allow" to 99999 and close Devtools, can continue using without problems, also is a great state for any "hacker" for the check without any state change.

Also, decrease performance and can break any app if is executed on devices that can take more than 100ms to process every cycle. That is possible too in browsers have too many tabs opened, test it!

The best example is to try to use WebRTC with this, which consumes a lot of CPU and decreases performance.

Interesting code, but not to add to apps in production.

Collapse
 
matiaslopezd profile image
Matías López Díaz

change allow var

Collapse
 
composite profile image
Composite

I saw that web video service detects devtools for protect its video source url. I caught the video source easily, but I can't play because of token system. uhhh. it's a fun case of production.