Puppeteer-extra: Does puppeteer-extra use js to replace browser settings?

Created on 26 May 2020  路  8Comments  路  Source: berstend/puppeteer-extra

If so stealth is no longer a stealth. Read this article (Google translate to English).

Most helpful comment

That's easy to work around: always copy the prototype of an object, make changes and then copy it back.

const newProto = navigator.__proto__;
Object.defineProperty(newProto, 'languages', {get: () => ['my', 'non-existing', 'languages']});
navigator.__proto__ = newProto;
navigator.languages
     (3)聽["my", "non-existing", "languages"]
Object.getOwnPropertyNames(navigator)
     []

Edit: even easier, in a 1-liner:

Object.defineProperty(navigator.__proto__, 'languages', {get: () => ['my', 'non-existing', 'languages']});

All 8 comments

Yeah, seems like Headless Chrome can be detected quite easily with the techniques in that article...For example, running:

if( Object.getOwnPropertyNames(navigator)[0] ) alert('fake parameters detected');

after loading a page in the stealth plugin will cause the alert, but wont in regular Chrome...

It's very intresting to know what @berstend and @Niek think about it.

That's easy to work around: always copy the prototype of an object, make changes and then copy it back.

const newProto = navigator.__proto__;
Object.defineProperty(newProto, 'languages', {get: () => ['my', 'non-existing', 'languages']});
navigator.__proto__ = newProto;
navigator.languages
     (3)聽["my", "non-existing", "languages"]
Object.getOwnPropertyNames(navigator)
     []

Edit: even easier, in a 1-liner:

Object.defineProperty(navigator.__proto__, 'languages', {get: () => ['my', 'non-existing', 'languages']});
```js
Object.defineProperty(navigator.__proto__, 'languages', {get: () => ['my', 'non-existing', 'languages']});

```

Hello, not working for me : https://github.com/berstend/puppeteer-extra/issues/222

@sam4652 it's working fine, see my reply here: https://github.com/berstend/puppeteer-extra/issues/222#issuecomment-642171029

ok ;-)
do you think there may be a workaround for other navigator properties so that they are no longer be detected ?

Puppeteer stealth does not work. Try to create a gmail account and you get an error.

Fixed in #275, #276, #277, #278 馃槃

Published as [email protected]

Was this page helpful?
0 / 5 - 0 ratings