berstend / puppeteer-extra

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

[Bug] "This browser or app may not be secure" appears again when trying to login to google #822

Open git37 opened 11 months ago

git37 commented 11 months ago

[Bug] "This browser or app may not be secure" appears again when trying to login to google

nm-free commented 11 months ago

Same happens to me too.

signaldev1 commented 11 months ago

+1 Once again, the issue has emerged today !

haupt-pascal commented 11 months ago

+1

MichaelRobsonSliide commented 11 months ago

I've just started using this and I get the same, I've noticed if I set headless: false it works but when I run in headless I get the "browser or app may not be secure" message

git37 commented 11 months ago

I've just started using this and I get the same, I've noticed if I set headless: false it works but when I run in headless I get the "browser or app may not be secure" message

for me it is also with headless=false, but it seems like this repo isn't maintained anymore...

signaldev1 commented 11 months ago

No solution found yet :/ . Still working on it. Any suggestions welcome.

vilkhovskiy commented 10 months ago

Does anyone have any updates?

peacemaker123456 commented 10 months ago

The issues is caused by the stealth plugin.

I narrowed it down and you need to delete those 2 evasions:

const stealthPlugin = stealth() stealthPlugin.enabledEvasions.delete('iframe.contentWindow'); stealthPlugin.enabledEvasions.delete('media.codecs')

Also using: args: ['--disable-blink-features=AutomationControlled']

haupt-pascal commented 10 months ago

This does not work for me - do you have any idea?

import puppeteer from 'puppeteer-extra' import { PuppeteerNodeLaunchOptions, Browser, Page, ElementHandle } from 'puppeteer' import fs from 'fs-extra' import path from 'path' const StealthPlugin = require('puppeteer-extra-plugin-stealth')() StealthPlugin.enabledEvasions.delete('iframe.contentWindow') StealthPlugin.enabledEvasions.delete('navigator.plugins') StealthPlugin.enabledEvasions.delete('media.codecs') puppeteer.use(StealthPlugin)

image
nm-free commented 10 months ago

This does not work for me - do you have any idea?

import puppeteer from 'puppeteer-extra' import { PuppeteerNodeLaunchOptions, Browser, Page, ElementHandle } from 'puppeteer' import fs from 'fs-extra' import path from 'path' const StealthPlugin = require('puppeteer-extra-plugin-stealth')() StealthPlugin.enabledEvasions.delete('iframe.contentWindow') StealthPlugin.enabledEvasions.delete('navigator.plugins') StealthPlugin.enabledEvasions.delete('media.codecs') puppeteer.use(StealthPlugin)

image

I same issue.

peacemaker123456 commented 10 months ago

This does not work for me - do you have any idea?

`import puppeteer from 'puppeteer-extra'

import { PuppeteerNodeLaunchOptions, Browser, Page, ElementHandle } from 'puppeteer'

import fs from 'fs-extra'

import path from 'path'

const StealthPlugin = require('puppeteer-extra-plugin-stealth')()

StealthPlugin.enabledEvasions.delete('iframe.contentWindow')

StealthPlugin.enabledEvasions.delete('navigator.plugins')

StealthPlugin.enabledEvasions.delete('media.codecs')

puppeteer.use(StealthPlugin)

`

image

try also args: ['--disable-blink-features=AutomationControlled']

haupt-pascal commented 10 months ago

Doesn't work as well...

krieg0102 commented 10 months ago

same issue. +1

OmerGit2000 commented 10 months ago

+1

N0itx commented 10 months ago

+1

lindo8818 commented 9 months ago

Well guys, without testing it, i have an idea. Log which userAgent you are using. This err looks to me like a outdated Useragent...

wlc108 commented 9 months ago

It's definitely not the Useragent for most people -- quickest thing I ruled out on my end for most sites. Multiple other bot-detection sites started detecting Puppeteer-extra-stealth too. I strongly feel it's somehow detecting it via javascript

