go-rod / rod

A Chrome DevTools Protocol driver for web automation and scraping.

Home Page:https://go-rod.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chromium can't login gmail account

twolao opened this issue · comments

commented

Rod Version: v0.114.5

package main

import (
    "github.com/go-rod/rod"
    "github.com/go-rod/rod/lib/launcher"
    "os"
    "log"
    "fmt"
    "time"
    "os/signal"
    "syscall"
)

var err error
func main() {
    l := launcher.New().
    Headless(false). 
    Devtools(false).
    Env(append(os.Environ(), "TZ=Asia/Tokyo")...).
    Leakless(true)
        
    url, err := l.Launch()
    if err != nil {
        fmt.Println("Error launching browser:", err)
        return
    }
    defer l.Cleanup()
        
    browser := rod.New().ControlURL(url).NoDefaultDevice()
    if err = browser.Connect(); err != nil {
        fmt.Println("Error connecting to browser:", err)
        return
    }
    defer browser.MustClose()
    page := browser.MustPage() 
	page.Navigate("https://gmail.com")

    ticker := time.NewTicker(30 * time.Second)
    quit := make(chan struct{})
    go func() {
        for {
            select {
            case <-ticker.C:
                log.Println("some code")
            case <-quit:
                ticker.Stop()
                return
            }
        }
    }()

    sigs := make(chan os.Signal, 1)
    signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)

    <-sigs
    close(quit)
    fmt.Println("browser closed")
}

What you got

gmail

What you expect to see

can log in normally and use gmail

What have you tried to solve the question

commented

Is it possible to use firefox or thunderbird browser, how to set up to use non-chromium browser

Please check related issues

commented

Please check related issues

find this #375 , The test mentioned that gmail can be used normally, but the time at that time was 2021. I don’t know if Google’s policy has changed recently.

commented

Please check related issues

https://forum.puppylinux.com/viewtopic.php?t=5135 find this post mentioning that Chromium no longer supports gmail login, time is 2022

Yes, might be an upstream issue.

commented

Is it possible to use firefox or thunderbird browser, how to set up

Is it possible to use firefox or thunderbird browser, how to configure,can you give some hint.

find issue #193, What is the current status of support for Firefox browser?

You can check their ticket

BTW, you can use chrome with rod, works fine to me

commented

You can check their ticket

BTW, you can use chrome with rod, works fine to me

I found that a multilogin product also uses the Chromium browser and can use Gmail normally, but the browser version is obviously different. go-rod generates 114.0.5720.0 (developer build), that is chromium 120.0.6099.130 (official version)

Can go-rod also automatically download and use the official version of chromium?

I tried to compare the difference between chrome and chromium. It is obvious that chrome beats chromium in all aspects, so I have a question, why does go-rod not use chrome directly but choose to use chromium?

yes, rod exposes all its low level methods, check https://github.com/go-rod/rod/blob/main/lib/launcher/browser.go

why does go-rod not use chrome directly but choose to use chromium?

Because you can easily switch to chrome with rod, and the License of Chrome make it hard to choose it.

commented

why does go-rod not use chrome directly but choose to use chromium?

Because you can easily switch to chrome with rod, and the License of Chrome make it hard to choose it.

thx