index.html
main file with JS methods to detect headless chromecheck.py
python script to test detection
-
Clone repo
-
Install deps (selenium):
pip install selenium
- Run script:
python check.py
Sample output:
Default headless result: headless, score=0.8333333333333334
testUserAgent : 1
testAppVersion : 1
testWebdriver : 1
testOuterWidth : 1
testChrome : 1
testImage : 0
Fake UA headless result: headless, score=0.5
testUserAgent : 0
testAppVersion : 0
testWebdriver : 1
testOuterWidth : 1
testChrome : 1
testImage : 0
Fake UA headless + JS fixup result: generic, score=0
testUserAgent : 0
testAppVersion : 0
testWebdriver : 0
testOuterWidth : 0
testChrome : 0
testImage : 0
- User Agent / App Version substring detection
- Webdriver / chrome flags detection
- Outer width == 0 detection
- Broken image zero size detection (looks like it does not work anymore)
- None
- Fake User Agent
- Fake User Agent + JS fixes to override chrome/webdriver tags, outerwidth
Some advanced methods are required for efficient headless browser detection