3 ms·
Why the hell can websites tell that I'm in the console? If I want to inspect some parts of a website (perhaps save an image), then I don't want that website to
by amelius 5y ago
Why the hell can websites tell that I'm in the console? If I want to inspect some parts of a website (perhaps save an image), then I don't want that website to interfere.
- woutr_be 5y agoThey don’t. They just use “console.log”, you see it because you opened the console. It’s not like they know you’re there and then write a message.
- hmsimha 5y agoDevtools can actually be detected to a certain extent - https://github.com/sindresorhus/devtools-detect https://github.com/sindresorhus/devtools-detect
- amelius 5y agoThis entire project should be copied verbatim into browser bug trackers, imho.
- pityJuke 5y ago> Doesn't work if DevTools is undocked and will show false positive if you toggle any kind of sidebar. This annoys me every time because I use Tree Style Tab, and a website tries to detect DevTools. See Samy Kamkar's website [0]. [0]: https://samy.pl/ https://samy.pl/
- khasan222 5y agoSeems like this guy is just using a width a height difference to detect this. Also some ‘window.FireBug’ property, that doesn’t turn up much currently in chrome or ff console on Ubuntu
- timvdalen 5y agoWhile there are some ways to detect having devtools open[1], this website isn't actually using them. Instead, it just always writes these messages to the console. Before navigating to the answers, it clears the console so you don't see the messages that were logged before. [1]: https://stackoverflow.com/a/7809413/451847 https://stackoverflow.com/a/7809413/451847
- shoeffner 5y agoThis answer how facebook does (did?) it and why is also very interesting: https://stackoverflow.com/a/21693931 https://stackoverflow.com/a/21693931
- LW9ucKsYuvuVeBa 5y agoNot used in this case but if you open the console docked (which is the default as opposed to a separate window) then the resolution of the window will change.