diff --git a/lib/launcher/launcher.go b/lib/launcher/launcher.go index b39b7616..8298b7b9 100644 --- a/lib/launcher/launcher.go +++ b/lib/launcher/launcher.go @@ -158,6 +158,9 @@ func (l *Launcher) Context(ctx context.Context) *Launcher { // Set a command line argument to launch the browser. func (l *Launcher) Set(name flags.Flag, values ...string) *Launcher { + if strings.Contains(string(name), "=") { + panic("flag name should not contain '='") + } l.Flags[l.normalizeFlag(name)] = values return l } diff --git a/lib/launcher/launcher_test.go b/lib/launcher/launcher_test.go index 937e625a..f6f2854e 100644 --- a/lib/launcher/launcher_test.go +++ b/lib/launcher/launcher_test.go @@ -121,6 +121,10 @@ func TestLaunch(t *testing.T) { _, err = launcher.NewManaged("ws://not-exists") g.Err(err) } + + { + g.Panic(func() { launcher.New().Set("a=b") }) + } } func TestLaunchUserMode(t *testing.T) {