paulirish / headless-cat-n-mouse

Is headless chrome currently detectable? Let's pit the detections and detection evasions against eachother.
Apache License 2.0
646 stars 56 forks source link

Can be detected by WebGL in headless mode #2

Closed stereobooster closed 6 years ago

stereobooster commented 6 years ago

As of now WebGL not supported in headless mode see https://github.com/mapbox/mapbox-gl-js/issues/5460. To evade add const browser = await puppeteer.launch({headless: false})

paulirish commented 6 years ago

I did write a test for this....

```js // thx https://github.com/Modernizr/Modernizr/blob/master/feature-detects/webgl.js await test('WebGL unavailable', _ => { const canvas = document.createElement('canvas'); const probablySupports = 'probablySupportsContext'; const supports = probablySupports in canvas ? probablySupports : 'supportsContext'; if (supports in canvas) { return (canvas[supports]('webgl') || canvas[supports]('experimental-webgl')) === false; } return ('WebGLRenderingContext' in window) === false; }); ```

... but as it turns out, headless is now supported in headless: https://bugs.chromium.org/p/chromium/issues/detail?id=617551

so this technique won't work any longer.