You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, 8d5e1d0 got rid of Page.frameScheduledNavigation and all of its types. In UnmarshalMessage, that event method now doesn't fall under any of the cases, and ends up calling json.Unmarshal(buf, v) where v == nil.
The fix here is probably to modify cdproto-gen so that UnmarshalMessage handles this case gracefully:
diff --git a/cdproto.go b/cdproto.go
index 21f111e..fb513e9 100644
--- a/cdproto.go
+++ b/cdproto.go
@@ -2243,6 +2243,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case EventTracingTracingComplete:
v = new(tracing.EventTracingComplete)
+
+ default:
+ return nil, errors.New("unknown or deprecated event method")
}
var buf easyjson.RawMessage
I've worked around this in chromedp v0 by capturing these events before the function is called, which is not ideal: chromedp/chromedp@e9aa66f
got rid of Page.frameRequestedNavigation and all of its types. In UnmarshalMessage, that event method now doesn't fall under any of the cases, Page. FrameRequestedNavigation also need for processing,Like this:
switch msg.Method {
case "Page.frameClearedScheduledNavigation",
"Page.frameRequestedNavigation",
"Page.frameScheduledNavigation":
// These events are now deprecated, and UnmarshalMessage panics
// when they are received from Chrome. For now, to avoid panics
// and compile errors, and to fix chromedp v0 when installed via
// 'go get -u', skip the events here.
return nil
}
For example, 8d5e1d0 got rid of
Page.frameScheduledNavigation
and all of its types. InUnmarshalMessage
, that event method now doesn't fall under any of the cases, and ends up callingjson.Unmarshal(buf, v)
wherev == nil
.The fix here is probably to modify
cdproto-gen
so thatUnmarshalMessage
handles this case gracefully:I've worked around this in chromedp v0 by capturing these events before the function is called, which is not ideal: chromedp/chromedp@e9aa66f
/cc @kenshaw
The text was updated successfully, but these errors were encountered: