-
-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for calling functions on proxy (navigator.webdriver evasion) #130
Conversation
Interesting. I wonder why that's necessary though - function calls are covered by the I did a quick search if |
Ah, well - it's a bug in Chromium so it doesn't need to make sense. 😄 |
I've added a regression test so this won't happen again in the future: test('stealth: regression: wont kill other navigator methods', async t => {
const puppeteer = addExtra(vanillaPuppeteer).use(Plugin())
const browser = await puppeteer.launch({ headless: true })
const page = await browser.newPage()
try {
const data = await page.evaluate(() => navigator.javaEnabled())
t.is(data, false)
} catch (err) {
t.is(err, undefined)
}
}) |
I agree it's weird, but apparently the apply trap is not called in case of native functions. Maybe it's fixed in a future Chromium release, so the regression test is a good idea. |
Good find regardless. :) I skimmed the rest of the evasions but this seems to be the only occurrence where this fix is required. |
Actually that's not true, found some other spots that had this issue and added the fix. 😅 |
Oops... Didn't even think of checking other evasions, good catch! |
Released as |
This fixes function calls on the navigator object, for example
navigator.javaEnabled()
which is called by Google Analytics.Related Chromium bug: https://bugs.chromium.org/p/v8/issues/detail?id=5773