Open arjendevos opened 6 months ago
Update: seems like google is detecting if the browser is run in debug-mode -> https://stackoverflow.com/a/59673634/13008147
Update: generated my own JS from the puppeteer stealth plugin with these 2 options:
const stealth = StealthPlugin()
stealth.enabledEvasions.delete('iframe.contentWindow')
stealth.enabledEvasions.delete('media.codecs')
puppeteer.use(stealth)
as mentioned here: https://github.com/berstend/puppeteer-extra/issues/822#issuecomment-2021850431
Doesn't help
Update: if I use .NewUserMode() with headless=false, it seems to work. However when I run it headlessly it fails, I thought due user-agent (includes headless) but overriding the user-agent doesn't work either
You can use the FormatArgs
to debug which cli arg is affecting it:
Th only difference between running headless and running not headless is the user-data-dir. But that one is different on each run.
Not headless:
args [--disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-features=site-per-process,TranslateUI --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --enable-automation --enable-features=NetworkService,NetworkServiceInProcess --force-color-profile=srgb --headless --metrics-recording-only --no-first-run --no-startup-window --remote-debugging-port=0 --use-mock-keychain --user-data-dir=/var/folders/sz/n6cyhc1x1qjd7m1wl04tn8mr0000gn/T/rod/user-data/9699488a8a9c9dc3]
Headless:
args [--disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-features=site-per-process,TranslateUI --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --enable-automation --enable-features=NetworkService,NetworkServiceInProcess --force-color-profile=srgb --headless --metrics-recording-only --no-first-run --no-startup-window --remote-debugging-port=0 --use-mock-keychain --user-data-dir=/var/folders/sz/n6cyhc1x1qjd7m1wl04tn8mr0000gn/T/rod/user-data/2af72e923ad51328]
Also how is it possible that they both have the --headless
flag?
Could you try the v0.115.0
@ysmood same problem
Works fine to me:
package main
import (
"github.com/go-rod/rod"
"github.com/go-rod/rod/lib/utils"
)
func main() {
browser := rod.New().NoDefaultDevice().MustConnect()
page := browser.MustPage("https://google.com")
page.MustElement(".gb_Ld").MustClick() // Click login
utils.Pause()
}
@ysmood fill out details until you are at the password input page. That's where it says that the browser is not secure.
Still works fine to me after enter the mail address.
我也是同样的问题,请问有解决办法吗?
I have the same problem
Google Tips:
Couldn't sign you in This browser or app may not be secure. Learn more Try using a different browser. If you’re already using a supported browser, you can try again to sign in.
https://support.google.com/accounts/answer/7675428?hl=zh-Hans&sjid=10578618853013669016-AP
Same problem
Google will not process user logins cause the browser is not secure
Puppeteer has the same issue: https://github.com/berstend/puppeteer-extra/issues/822
I think it's more like an upstream issue of chromium or the google website's false positive. Rod can't do much about it.
Maybe remove stealth and add NoDefaultDevice
will make it work.
Same problem and it idn't work with NoDefaultDevice. ROD works great except logging into google account.
Rod Version: v0.114.8
This is my startup code:
This sees the right chrome instance but when it starts it somehow starts unsecure.
Whenever I start the normal browser and add the websocket url in the Go program, it does work.