berstend / puppeteer-extra

💯 Teach puppeteer new tricks through plugins.
https://extra.community
MIT License
6.39k stars 738 forks source link

[Bug] stealth Plugin detected on Google Login page #588

Open rustynail1984 opened 2 years ago

rustynail1984 commented 2 years ago

Versions "puppeteer": "^10.4.0", "puppeteer-extra": "^3.2.3", "puppeteer-extra-plugin-stealth": "^2.9.0"

Hello noticed today that automatic login in Google does not work anymore if puppeteer is operated in "headless": true. in "headless": false it still works. But this is not an option for me on a Linux server without a GPU. When the point comes with entering the password, I see this.

image

So i guess Google has detected the Headless Chrome browser and the Stealth plugin no longer works.

gianmd commented 2 years ago

Having same problem, any solution?

Chari69 commented 2 years ago

Same here

teewoeijer commented 2 years ago

try add await this.page.setBypassCSP(true)

rustynail1984 commented 2 years ago

try add await this.page.setBypassCSP(true)

Thats working. Thanks :)

kurohoan commented 2 years ago

It was very helpful.

dima11221122 commented 2 years ago

It doesn't work anymore (

yeucodonvn commented 2 years ago

It doesn't work anymore (

yes.It doesn't work

rustynail1984 commented 2 years ago

It doesn't work anymore (

yes.It doesn't work

still works for me

dima11221122 commented 2 years ago

What are the versions of puppeteer and stealth plugin do you use?

rustynail1984 commented 2 years ago

What are the versions of puppeteer and stealth plugin do you use?

see above

AnjaneyuluBatta505 commented 2 years ago

It's still working. I used the below versions.

puppeteer-core@10.4.0
puppeteer-extra-plugin-stealth@2.10.1
puppeteer-extra@3.3.0
puppeteer@10.4.0

sample code

const puppeteer = require('puppeteer-extra');
// const chromium = require('@sparticuz/chrome-aws-lambda');
const chromium = require('chrome-aws-lambda');
const pluginStealth = require('puppeteer-extra-plugin-stealth')();
console.log(pluginStealth.availableEvasions); // => Set { 'user-agent', 'console.debug' }
puppeteer.use(pluginStealth);
pluginStealth.setMaxListeners = () => {};

const browser = await puppeteer.launch({
    args: chromium.args,
    defaultViewport: chromium.defaultViewport,
    dumpio: process.env.STAGE === 'dev',
    executablePath: await chromium.executablePath,
    headless: chromium.headless,
    ignoreHTTPSErrors: true,
});

const page = await browser.newPage();
await page.setBypassCSP(true)  
signaldev1 commented 2 years ago

try add await this.page.setBypassCSP(true)

unfortunately today i get this error after a year !!

tab1293 commented 2 years ago

I also today have just started running in to "The browser or app may not be secure" error from Google when trying to log in to Google accounts via puppeteer.

@AnjaneyuluBatta505 are you still not running in to this error as of today?

mdsr commented 2 years ago

We started getting this issue from last weekend but it is worth noting that the block is specific to a few handful of Google accounts. Most of the logins go through as usual.

LinkTree3 commented 2 years ago

I also started getting this today(could be earlier I haven't checked in a few weeks) on some accounts.

Is there any solution for this? I need to manage a few google accounts and the puppeteer tools I wrote to handle this have been very helpful to me for the past few months.

Maybe I should use something else to not get detected by google and still be able to manage my accounts?

berstend commented 2 years ago

@LinkTree3 did you try this workaround? https://github.com/berstend/puppeteer-extra/issues/668#issuecomment-1175380080

LinkTree3 commented 2 years ago

@LinkTree3 did you try this workaround? #668 (comment)

Unfortunately this solution did not work for me :(

I added this

const stealthPlugin = StealthPlugin();
stealthPlugin.enabledEvasions.delete('iframe.contentWindow');
stealthPlugin.enabledEvasions.delete('navigator.plugins');
puppeteer.use(StealthPlugin())

And I tried it both with await page.setBypassCSP(true) and without

Still with the same Gmail error

thomask commented 1 year ago

For anyone landing here, please see: https://github.com/berstend/puppeteer-extra/issues/668#issuecomment-1308340872

signaldev1 commented 1 year ago

Once again, the issue/problem has emerged today ! Are there any suggestions or solutions from anyone regarding this problem?

tab1293 commented 1 year ago

I am running in to this again as well. @signaldev1 any luck uncovering a work around?

signaldev1 commented 1 year ago

hey @tab1293 No, I'm still searching for a solution as well.

If anyone has any updates or workarounds, please share. Let's collaborate to find a resolution.

JortsEnjoyer0 commented 4 months ago

I just want to report that this is still an issue and all suggested solutions do not work anymore. Maybe look into how the library puppeteer-real-browser does it and implement that? (I am not the author, I stumbled upon it elsewhere and so far it is working and seems to have a history of working well).