diff --git a/lib/launcher/flags/flags.go b/lib/launcher/flags/flags.go index f21605da..2b8b2994 100644 --- a/lib/launcher/flags/flags.go +++ b/lib/launcher/flags/flags.go @@ -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" diff --git a/lib/launcher/launcher.go b/lib/launcher/launcher.go index 92436c84..4926b376 100644 --- a/lib/launcher/launcher.go +++ b/lib/launcher/launcher.go @@ -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)