Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ysmood
Last active November 24, 2020 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysmood/2540c531e140e701e42cf2554924e0b1 to your computer and use it in GitHub Desktop.
Save ysmood/2540c531e140e701e42cf2554924e0b1 to your computer and use it in GitHub Desktop.
Issue 1151822: CDP call Page.close on the non-exist session id will hang
package main
import (
"context"
"github.com/go-rod/rod"
"github.com/go-rod/rod/lib/cdp"
"github.com/go-rod/rod/lib/launcher"
)
func main() {
ctx := context.Background()
u := launcher.New().MustLaunch()
cdp := cdp.New(u).Logger(rod.DefaultLogger).MustConnect(ctx)
_, _ = cdp.Call(ctx, "nonexist", "Page.close", nil)
}
@ysmood
Copy link
Author

ysmood commented Nov 24, 2020

Actual output:

[rod] 2020/11/25 02:42:50 => #1 @nonexist Page.close null

Expected output:

[rod] 2020/11/25 02:42:50 => #1 @nonexist Page.close null
[rod] 2020/11/25 02:44:43 <= #1 error: {"code":-32601,"message":"'Page.close' wasn't found","data":""}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment