Skip to content

Commit

Permalink
feat: add wrap for window-size and window-position flag (#1158)
Browse files Browse the repository at this point in the history
  • Loading branch information
kvii authored Dec 7, 2024
1 parent 3025dde commit 686e0ad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
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

0 comments on commit 686e0ad

Please sign in to comment.