Content-Length: 233753 | pFad | http://github.com/go-rod/rod/issues/1170

0F Regarding the browser issue, I would like to ask the author for help. Thank you very much for your open source help. · Issue #1170 · go-rod/rod · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding the browser issue, I would like to ask the author for help. Thank you very much for your open source help. #1170

Open
cplasfwst opened this issue Jan 24, 2025 · 3 comments
Labels
question Questions related to rod

Comments

@cplasfwst
Copy link

cplasfwst commented Jan 24, 2025

Rod Version: v0.116.2

First of all, thanks for all the work you're putting into the library!

The code to demonstrate your question

  1. Clone Rod to your local and cd to the repository:
func main() {	
	path := `D:\2025zhiwenXUEXI\chrome\Chrome-bin\chrome.exe`
	u := launcher.New().
		Set("headless").
		Delete("--headless").
		Set("user-data-dir", "data/").
		Set("lang", "en-US").
		Bin(path).
		Leakless(true).
		Headless(false)

	launch := u.MustLaunch()
	defer u.Cleanup()

	b := rod.New().ControlURL(launch).MustConnect()
	b.MustPage("https://baidu.com")
	b.MustPage("https://bot.sannysoft.com/")

	time.Sleep(100 * time.Second)
}

What you got

I compiled a chromium browser. Now I need to use go-rod to run my own compiled browser,I can run the browser normally using the above code, but when I use https://bot.sannysoft.com/ to check, the fingerprint information is:
Image

User Agent is always displayed: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

What you expect to see

I hope go-rod will not modify the parameters on my browser. I can use my own browser's parameter settings normally. What should I do?
The normal display should be my own fingerprint information. I can create a new window manually and it works fine. Example picture:
Image

What have you tried to solve the question

I tried using user mode,Then bin my own browser(https://go-rod.github.io/i18n/zh-CN/#/custom-launch?id=user-mode), but it still doesn't work

@cplasfwst cplasfwst added the question Questions related to rod label Jan 24, 2025
Copy link

Please fix the format of your markdown:

9 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
38:150 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]

generated by check-issue

@dgreshnikov
Copy link

You need to disable default device.

b := rod.New().ControlURL(launch).MustConnect().NoDefaultDevice()

@cplasfwst
Copy link
Author

cplasfwst commented Jan 26, 2025

You need to disable default device.

b := rod.New().ControlURL(launch).MustConnect().NoDefaultDevice()

Thank you very much! Now it is OK and can run normally, but I have a problem now, that is, the proxy cannot be used normally no matter how I try

`localProxyURL := fmt.Sprintf("http://localhost:%d", localPort)
fmt.Println("这个是本地端口号:", localProxyURL)

//初始化浏览器
launch := launcher.New().
	Bin(PATH).Set("--disable-blink-features", "AutomationControlled").Set("no-first-run").Set("disable-default-apps").
	Leakless(true).
	Headless(false).
	Proxy(localProxyURL).
	//Set("proxy-server", localProxyURL).
	//Set("timezone", "Asia/Tokyo").
	//Set("useragent").
	Set("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36").
	//Set("user-data-dir", "data/1").
	Set("lang", "en-US").
	MustLaunch()

browser := rod.New().ControlURL(launch).MustConnect()`

I just tested it and it seems that I can't set the proxy using the official version of Chrome browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions related to rod
Projects
None yet
Development

No branches or pull requests

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/go-rod/rod/issues/1170

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy