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

feat: add wrap for window-size and window-position flag #1158

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

kvii
Copy link
Contributor

@kvii kvii commented Dec 2, 2024

image

https://peter.sh/experiments/chromium-command-line-switches/

Use case:

l := launcher.New().HeadlessNew(false)
l.WindowSize(1600, 900).WindowPosition(10, 40) // <--
u := l.MustLaunch()
defer l.Cleanup()

b := rod.New().ControlURL(u).MustConnect()
defer b.Close()

p := b.MustPage()
defer b.Close()

p.MustNavigate("https://www.baidu.com")
time.Sleep(time.Hour)
// See the size and position of opened browser window

Note: Only test manually in mac and windows 11. It is necessary to turn off stage manager settings when using macOS.

@kvii
Copy link
Contributor Author

kvii commented Dec 2, 2024

It is not my fault🥺。

@ysmood ysmood merged commit 686e0ad into go-rod:main Dec 7, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants