navigator.webdriver still can be detected
See original GitHub issueconst puppeteer = require('puppeteer-extra')
const StealthPlugin = require('puppeteer-extra-plugin-stealth')
puppeteer.use(StealthPlugin())
puppeteer.launch({ headless: true }).then(async browser => {
const page = await browser.newPage()
page.on('console', msg => console.log(msg.text()))
await page.goto('https://bot.sannysoft.com')
await page.evaluate(async () => {
console.log('webdriver' in navigator ? 'detected': 'not detected')
console.log(navigator.webdriver === undefined ? 'not detected': 'detected')
// but!
console.log(Object.getOwnPropertyDescriptor(navigator.__proto__, 'webdriver') === undefined ? 'not detected': 'detected once')
for (let prop in navigator) {
if (prop === 'webdriver') {
console.log('detected twice')
}
}
});
await browser.close()
})
const newProto = navigator.__proto__;
delete newProto.webdriver;
navigator.__proto__ = newProto
was more correct way to remove webdriver
from navigator
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (1 by maintainers)
Top 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 >Navigator.webdriver - Web APIs | MDN
The webdriver read-only property of the navigator interface indicates whether the user agent is controlled by automation.
Read more >Preventing Selenium from being detected - LinkedIn
I've been testing Selenium with Chromedriver and discovered that some pages may identify that you're using Selenium even if there is no ...
Read more >Detecting Selenium Chrome - Security Boulevard
A straightforward and well-known approach to detecting Selenium is to test if navigator.webdriver is equal to true. However, while navigator.
Read more >Detecting Selenium Chrome - DataDome
webdriver is equal to true. However, while navigator.webdriver = true indicates the presence of a bot, it will also catch bots instrumented with ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is no way
__proto__
will get deleted from Chrome anytime soon, it will break too many sites. But in case it will, this works as well:very good!
delete navigator.__proto__.webdriver;