File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,8 @@ func (b *Browser) Connect() error {
157
157
return err
158
158
}
159
159
b .client = c
160
+ } else if b .controlURL != "" {
161
+ panic ("Browser.Client and Browser.ControlURL can't be set at the same time" )
160
162
}
161
163
162
164
b .initEvents ()
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
11
11
"time"
12
12
13
13
"github.com/go-rod/rod"
14
+ "github.com/go-rod/rod/lib/cdp"
14
15
"github.com/go-rod/rod/lib/devices"
15
16
"github.com/go-rod/rod/lib/launcher"
16
17
"github.com/go-rod/rod/lib/proto"
@@ -474,3 +475,10 @@ func TestBrowserLostConnection(t *testing.T) {
474
475
_ , err := p .Eval (`() => new Promise(r => {})` )
475
476
g .Err (err )
476
477
}
478
+
479
+ func TestBrowserConnectConflict (t * testing.T ) {
480
+ g := setup (t )
481
+ g .Panic (func () {
482
+ rod .New ().Client (& cdp.Client {}).ControlURL ("test" ).MustConnect ()
483
+ })
484
+ }
You can’t perform that action at this time.
0 commit comments