3 ms·
I would suspect it's sniffing for the window-size suddenly changing in certain ways, perhaps along with watching for the normal dev-tools keyboard shortcuts via
by kemayo 9y ago
I would suspect it's sniffing for the window-size suddenly changing in certain ways, perhaps along with watching for the normal dev-tools keyboard shortcuts via keydown listeners. I can't actually remember off the top of my head if Chrome suppresses the event in that case, but it wouldn't be surprising if it didn't.
The easy check for this would be to see whether opening the devtools in detached mode via the menus makes it notice.
Note that this would actually be quite a pain to hide from the page, just because it's something the page needs to know to display some stuff and make rendering calculations. If it was hidden from the page, we'd suddenly be complaining about debugging floating footers which are hiding under the devtools.
- bsimpson 9y agoThis is what happens when I trigged DevTools while logging key events: document.addEventListener('keydown', ({ keyCode }) => console.log(keyCode)) 91 16 73 You can see each key.
- efreak 9y agoBut there's different ways of opening dev tools. You can use the mouse to right click as well. In fact, when using keyboard shortcuts in the better these days, I have a habit of hitting alt+D first to get to the address bar first (Outlook likes to hijack browser shortcuts like Ctrl+n), in which case the website shouldn't know I'm pressing anything at all.
- bsimpson 9y agoI think OP's point is you can listen for a bunch of signals: If you see the right keydown events, or if you see a contextmenu followed by a rapid change to innerWidth, they probably opened dev tools, and you should delete your evil cookies. The person who figured this out probably opened them via menu and had dev tools in another window, so the evil folks couldn't detect the resize.