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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/launcher/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ const (
// ProxyServer flag.
ProxyServer Flag = "proxy-server"

// WindowSize flag.
WindowSize Flag = "window-size"

// WindowPosition flag.
WindowPosition Flag = "window-position"

// WorkingDir flag.
WorkingDir Flag = "rod-working-dir"

Expand Down
10 changes: 10 additions & 0 deletions lib/launcher/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,16 @@ func (l *Launcher) Proxy(host string) *Launcher {
return l.Set(flags.ProxyServer, host)
}

// WindowSize for the browser.
func (l *Launcher) WindowSize(x, y int) *Launcher {
return l.Set(flags.WindowSize, fmt.Sprintf("%d,%d", x, y))
}

// WindowPosition for the browser.
func (l *Launcher) WindowPosition(x, y int) *Launcher {
return l.Set(flags.WindowPosition, fmt.Sprintf("%d,%d", x, y))
}

// WorkingDir to launch the browser process.
func (l *Launcher) WorkingDir(path string) *Launcher {
return l.Set(flags.WorkingDir, path)
Expand Down
Loading