Closed teewoeijer closed 3 years ago
I use a youtube uploader package that relies on the stealth plugin, we've got issues logging in to Google as well : https://github.com/fawazahmed0/youtube-uploader/issues/48
+1 ,same problem , This browser or app may not be secure , Even when using :
await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136");
same issue here =(
I was experiencing the same issue but only for certain accounts like (about 1 in 10) since September. Seems like today is the official roll-out where everything is blocked
Same issue here. Seems that Google can detect it. Even when using:
executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
userDataDir: userDataDir,
headless: false,
Okay I found something that might be useful. If using any user agent other than chrome with stealth plugin can actually bypass the detection.
So I think maybe the stealth plugin's user-agent-override package may be the answer for this fix.
My code:
(async () => {
const puppeteer = require('puppeteer-extra')
const StealthPlugin = require('puppeteer-extra-plugin-stealth')
puppeteer.use(StealthPlugin())
const browser = await puppeteer.launch({ headless: false});
const page = await browser.newPage();
await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0");
await page.goto('https://accounts.google.com/signin/v2/identifier?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&ss=1&scc=1<mpl=default<mplcache=2&emr=1&osid=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin');
await page.type('input', 'demo123', {delay: 20})
const elements = await page.$x('//span[text()="Next"]')
await elements[0].click()
await page.waitForTimeout(30000);
await browser.close();
})();
Okay I found something that might be useful. If using any user agent other than chrome with stealth plugin can actually bypass the detection.
So I think maybe the stealth plugin's user-agent-override package may be the answer for this fix.
My code:
(async () => { const puppeteer = require('puppeteer-extra') const StealthPlugin = require('puppeteer-extra-plugin-stealth') puppeteer.use(StealthPlugin()) const browser = await puppeteer.launch({ headless: false}); const page = await browser.newPage(); await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0"); await page.goto('https://accounts.google.com/signin/v2/identifier?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&ss=1&scc=1<mpl=default<mplcache=2&emr=1&osid=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin'); await page.type('input', 'demo123', {delay: 20}) const elements = await page.$x('//span[text()="Next"]') await elements[0].click() await page.waitForTimeout(30000); await browser.close(); })();
Not working for me still getting same probleme
A fix is coming 😄
Fixed in #579:
Successfully published:
- puppeteer-extra-plugin-stealth@2.9.0
Coffee donations accepted 😄
@berstend thank you , but with this modification now it's giving new error captcha verification
@berstend Thanks its working again with version 2.9.0. However, the problem persists while running in headless mode.
code:
(async () => {
const puppeteer = require('puppeteer-extra')
const StealthPlugin = require('puppeteer-extra-plugin-stealth')
puppeteer.use(StealthPlugin())
const browser = await puppeteer.launch({ headless: true});
const page = await browser.newPage();
await page.goto('https://accounts.google.com/signin/v2/identifier?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&ss=1&scc=1<mpl=default<m$
await page.type('input', 'demo123', {delay: 20})
const elements = await page.$x('//span[text()="Next"]')
await elements[0].click()
await page.waitForTimeout(2000);
await page.screenshot({path: 'screenshot.png'});
await browser.close();
})();
It is working in headless mode. Bypass CSP geniuses
It is working in headless mode. Bypass CSP geniuses
Yes added await page.setBypassCSP(true) and its working. thanks.
I just wanna say thanks for the quick response on this issue ! ♥ I'll get you a coffee later.
It is working in headless mode. Bypass CSP geniuses
Thank you, it is also working for me.
hello @berstend this error is showing again do you have any idea ??
Google started to detect puppeteer extra stealth for me as well. :( It won't let me login to some of the few accounts I'm managing.
This issue has been closed in favor of #588
A possible workaround has been mentioned here: https://github.com/berstend/puppeteer-extra/issues/668#issuecomment-1175380080
Hey @berstend , Once again, the issue has emerged today
Any solution to this issue?
If you have these arguments in your browser startup:
args: [ `--disable-web-security`, `--allow-running-insecure-content`, ]
removing them (or one of them) solved the issue for me
^ this is probably because they detect via iframe
The stealth plugin had been working fine on Google's website, however it stopped working recently. The website shows "This browser or app may not be secure" error after submitting the username.
my package version: puppeteer-extra-plugin-stealth@2.8.2 puppeteer-extra@3.2.3
Below is my code: