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

Authorization is lost in headless #894

Open
bazuker opened this issue Jun 19, 2023 · 1 comment
Open

Authorization is lost in headless #894

bazuker opened this issue Jun 19, 2023 · 1 comment
Labels
question Questions related to rod upstream Upstream issue that can't solved by Rod

Comments

@bazuker
Copy link

bazuker commented Jun 19, 2023

Rod Version: v0.113.3

The code to demonstrate your question

I have authenticated myself on GitHub manually. When I use the code below in headless mode I am not authenticated as it seems like the stored session (cookie) is not passed.
When I run the code with Headless(false), it works fine and I am authenticated.
As if it ignored the user data dir in headless.

	l := launcher.New().
		UserDataDir("/Users/bazuker/go/src/project/userdata").
		Headless(true).
		Devtools(false)

	url := l.MustLaunch()

	browser := rod.New().
		ControlURL(url).
		Trace(true).
		SlowMotion(1 * time.Second).
		MustConnect()

browser.MustPage("https://github.com").MustWaitStable()

What you got

I am not authenticated in headless mode

What you expected to see

To be authenticated as I am returning to this website in headless mode.

@bazuker bazuker added the question Questions related to rod label Jun 19, 2023
@bazuker bazuker changed the title Authorization is lose in headless Authorization is lost in headless Jun 19, 2023
@ysmood
Copy link
Member

ysmood commented Jun 20, 2023

Yes, it's a well known issue of chromium, you can ask chromium team to fix it.

@ysmood ysmood added the upstream Upstream issue that can't solved by Rod label Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions related to rod upstream Upstream issue that can't solved by Rod
Projects
None yet
Development

No branches or pull requests

2 participants