question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] stealth evasion `navigator.webdriver` needs to be updated following the Chrome v89 release

See original GitHub issue

The behavior of the navigator.webdriver property has been changed in commit bfe0108 of Chrome like this:

before after
headful undefined false
headless true true

Therefore the navigator.webdriver evasion here shall be updated accordingly.

This specific commit bfe0108 has been part of Chrome since major version 89, and recently the stable channel of release has advanced to major version 89, making the fix seemingly more important than before.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
starrifycommented, Mar 10, 2021

This line will just fail/do nothing in chrome >= 88.0.4291.0 (as the prop is immutable)

Hmm sorry but I might have got other ideas…

$ cat test.js 
// puppeteer@6.0.0 -- bundled Chromium 89.0.4389.0
// puppeteer-extra@3.1.17
// puppeteer-extra-plugin-stealth@2.7.5
(async () => {
  const { addExtra } = require('puppeteer-extra');
  const puppeteer = addExtra(require('puppeteer'));
  if (process.env.TEST_EVASION == 'true') {
    puppeteer.use(
      require('puppeteer-extra-plugin-stealth/evasions/navigator.webdriver')()
    );
  }
  const browser = await puppeteer.launch({
    headless: process.env.TEST_HEADLESS == 'true',
  })
  const page = await browser.newPage();
  const result = await page.evaluate(() => navigator.webdriver);
  console.log(result);
  await page.close();
  await browser.close();
})();

$ TEST_EVASION=false TEST_HEADLESS=true node test.js 
true

$ TEST_EVASION=false TEST_HEADLESS=false node test.js 
true

$ TEST_EVASION=true TEST_HEADLESS=true node test.js 
undefined

$ TEST_EVASION=true TEST_HEADLESS=false node test.js 
undefined
0reactions
berstendcommented, Mar 10, 2021

I see that potentially erroneous since that deletes the property unconditionally.

Ah gotcha 😃 This line will just fail/do nothing in chrome >= 88.0.4291.0 (as the prop is immutable), this could be added to the comment to make that clear and avoid confusion. 😃

Plus at least the unit tests still expect an undefined value unconditionally

Oh, good catch - this would make CI fail in the future once we use more recent chrome versions

Read more comments on GitHub >

github_iconTop Results From Across the Web

Selenium webdriver: Modifying navigator.webdriver flag to ...
First the update 1. execute_cdp_cmd() : With the availability of execute_cdp_cmd(cmd, cmd_args) command now you can easily execute ...
Read more >
Current version of chrome is not supporting by Selenium ...
What happened? I was trying to simply open chrome browser and open a website. But i am getting an error on my console....
Read more >
Selenium fix: SessionNotCreated "this version only ... - YouTube
If you have a webdriver SessionNotCreatedException error like "this version of ChromeDriver only supports Chrome version 96" we'll fix it ...
Read more >
Untitled
Viva tv anime, Jimenglish, Isatis software download free, Bajaj discover new launch 2014, A1 signs st louis, Lacoste scarpe sportive uomo, ...
Read more >
the 2 of 3 and 4 0 5 to 6 a 7 in 8 1 9 for 10 image 11 2 12 is 13
... we 78 000 79 www 80 report 81 m 82 19 83 d 84 new 85 research 86 13 87 which ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found