4 ms·
How can they tell that you opened dev tools?
by ars 4y ago
How can they tell that you opened dev tools?
- xnx 4y agoI believe there are multiple techniques. One of them is detecting an abrupt decrease in the viewport size.
- arbol 4y agoSo ctrl/CMD left/right to move your window to one half of the screen might block you!? XD
- birdman3131 4y agoPeople elsewhere in the thread seemed to imply that if Viewport size != window size dev tools is likely opened.
- zamadatix 4y agoThat would create far too many false positives. The common way is to detect if window.innerWidth changed by a minimum threshold but window.outerWidth did not. The limitations of the method are built in sidebars (such as on Edge with the sidebar and search sidebar) could trigger it as well if your minimum width is not wide enough while on the other hand if your minimum width is too wide you won't catch the dev tools opening. The method is also limited in that undocked dev tools will not register a triggering change.
- rezonant 4y agoAs others have mentioned, you can simply put in a sourcemap entry in your JS, and when the browser requests that URL (which happens when Devtools opens to prepare for showing original sources), ban the IP.
- doubleorseven 4y agoYou create this pseudo function: 1. setTimeout to call an endpoint that will block your ip. It's set to run in 2 seconds from now. 2. Insert: debugger; 3. Clear the timeout. Now you run this function as an interval. If the devtools is closed, debugger will be ignored and the call to this endpoint will never happen. But if it's open, the debugger will stop and the timeout will fire. Not sure if you need to patch SetTimeout to continue running while you stop but I hope you get the general idea