go-rod / rod

A Chrome DevTools Protocol driver for web automation and scraping.
https://go-rod.github.io
MIT License
5k stars 328 forks source link

rod resets settings of a chrome profile #1041

Closed xob0t closed 2 months ago

xob0t commented 2 months ago

Rod Version: v0.114.8

I'm launching rod with a specified Chrome profile. All works as expected, but some profile settings are reset after the launch. I noticed:

I've tried launching Chrome directly without rod, but with the same args as it launches it with, and have not encountered this issue.


import (
    "fmt"

    "github.com/go-rod/rod"
    "github.com/go-rod/rod/lib/launcher"
)

var (
    ProfileDir    string = "Profile 51"
    UserDataDir   string = "C:\\Users\\admin\\AppData\\Local\\Google\\Chrome\\User Data"
    ChromeBinPath string = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
)

func main() {
    launcher := launcher.New().
        Bin(ChromeBinPath).
        Set("user-data-dir", UserDataDir).
        Set("profile-directory", ProfileDir).
        Leakless(false).
        Headless(false)
    cu, err := launcher.Launch()
    if err != nil {
        fmt.Println(err)
    }
    browser := rod.New().ControlURL(cu)
    err = browser.Connect()
    if err != nil {
        fmt.Println(err)
    }
    defer browser.Close()
}

demo: https://github.com/go-rod/rod/assets/32616886/85b70ab3-9a7c-4573-9e8e-ec583292ac2c

ysmood commented 2 months ago

Could you try the v0.115.0

xob0t commented 2 months ago

the issue is gone, mad respect for the quick fix!