Skip to content

Commit 686e0ad

Browse files
authored
feat: add wrap for window-size and window-position flag (#1158)
1 parent 3025dde commit 686e0ad

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

lib/launcher/flags/flags.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ const (
2727
// ProxyServer flag.
2828
ProxyServer Flag = "proxy-server"
2929

30+
// WindowSize flag.
31+
WindowSize Flag = "window-size"
32+
33+
// WindowPosition flag.
34+
WindowPosition Flag = "window-position"
35+
3036
// WorkingDir flag.
3137
WorkingDir Flag = "rod-working-dir"
3238

lib/launcher/launcher.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,16 @@ func (l *Launcher) Proxy(host string) *Launcher {
337337
return l.Set(flags.ProxyServer, host)
338338
}
339339

340+
// WindowSize for the browser.
341+
func (l *Launcher) WindowSize(x, y int) *Launcher {
342+
return l.Set(flags.WindowSize, fmt.Sprintf("%d,%d", x, y))
343+
}
344+
345+
// WindowPosition for the browser.
346+
func (l *Launcher) WindowPosition(x, y int) *Launcher {
347+
return l.Set(flags.WindowPosition, fmt.Sprintf("%d,%d", x, y))
348+
}
349+
340350
// WorkingDir to launch the browser process.
341351
func (l *Launcher) WorkingDir(path string) *Launcher {
342352
return l.Set(flags.WorkingDir, path)

0 commit comments

Comments
 (0)