Email or username:

Password:

Forgot your password?
Top-level
Floppy ๐Ÿ’พ

@kytta Curious how DevTools detection works. (And consequently how it can be broken.)

5 comments
Nikita @ THE MERGE

@floppy Apparently it's this script: github.com/sindresorhus/devtoo

From README: โ€˜This package has a lot of flaws. It used to work better, but browsers changed, and the detection now has too many false-positives.โ€™

Nikita @ THE MERGE

@floppy TL;DR: it tries to detect it using a combination of the User-Agent, screen density and orientation. For me, it apparently thinks I am using Firefox Mobile xD

Floppy ๐Ÿ’พ

@kytta Just had a look. Didn't expect it to be that simple. There are so many ways to mess with it. :) Some of which by use of DevTools, haha.

Floppy ๐Ÿ’พ

@kytta Also, what if DevTools are opened in a separate window? Then the threshold-criteria in the conditional few lines afterwards will break.

github.com/sindresorhus/devtoo

Don't know what to make of this. :)

Go Up