sawaYch commented 9 months ago

any update for this issue? I am facing same issue for headless mode while headful mode works well with stealth plugin.

onepunch-tk commented 8 months ago

If there is a "--disable-notifications" option in args Try removing it. By removing this option, it worked.

code: `const puppeteer = require("puppeteer-extra"); const StealthPlugin = require("puppeteer-extra-plugin-stealth"); const AnonymizeUAPlugin = require("puppeteer-extra-plugin-anonymize-ua"); const AdblockerPlugin = require("puppeteer-extra-plugin-adblocker"); const path = require("path");

puppeteer.use(StealthPlugin()); puppeteer.use(AnonymizeUAPlugin()); puppeteer.use( AdblockerPlugin({ blockTrackers: true, }) ); const crawler = async () => { const browser = await puppeteer.launch({ headless: false, defaultViewport: null, ignoreDefaultArgs: ["--disable-extensions"], args: [ "--start-maximized", "--no-sandbox", "--disable-setuid-sandbox", "--user-data-dir=${path.join(__dirname, "dev-user-data")}", ], }); const page = await browser.newPage(); let login_link = "https://google.com/"; await page.goto(login_link); };`

marcio199226 commented 7 months ago

@onepunch-tk it's really works!

nowaysgit commented 7 months ago

+1

triplesixman commented 4 months ago

+1

Has worked for over a year without any problems.

No problems if I connect from a browser.

luizgununes commented 3 months ago

Unfortunately, not working here. Does someone still has this issue?

vladtreny commented 3 months ago

send full code to reproduce

better compile everything in one file

luizgununes commented 3 months ago

Ignore the OpenAI part, it works fine. The problem is after the email input.

const puppeteer = require("puppeteer-extra");
const StealthPlugin = require("puppeteer-extra-plugin-stealth");
const AnonymizeUAPlugin = require("puppeteer-extra-plugin-anonymize-ua");
const AdblockerPlugin = require("puppeteer-extra-plugin-adblocker");

puppeteer.use(StealthPlugin());
puppeteer.use(AnonymizeUAPlugin());
puppeteer.use(
  AdblockerPlugin({
    blockTrackers: true,
  })
);

const browser = await puppeteer.launch({
  headless: true,
  defaultViewport: null,
  ignoreDefaultArgs: ["--disable-extensions"],
  dumpio: true,
  args: ["--start-maximized", "--no-sandbox", "--disable-setuid-sandbox"],
  executablePath: "/Applications/Chromium.app/Contents/MacOS/Chromium",
});

const page = await browser.newPage();

// OpenAI Stuff

await page.goto("https://platform.openai.com/usage", {
  waitUntil: "networkidle2",
});

await page.waitForSelector("button");
await page.click("button")[0];
await page.waitForSelector(".social-btn");

try {
  await page.evaluate(() => {
    const elements = document.querySelectorAll(".social-btn");
    elements.forEach((element) => {
      if (element.innerHTML.includes("Google")) {
        element.click();
      }
    });
  });
} catch (error) {
  await page.click("form[data-provider] button")[1];
}

// Google Stuff

await page.waitForNavigation();

await page.waitForSelector('input[type="email"]');

await page.type('input[type="email"]', "test@test.com", { delay: 30 });

await page.keyboard.press("Enter");

page
  .waitForSelector('input[type="password"]', { visible: true })
  .then(async () => {
    await page.type('input[type="password"]', "test");
    await page.keyboard.press("Enter");
  });
vladtreny commented 3 months ago

Remove this puppeteer.use(StealthPlugin());

And add this

const stealth = StealthPlugin()
stealth.enabledEvasions.delete('iframe.contentWindow')
stealth.enabledEvasions.delete('media.codecs')
puppeteer.use(stealth)
luizgununes commented 3 months ago

Nice! It worked. But seems like I have to figure out how to bypass the captcha...