Updating to latest protocol.json

This commit is contained in:
Kenneth Shaw 2017-08-29 09:48:17 +07:00
parent 50c2d576db
commit 4e57103faa
17 changed files with 972 additions and 511 deletions

View File

@ -54,6 +54,7 @@ const (
CommandInspectorEnable MethodType = "Inspector.enable" CommandInspectorEnable MethodType = "Inspector.enable"
CommandInspectorDisable MethodType = "Inspector.disable" CommandInspectorDisable MethodType = "Inspector.disable"
CommandMemoryGetDOMCounters MethodType = "Memory.getDOMCounters" CommandMemoryGetDOMCounters MethodType = "Memory.getDOMCounters"
CommandMemoryPrepareForLeakDetection MethodType = "Memory.prepareForLeakDetection"
CommandMemorySetPressureNotificationsSuppressed MethodType = "Memory.setPressureNotificationsSuppressed" CommandMemorySetPressureNotificationsSuppressed MethodType = "Memory.setPressureNotificationsSuppressed"
CommandMemorySimulatePressureNotification MethodType = "Memory.simulatePressureNotification" CommandMemorySimulatePressureNotification MethodType = "Memory.simulatePressureNotification"
EventPerformanceMetrics MethodType = "Performance.metrics" EventPerformanceMetrics MethodType = "Performance.metrics"
@ -62,6 +63,7 @@ const (
CommandPerformanceGetMetrics MethodType = "Performance.getMetrics" CommandPerformanceGetMetrics MethodType = "Performance.getMetrics"
EventPageDomContentEventFired MethodType = "Page.domContentEventFired" EventPageDomContentEventFired MethodType = "Page.domContentEventFired"
EventPageLoadEventFired MethodType = "Page.loadEventFired" EventPageLoadEventFired MethodType = "Page.loadEventFired"
EventPageLifecycleEvent MethodType = "Page.lifecycleEvent"
EventPageFrameAttached MethodType = "Page.frameAttached" EventPageFrameAttached MethodType = "Page.frameAttached"
EventPageFrameNavigated MethodType = "Page.frameNavigated" EventPageFrameNavigated MethodType = "Page.frameNavigated"
EventPageFrameDetached MethodType = "Page.frameDetached" EventPageFrameDetached MethodType = "Page.frameDetached"
@ -102,6 +104,7 @@ const (
CommandPageGetLayoutMetrics MethodType = "Page.getLayoutMetrics" CommandPageGetLayoutMetrics MethodType = "Page.getLayoutMetrics"
CommandPageCreateIsolatedWorld MethodType = "Page.createIsolatedWorld" CommandPageCreateIsolatedWorld MethodType = "Page.createIsolatedWorld"
CommandPageBringToFront MethodType = "Page.bringToFront" CommandPageBringToFront MethodType = "Page.bringToFront"
CommandPageSetDownloadBehavior MethodType = "Page.setDownloadBehavior"
EventOverlayNodeHighlightRequested MethodType = "Overlay.nodeHighlightRequested" EventOverlayNodeHighlightRequested MethodType = "Overlay.nodeHighlightRequested"
EventOverlayInspectNodeRequested MethodType = "Overlay.inspectNodeRequested" EventOverlayInspectNodeRequested MethodType = "Overlay.inspectNodeRequested"
EventOverlayScreenshotRequested MethodType = "Overlay.screenshotRequested" EventOverlayScreenshotRequested MethodType = "Overlay.screenshotRequested"
@ -507,6 +510,8 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CommandInspectorDisable *t = CommandInspectorDisable
case CommandMemoryGetDOMCounters: case CommandMemoryGetDOMCounters:
*t = CommandMemoryGetDOMCounters *t = CommandMemoryGetDOMCounters
case CommandMemoryPrepareForLeakDetection:
*t = CommandMemoryPrepareForLeakDetection
case CommandMemorySetPressureNotificationsSuppressed: case CommandMemorySetPressureNotificationsSuppressed:
*t = CommandMemorySetPressureNotificationsSuppressed *t = CommandMemorySetPressureNotificationsSuppressed
case CommandMemorySimulatePressureNotification: case CommandMemorySimulatePressureNotification:
@ -523,6 +528,8 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = EventPageDomContentEventFired *t = EventPageDomContentEventFired
case EventPageLoadEventFired: case EventPageLoadEventFired:
*t = EventPageLoadEventFired *t = EventPageLoadEventFired
case EventPageLifecycleEvent:
*t = EventPageLifecycleEvent
case EventPageFrameAttached: case EventPageFrameAttached:
*t = EventPageFrameAttached *t = EventPageFrameAttached
case EventPageFrameNavigated: case EventPageFrameNavigated:
@ -603,6 +610,8 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CommandPageCreateIsolatedWorld *t = CommandPageCreateIsolatedWorld
case CommandPageBringToFront: case CommandPageBringToFront:
*t = CommandPageBringToFront *t = CommandPageBringToFront
case CommandPageSetDownloadBehavior:
*t = CommandPageSetDownloadBehavior
case EventOverlayNodeHighlightRequested: case EventOverlayNodeHighlightRequested:
*t = EventOverlayNodeHighlightRequested *t = EventOverlayNodeHighlightRequested
case EventOverlayInspectNodeRequested: case EventOverlayInspectNodeRequested:

View File

@ -67,6 +67,9 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
case cdp.CommandMemoryGetDOMCounters: case cdp.CommandMemoryGetDOMCounters:
v = new(memory.GetDOMCountersReturns) v = new(memory.GetDOMCountersReturns)
case cdp.CommandMemoryPrepareForLeakDetection:
return emptyVal, nil
case cdp.CommandMemorySetPressureNotificationsSuppressed: case cdp.CommandMemorySetPressureNotificationsSuppressed:
return emptyVal, nil return emptyVal, nil
@ -163,12 +166,18 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
case cdp.CommandPageBringToFront: case cdp.CommandPageBringToFront:
return emptyVal, nil return emptyVal, nil
case cdp.CommandPageSetDownloadBehavior:
return emptyVal, nil
case cdp.EventPageDomContentEventFired: case cdp.EventPageDomContentEventFired:
v = new(page.EventDomContentEventFired) v = new(page.EventDomContentEventFired)
case cdp.EventPageLoadEventFired: case cdp.EventPageLoadEventFired:
v = new(page.EventLoadEventFired) v = new(page.EventLoadEventFired)
case cdp.EventPageLifecycleEvent:
v = new(page.EventLifecycleEvent)
case cdp.EventPageFrameAttached: case cdp.EventPageFrameAttached:
v = new(page.EventFrameAttached) v = new(page.EventFrameAttached)

View File

@ -151,7 +151,66 @@ func (v *SetPressureNotificationsSuppressedParams) UnmarshalJSON(data []byte) er
func (v *SetPressureNotificationsSuppressedParams) UnmarshalEasyJSON(l *jlexer.Lexer) { func (v *SetPressureNotificationsSuppressedParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory1(l, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory1(l, v)
} }
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory2(in *jlexer.Lexer, out *GetDOMCountersReturns) { func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory2(in *jlexer.Lexer, out *PrepareForLeakDetectionParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory2(out *jwriter.Writer, in PrepareForLeakDetectionParams) {
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v PrepareForLeakDetectionParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory2(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v PrepareForLeakDetectionParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory2(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *PrepareForLeakDetectionParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory2(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *PrepareForLeakDetectionParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory2(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory3(in *jlexer.Lexer, out *GetDOMCountersReturns) {
isTopLevel := in.IsStart() isTopLevel := in.IsStart()
if in.IsNull() { if in.IsNull() {
if isTopLevel { if isTopLevel {
@ -186,7 +245,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory2(in *jlexer.Lexer, out
in.Consumed() in.Consumed()
} }
} }
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory2(out *jwriter.Writer, in GetDOMCountersReturns) { func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(out *jwriter.Writer, in GetDOMCountersReturns) {
out.RawByte('{') out.RawByte('{')
first := true first := true
_ = first _ = first
@ -220,27 +279,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory2(out *jwriter.Writer, i
// MarshalJSON supports json.Marshaler interface // MarshalJSON supports json.Marshaler interface
func (v GetDOMCountersReturns) MarshalJSON() ([]byte, error) { func (v GetDOMCountersReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{} w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory2(&w, v) easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(&w, v)
return w.Buffer.BuildBytes(), w.Error return w.Buffer.BuildBytes(), w.Error
} }
// MarshalEasyJSON supports easyjson.Marshaler interface // MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetDOMCountersReturns) MarshalEasyJSON(w *jwriter.Writer) { func (v GetDOMCountersReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory2(w, v) easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(w, v)
} }
// UnmarshalJSON supports json.Unmarshaler interface // UnmarshalJSON supports json.Unmarshaler interface
func (v *GetDOMCountersReturns) UnmarshalJSON(data []byte) error { func (v *GetDOMCountersReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data} r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory2(&r, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory3(&r, v)
return r.Error() return r.Error()
} }
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetDOMCountersReturns) UnmarshalEasyJSON(l *jlexer.Lexer) { func (v *GetDOMCountersReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory2(l, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory3(l, v)
} }
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory3(in *jlexer.Lexer, out *GetDOMCountersParams) { func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory4(in *jlexer.Lexer, out *GetDOMCountersParams) {
isTopLevel := in.IsStart() isTopLevel := in.IsStart()
if in.IsNull() { if in.IsNull() {
if isTopLevel { if isTopLevel {
@ -269,7 +328,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory3(in *jlexer.Lexer, out
in.Consumed() in.Consumed()
} }
} }
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(out *jwriter.Writer, in GetDOMCountersParams) { func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory4(out *jwriter.Writer, in GetDOMCountersParams) {
out.RawByte('{') out.RawByte('{')
first := true first := true
_ = first _ = first
@ -279,23 +338,23 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(out *jwriter.Writer, i
// MarshalJSON supports json.Marshaler interface // MarshalJSON supports json.Marshaler interface
func (v GetDOMCountersParams) MarshalJSON() ([]byte, error) { func (v GetDOMCountersParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{} w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(&w, v) easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory4(&w, v)
return w.Buffer.BuildBytes(), w.Error return w.Buffer.BuildBytes(), w.Error
} }
// MarshalEasyJSON supports easyjson.Marshaler interface // MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetDOMCountersParams) MarshalEasyJSON(w *jwriter.Writer) { func (v GetDOMCountersParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(w, v) easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory4(w, v)
} }
// UnmarshalJSON supports json.Unmarshaler interface // UnmarshalJSON supports json.Unmarshaler interface
func (v *GetDOMCountersParams) UnmarshalJSON(data []byte) error { func (v *GetDOMCountersParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data} r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory3(&r, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory4(&r, v)
return r.Error() return r.Error()
} }
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetDOMCountersParams) UnmarshalEasyJSON(l *jlexer.Lexer) { func (v *GetDOMCountersParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory3(l, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory4(l, v)
} }

View File

@ -45,6 +45,20 @@ func (p *GetDOMCountersParams) Do(ctxt context.Context, h cdp.Handler) (document
return res.Documents, res.Nodes, res.JsEventListeners, nil return res.Documents, res.Nodes, res.JsEventListeners, nil
} }
// PrepareForLeakDetectionParams [no description].
type PrepareForLeakDetectionParams struct{}
// PrepareForLeakDetection [no description].
func PrepareForLeakDetection() *PrepareForLeakDetectionParams {
return &PrepareForLeakDetectionParams{}
}
// Do executes Memory.prepareForLeakDetection against the provided context and
// target handler.
func (p *PrepareForLeakDetectionParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandMemoryPrepareForLeakDetection, nil, nil)
}
// SetPressureNotificationsSuppressedParams enable/disable suppressing memory // SetPressureNotificationsSuppressedParams enable/disable suppressing memory
// pressure notifications in all processes. // pressure notifications in all processes.
type SetPressureNotificationsSuppressedParams struct { type SetPressureNotificationsSuppressedParams struct {

View File

@ -641,6 +641,29 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork5(in *jlexer.Lexer, out
switch key { switch key {
case "enabled": case "enabled":
out.Enabled = bool(in.Bool()) out.Enabled = bool(in.Bool())
case "patterns":
if in.IsNull() {
in.Skip()
out.Patterns = nil
} else {
in.Delim('[')
if out.Patterns == nil {
if !in.IsDelim(']') {
out.Patterns = make([]string, 0, 4)
} else {
out.Patterns = []string{}
}
} else {
out.Patterns = (out.Patterns)[:0]
}
for !in.IsDelim(']') {
var v7 string
v7 = string(in.String())
out.Patterns = append(out.Patterns, v7)
in.WantComma()
}
in.Delim(']')
}
default: default:
in.SkipRecursive() in.SkipRecursive()
} }
@ -661,6 +684,25 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork5(out *jwriter.Writer,
first = false first = false
out.RawString("\"enabled\":") out.RawString("\"enabled\":")
out.Bool(bool(in.Enabled)) out.Bool(bool(in.Enabled))
if len(in.Patterns) != 0 {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"patterns\":")
if in.Patterns == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v8, v9 := range in.Patterns {
if v8 > 0 {
out.RawByte(',')
}
out.String(string(v9))
}
out.RawByte(']')
}
}
out.RawByte('}') out.RawByte('}')
} }
@ -719,15 +761,15 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork6(in *jlexer.Lexer, out
for !in.IsDelim('}') { for !in.IsDelim('}') {
key := string(in.String()) key := string(in.String())
in.WantColon() in.WantColon()
var v7 interface{} var v10 interface{}
if m, ok := v7.(easyjson.Unmarshaler); ok { if m, ok := v10.(easyjson.Unmarshaler); ok {
m.UnmarshalEasyJSON(in) m.UnmarshalEasyJSON(in)
} else if m, ok := v7.(json.Unmarshaler); ok { } else if m, ok := v10.(json.Unmarshaler); ok {
_ = m.UnmarshalJSON(in.Raw()) _ = m.UnmarshalJSON(in.Raw())
} else { } else {
v7 = in.Interface() v10 = in.Interface()
} }
(out.Headers)[key] = v7 (out.Headers)[key] = v10
in.WantComma() in.WantComma()
} }
in.Delim('}') in.Delim('}')
@ -755,20 +797,20 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork6(out *jwriter.Writer,
out.RawString(`null`) out.RawString(`null`)
} else { } else {
out.RawByte('{') out.RawByte('{')
v8First := true v11First := true
for v8Name, v8Value := range in.Headers { for v11Name, v11Value := range in.Headers {
if !v8First { if !v11First {
out.RawByte(',') out.RawByte(',')
} }
v8First = false v11First = false
out.String(string(v8Name)) out.String(string(v11Name))
out.RawByte(':') out.RawByte(':')
if m, ok := v8Value.(easyjson.Marshaler); ok { if m, ok := v11Value.(easyjson.Marshaler); ok {
m.MarshalEasyJSON(out) m.MarshalEasyJSON(out)
} else if m, ok := v8Value.(json.Marshaler); ok { } else if m, ok := v11Value.(json.Marshaler); ok {
out.Raw(m.MarshalJSON()) out.Raw(m.MarshalJSON())
} else { } else {
out.Raw(json.Marshal(v8Value)) out.Raw(json.Marshal(v11Value))
} }
} }
out.RawByte('}') out.RawByte('}')
@ -909,17 +951,17 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork8(in *jlexer.Lexer, out
out.Cookies = (out.Cookies)[:0] out.Cookies = (out.Cookies)[:0]
} }
for !in.IsDelim(']') { for !in.IsDelim(']') {
var v9 *CookieParam var v12 *CookieParam
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
v9 = nil v12 = nil
} else { } else {
if v9 == nil { if v12 == nil {
v9 = new(CookieParam) v12 = new(CookieParam)
} }
(*v9).UnmarshalEasyJSON(in) (*v12).UnmarshalEasyJSON(in)
} }
out.Cookies = append(out.Cookies, v9) out.Cookies = append(out.Cookies, v12)
in.WantComma() in.WantComma()
} }
in.Delim(']') in.Delim(']')
@ -947,14 +989,14 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork8(out *jwriter.Writer,
out.RawString("null") out.RawString("null")
} else { } else {
out.RawByte('[') out.RawByte('[')
for v10, v11 := range in.Cookies { for v13, v14 := range in.Cookies {
if v10 > 0 { if v13 > 0 {
out.RawByte(',') out.RawByte(',')
} }
if v11 == nil { if v14 == nil {
out.RawString("null") out.RawString("null")
} else { } else {
(*v11).MarshalEasyJSON(out) (*v14).MarshalEasyJSON(out)
} }
} }
out.RawByte(']') out.RawByte(']')
@ -1380,9 +1422,9 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork13(in *jlexer.Lexer, ou
out.Urls = (out.Urls)[:0] out.Urls = (out.Urls)[:0]
} }
for !in.IsDelim(']') { for !in.IsDelim(']') {
var v12 string var v15 string
v12 = string(in.String()) v15 = string(in.String())
out.Urls = append(out.Urls, v12) out.Urls = append(out.Urls, v15)
in.WantComma() in.WantComma()
} }
in.Delim(']') in.Delim(']')
@ -1410,11 +1452,11 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork13(out *jwriter.Writer,
out.RawString("null") out.RawString("null")
} else { } else {
out.RawByte('[') out.RawByte('[')
for v13, v14 := range in.Urls { for v16, v17 := range in.Urls {
if v13 > 0 { if v16 > 0 {
out.RawByte(',') out.RawByte(',')
} }
out.String(string(v14)) out.String(string(v17))
} }
out.RawByte(']') out.RawByte(']')
} }
@ -1493,9 +1535,9 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork14(in *jlexer.Lexer, ou
out.SanList = (out.SanList)[:0] out.SanList = (out.SanList)[:0]
} }
for !in.IsDelim(']') { for !in.IsDelim(']') {
var v15 string var v18 string
v15 = string(in.String()) v18 = string(in.String())
out.SanList = append(out.SanList, v15) out.SanList = append(out.SanList, v18)
in.WantComma() in.WantComma()
} }
in.Delim(']') in.Delim(']')
@ -1538,17 +1580,17 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork14(in *jlexer.Lexer, ou
out.SignedCertificateTimestampList = (out.SignedCertificateTimestampList)[:0] out.SignedCertificateTimestampList = (out.SignedCertificateTimestampList)[:0]
} }
for !in.IsDelim(']') { for !in.IsDelim(']') {
var v16 *SignedCertificateTimestamp var v19 *SignedCertificateTimestamp
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
v16 = nil v19 = nil
} else { } else {
if v16 == nil { if v19 == nil {
v16 = new(SignedCertificateTimestamp) v19 = new(SignedCertificateTimestamp)
} }
(*v16).UnmarshalEasyJSON(in) (*v19).UnmarshalEasyJSON(in)
} }
out.SignedCertificateTimestampList = append(out.SignedCertificateTimestampList, v16) out.SignedCertificateTimestampList = append(out.SignedCertificateTimestampList, v19)
in.WantComma() in.WantComma()
} }
in.Delim(']') in.Delim(']')
@ -1622,11 +1664,11 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork14(out *jwriter.Writer,
out.RawString("null") out.RawString("null")
} else { } else {
out.RawByte('[') out.RawByte('[')
for v17, v18 := range in.SanList { for v20, v21 := range in.SanList {
if v17 > 0 { if v20 > 0 {
out.RawByte(',') out.RawByte(',')
} }
out.String(string(v18)) out.String(string(v21))
} }
out.RawByte(']') out.RawByte(']')
} }
@ -1665,14 +1707,14 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork14(out *jwriter.Writer,
out.RawString("null") out.RawString("null")
} else { } else {
out.RawByte('[') out.RawByte('[')
for v19, v20 := range in.SignedCertificateTimestampList { for v22, v23 := range in.SignedCertificateTimestampList {
if v19 > 0 { if v22 > 0 {
out.RawByte(',') out.RawByte(',')
} }
if v20 == nil { if v23 == nil {
out.RawString("null") out.RawString("null")
} else { } else {
(*v20).MarshalEasyJSON(out) (*v23).MarshalEasyJSON(out)
} }
} }
out.RawByte(']') out.RawByte(']')
@ -1741,15 +1783,15 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork15(in *jlexer.Lexer, ou
for !in.IsDelim('}') { for !in.IsDelim('}') {
key := string(in.String()) key := string(in.String())
in.WantColon() in.WantColon()
var v21 interface{} var v24 interface{}
if m, ok := v21.(easyjson.Unmarshaler); ok { if m, ok := v24.(easyjson.Unmarshaler); ok {
m.UnmarshalEasyJSON(in) m.UnmarshalEasyJSON(in)
} else if m, ok := v21.(json.Unmarshaler); ok { } else if m, ok := v24.(json.Unmarshaler); ok {
_ = m.UnmarshalJSON(in.Raw()) _ = m.UnmarshalJSON(in.Raw())
} else { } else {
v21 = in.Interface() v24 = in.Interface()
} }
(out.Headers)[key] = v21 (out.Headers)[key] = v24
in.WantComma() in.WantComma()
} }
in.Delim('}') in.Delim('}')
@ -1771,15 +1813,15 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork15(in *jlexer.Lexer, ou
for !in.IsDelim('}') { for !in.IsDelim('}') {
key := string(in.String()) key := string(in.String())
in.WantColon() in.WantColon()
var v22 interface{} var v25 interface{}
if m, ok := v22.(easyjson.Unmarshaler); ok { if m, ok := v25.(easyjson.Unmarshaler); ok {
m.UnmarshalEasyJSON(in) m.UnmarshalEasyJSON(in)
} else if m, ok := v22.(json.Unmarshaler); ok { } else if m, ok := v25.(json.Unmarshaler); ok {
_ = m.UnmarshalJSON(in.Raw()) _ = m.UnmarshalJSON(in.Raw())
} else { } else {
v22 = in.Interface() v25 = in.Interface()
} }
(out.RequestHeaders)[key] = v22 (out.RequestHeaders)[key] = v25
in.WantComma() in.WantComma()
} }
in.Delim('}') in.Delim('}')
@ -1865,20 +1907,20 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork15(out *jwriter.Writer,
out.RawString(`null`) out.RawString(`null`)
} else { } else {
out.RawByte('{') out.RawByte('{')
v23First := true v26First := true
for v23Name, v23Value := range in.Headers { for v26Name, v26Value := range in.Headers {
if !v23First { if !v26First {
out.RawByte(',') out.RawByte(',')
} }
v23First = false v26First = false
out.String(string(v23Name)) out.String(string(v26Name))
out.RawByte(':') out.RawByte(':')
if m, ok := v23Value.(easyjson.Marshaler); ok { if m, ok := v26Value.(easyjson.Marshaler); ok {
m.MarshalEasyJSON(out) m.MarshalEasyJSON(out)
} else if m, ok := v23Value.(json.Marshaler); ok { } else if m, ok := v26Value.(json.Marshaler); ok {
out.Raw(m.MarshalJSON()) out.Raw(m.MarshalJSON())
} else { } else {
out.Raw(json.Marshal(v23Value)) out.Raw(json.Marshal(v26Value))
} }
} }
out.RawByte('}') out.RawByte('}')
@ -1907,20 +1949,20 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork15(out *jwriter.Writer,
out.RawString(`null`) out.RawString(`null`)
} else { } else {
out.RawByte('{') out.RawByte('{')
v24First := true v27First := true
for v24Name, v24Value := range in.RequestHeaders { for v27Name, v27Value := range in.RequestHeaders {
if !v24First { if !v27First {
out.RawByte(',') out.RawByte(',')
} }
v24First = false v27First = false
out.String(string(v24Name)) out.String(string(v27Name))
out.RawByte(':') out.RawByte(':')
if m, ok := v24Value.(easyjson.Marshaler); ok { if m, ok := v27Value.(easyjson.Marshaler); ok {
m.MarshalEasyJSON(out) m.MarshalEasyJSON(out)
} else if m, ok := v24Value.(json.Marshaler); ok { } else if m, ok := v27Value.(json.Marshaler); ok {
out.Raw(m.MarshalJSON()) out.Raw(m.MarshalJSON())
} else { } else {
out.Raw(json.Marshal(v24Value)) out.Raw(json.Marshal(v27Value))
} }
} }
out.RawByte('}') out.RawByte('}')
@ -2271,15 +2313,15 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork17(in *jlexer.Lexer, ou
for !in.IsDelim('}') { for !in.IsDelim('}') {
key := string(in.String()) key := string(in.String())
in.WantColon() in.WantColon()
var v25 interface{} var v28 interface{}
if m, ok := v25.(easyjson.Unmarshaler); ok { if m, ok := v28.(easyjson.Unmarshaler); ok {
m.UnmarshalEasyJSON(in) m.UnmarshalEasyJSON(in)
} else if m, ok := v25.(json.Unmarshaler); ok { } else if m, ok := v28.(json.Unmarshaler); ok {
_ = m.UnmarshalJSON(in.Raw()) _ = m.UnmarshalJSON(in.Raw())
} else { } else {
v25 = in.Interface() v28 = in.Interface()
} }
(out.Headers)[key] = v25 (out.Headers)[key] = v28
in.WantComma() in.WantComma()
} }
in.Delim('}') in.Delim('}')
@ -2329,20 +2371,20 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork17(out *jwriter.Writer,
out.RawString(`null`) out.RawString(`null`)
} else { } else {
out.RawByte('{') out.RawByte('{')
v26First := true v29First := true
for v26Name, v26Value := range in.Headers { for v29Name, v29Value := range in.Headers {
if !v26First { if !v29First {
out.RawByte(',') out.RawByte(',')
} }
v26First = false v29First = false
out.String(string(v26Name)) out.String(string(v29Name))
out.RawByte(':') out.RawByte(':')
if m, ok := v26Value.(easyjson.Marshaler); ok { if m, ok := v29Value.(easyjson.Marshaler); ok {
m.MarshalEasyJSON(out) m.MarshalEasyJSON(out)
} else if m, ok := v26Value.(json.Marshaler); ok { } else if m, ok := v29Value.(json.Marshaler); ok {
out.Raw(m.MarshalJSON()) out.Raw(m.MarshalJSON())
} else { } else {
out.Raw(json.Marshal(v26Value)) out.Raw(json.Marshal(v29Value))
} }
} }
out.RawByte('}') out.RawByte('}')
@ -2766,17 +2808,17 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork22(in *jlexer.Lexer, ou
out.Cookies = (out.Cookies)[:0] out.Cookies = (out.Cookies)[:0]
} }
for !in.IsDelim(']') { for !in.IsDelim(']') {
var v27 *Cookie var v30 *Cookie
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
v27 = nil v30 = nil
} else { } else {
if v27 == nil { if v30 == nil {
v27 = new(Cookie) v30 = new(Cookie)
} }
(*v27).UnmarshalEasyJSON(in) (*v30).UnmarshalEasyJSON(in)
} }
out.Cookies = append(out.Cookies, v27) out.Cookies = append(out.Cookies, v30)
in.WantComma() in.WantComma()
} }
in.Delim(']') in.Delim(']')
@ -2805,14 +2847,14 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork22(out *jwriter.Writer,
out.RawString("null") out.RawString("null")
} else { } else {
out.RawByte('[') out.RawByte('[')
for v28, v29 := range in.Cookies { for v31, v32 := range in.Cookies {
if v28 > 0 { if v31 > 0 {
out.RawByte(',') out.RawByte(',')
} }
if v29 == nil { if v32 == nil {
out.RawString("null") out.RawString("null")
} else { } else {
(*v29).MarshalEasyJSON(out) (*v32).MarshalEasyJSON(out)
} }
} }
out.RawByte(']') out.RawByte(']')
@ -2879,9 +2921,9 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork23(in *jlexer.Lexer, ou
out.Urls = (out.Urls)[:0] out.Urls = (out.Urls)[:0]
} }
for !in.IsDelim(']') { for !in.IsDelim(']') {
var v30 string var v33 string
v30 = string(in.String()) v33 = string(in.String())
out.Urls = append(out.Urls, v30) out.Urls = append(out.Urls, v33)
in.WantComma() in.WantComma()
} }
in.Delim(']') in.Delim(']')
@ -2910,11 +2952,11 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork23(out *jwriter.Writer,
out.RawString("null") out.RawString("null")
} else { } else {
out.RawByte('[') out.RawByte('[')
for v31, v32 := range in.Urls { for v34, v35 := range in.Urls {
if v31 > 0 { if v34 > 0 {
out.RawByte(',') out.RawByte(',')
} }
out.String(string(v32)) out.String(string(v35))
} }
out.RawByte(']') out.RawByte(']')
} }
@ -2980,9 +3022,9 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork24(in *jlexer.Lexer, ou
out.TableNames = (out.TableNames)[:0] out.TableNames = (out.TableNames)[:0]
} }
for !in.IsDelim(']') { for !in.IsDelim(']') {
var v33 string var v36 string
v33 = string(in.String()) v36 = string(in.String())
out.TableNames = append(out.TableNames, v33) out.TableNames = append(out.TableNames, v36)
in.WantComma() in.WantComma()
} }
in.Delim(']') in.Delim(']')
@ -3011,11 +3053,11 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork24(out *jwriter.Writer,
out.RawString("null") out.RawString("null")
} else { } else {
out.RawByte('[') out.RawByte('[')
for v34, v35 := range in.TableNames { for v37, v38 := range in.TableNames {
if v34 > 0 { if v37 > 0 {
out.RawByte(',') out.RawByte(',')
} }
out.String(string(v35)) out.String(string(v38))
} }
out.RawByte(']') out.RawByte(']')
} }
@ -3148,17 +3190,17 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork26(in *jlexer.Lexer, ou
out.Cookies = (out.Cookies)[:0] out.Cookies = (out.Cookies)[:0]
} }
for !in.IsDelim(']') { for !in.IsDelim(']') {
var v36 *Cookie var v39 *Cookie
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
v36 = nil v39 = nil
} else { } else {
if v36 == nil { if v39 == nil {
v36 = new(Cookie) v39 = new(Cookie)
} }
(*v36).UnmarshalEasyJSON(in) (*v39).UnmarshalEasyJSON(in)
} }
out.Cookies = append(out.Cookies, v36) out.Cookies = append(out.Cookies, v39)
in.WantComma() in.WantComma()
} }
in.Delim(']') in.Delim(']')
@ -3187,14 +3229,14 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork26(out *jwriter.Writer,
out.RawString("null") out.RawString("null")
} else { } else {
out.RawByte('[') out.RawByte('[')
for v37, v38 := range in.Cookies { for v40, v41 := range in.Cookies {
if v37 > 0 { if v40 > 0 {
out.RawByte(',') out.RawByte(',')
} }
if v38 == nil { if v41 == nil {
out.RawString("null") out.RawString("null")
} else { } else {
(*v38).MarshalEasyJSON(out) (*v41).MarshalEasyJSON(out)
} }
} }
out.RawByte(']') out.RawByte(']')
@ -4560,15 +4602,15 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork39(in *jlexer.Lexer, ou
for !in.IsDelim('}') { for !in.IsDelim('}') {
key := string(in.String()) key := string(in.String())
in.WantColon() in.WantColon()
var v39 interface{} var v42 interface{}
if m, ok := v39.(easyjson.Unmarshaler); ok { if m, ok := v42.(easyjson.Unmarshaler); ok {
m.UnmarshalEasyJSON(in) m.UnmarshalEasyJSON(in)
} else if m, ok := v39.(json.Unmarshaler); ok { } else if m, ok := v42.(json.Unmarshaler); ok {
_ = m.UnmarshalJSON(in.Raw()) _ = m.UnmarshalJSON(in.Raw())
} else { } else {
v39 = in.Interface() v42 = in.Interface()
} }
(out.RedirectHeaders)[key] = v39 (out.RedirectHeaders)[key] = v42
in.WantComma() in.WantComma()
} }
in.Delim('}') in.Delim('}')
@ -4639,20 +4681,20 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork39(out *jwriter.Writer,
out.RawString(`null`) out.RawString(`null`)
} else { } else {
out.RawByte('{') out.RawByte('{')
v40First := true v43First := true
for v40Name, v40Value := range in.RedirectHeaders { for v43Name, v43Value := range in.RedirectHeaders {
if !v40First { if !v43First {
out.RawByte(',') out.RawByte(',')
} }
v40First = false v43First = false
out.String(string(v40Name)) out.String(string(v43Name))
out.RawByte(':') out.RawByte(':')
if m, ok := v40Value.(easyjson.Marshaler); ok { if m, ok := v43Value.(easyjson.Marshaler); ok {
m.MarshalEasyJSON(out) m.MarshalEasyJSON(out)
} else if m, ok := v40Value.(json.Marshaler); ok { } else if m, ok := v43Value.(json.Marshaler); ok {
out.Raw(m.MarshalJSON()) out.Raw(m.MarshalJSON())
} else { } else {
out.Raw(json.Marshal(v40Value)) out.Raw(json.Marshal(v43Value))
} }
} }
out.RawByte('}') out.RawByte('}')
@ -5822,15 +5864,15 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork50(in *jlexer.Lexer, ou
for !in.IsDelim('}') { for !in.IsDelim('}') {
key := string(in.String()) key := string(in.String())
in.WantColon() in.WantColon()
var v41 interface{} var v44 interface{}
if m, ok := v41.(easyjson.Unmarshaler); ok { if m, ok := v44.(easyjson.Unmarshaler); ok {
m.UnmarshalEasyJSON(in) m.UnmarshalEasyJSON(in)
} else if m, ok := v41.(json.Unmarshaler); ok { } else if m, ok := v44.(json.Unmarshaler); ok {
_ = m.UnmarshalJSON(in.Raw()) _ = m.UnmarshalJSON(in.Raw())
} else { } else {
v41 = in.Interface() v44 = in.Interface()
} }
(out.Headers)[key] = v41 (out.Headers)[key] = v44
in.WantComma() in.WantComma()
} }
in.Delim('}') in.Delim('}')
@ -5915,20 +5957,20 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork50(out *jwriter.Writer,
out.RawString(`null`) out.RawString(`null`)
} else { } else {
out.RawByte('{') out.RawByte('{')
v42First := true v45First := true
for v42Name, v42Value := range in.Headers { for v45Name, v45Value := range in.Headers {
if !v42First { if !v45First {
out.RawByte(',') out.RawByte(',')
} }
v42First = false v45First = false
out.String(string(v42Name)) out.String(string(v45Name))
out.RawByte(':') out.RawByte(':')
if m, ok := v42Value.(easyjson.Marshaler); ok { if m, ok := v45Value.(easyjson.Marshaler); ok {
m.MarshalEasyJSON(out) m.MarshalEasyJSON(out)
} else if m, ok := v42Value.(json.Marshaler); ok { } else if m, ok := v45Value.(json.Marshaler); ok {
out.Raw(m.MarshalJSON()) out.Raw(m.MarshalJSON())
} else { } else {
out.Raw(json.Marshal(v42Value)) out.Raw(json.Marshal(v45Value))
} }
} }
out.RawByte('}') out.RawByte('}')

View File

@ -702,21 +702,33 @@ func (p *GetCertificateParams) Do(ctxt context.Context, h cdp.Handler) (tableNam
return res.TableNames, nil return res.TableNames, nil
} }
// SetRequestInterceptionEnabledParams [no description]. // SetRequestInterceptionEnabledParams sets the requests to intercept that
// match a the provided patterns.
type SetRequestInterceptionEnabledParams struct { type SetRequestInterceptionEnabledParams struct {
Enabled bool `json:"enabled"` // Whether or not HTTP requests should be intercepted and Network.requestIntercepted events sent. Enabled bool `json:"enabled"` // Whether requests should be intercepted. If patterns is not set, matches all and resets any previously set patterns. Other parameters are ignored if false.
Patterns []string `json:"patterns,omitempty"` // URLs matching any of these patterns will be forwarded and wait for the corresponding continueInterceptedRequest call. Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. If omitted equivalent to ['*'] (intercept all).
} }
// SetRequestInterceptionEnabled [no description]. // SetRequestInterceptionEnabled sets the requests to intercept that match a
// the provided patterns.
// //
// parameters: // parameters:
// enabled - Whether or not HTTP requests should be intercepted and Network.requestIntercepted events sent. // enabled - Whether requests should be intercepted. If patterns is not set, matches all and resets any previously set patterns. Other parameters are ignored if false.
func SetRequestInterceptionEnabled(enabled bool) *SetRequestInterceptionEnabledParams { func SetRequestInterceptionEnabled(enabled bool) *SetRequestInterceptionEnabledParams {
return &SetRequestInterceptionEnabledParams{ return &SetRequestInterceptionEnabledParams{
Enabled: enabled, Enabled: enabled,
} }
} }
// WithPatterns uRLs matching any of these patterns will be forwarded and
// wait for the corresponding continueInterceptedRequest call. Wildcards ('*' ->
// zero or more, '?' -> exactly one) are allowed. Escape character is backslash.
// If omitted equivalent to ['*'] (intercept all).
func (p SetRequestInterceptionEnabledParams) WithPatterns(patterns []string) *SetRequestInterceptionEnabledParams {
p.Patterns = patterns
return &p
}
// Do executes Network.setRequestInterceptionEnabled against the provided context and // Do executes Network.setRequestInterceptionEnabled against the provided context and
// target handler. // target handler.
func (p *SetRequestInterceptionEnabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) { func (p *SetRequestInterceptionEnabledParams) Do(ctxt context.Context, h cdp.Handler) (err error) {

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,13 @@ type EventLoadEventFired struct {
Timestamp *cdp.MonotonicTime `json:"timestamp"` Timestamp *cdp.MonotonicTime `json:"timestamp"`
} }
// EventLifecycleEvent fired for top level page lifecycle events such as
// navigation, load, paint, etc.
type EventLifecycleEvent struct {
Name string `json:"name"`
Timestamp *cdp.MonotonicTime `json:"timestamp"`
}
// EventFrameAttached fired when frame has been attached to its parent. // EventFrameAttached fired when frame has been attached to its parent.
type EventFrameAttached struct { type EventFrameAttached struct {
FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has been attached. FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has been attached.
@ -103,6 +110,7 @@ type EventInterstitialHidden struct{}
var EventTypes = []cdp.MethodType{ var EventTypes = []cdp.MethodType{
cdp.EventPageDomContentEventFired, cdp.EventPageDomContentEventFired,
cdp.EventPageLoadEventFired, cdp.EventPageLoadEventFired,
cdp.EventPageLifecycleEvent,
cdp.EventPageFrameAttached, cdp.EventPageFrameAttached,
cdp.EventPageFrameNavigated, cdp.EventPageFrameNavigated,
cdp.EventPageFrameDetached, cdp.EventPageFrameDetached,

View File

@ -922,3 +922,32 @@ func BringToFront() *BringToFrontParams {
func (p *BringToFrontParams) Do(ctxt context.Context, h cdp.Handler) (err error) { func (p *BringToFrontParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandPageBringToFront, nil, nil) return h.Execute(ctxt, cdp.CommandPageBringToFront, nil, nil)
} }
// SetDownloadBehaviorParams set the behavior when downloading a file.
type SetDownloadBehaviorParams struct {
Behavior SetDownloadBehaviorBehavior `json:"behavior"` // Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
DownloadPath string `json:"downloadPath,omitempty"` // The default path to save downloaded files to. This is required if behavior is set to 'allow'
}
// SetDownloadBehavior set the behavior when downloading a file.
//
// parameters:
// behavior - Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
func SetDownloadBehavior(behavior SetDownloadBehaviorBehavior) *SetDownloadBehaviorParams {
return &SetDownloadBehaviorParams{
Behavior: behavior,
}
}
// WithDownloadPath the default path to save downloaded files to. This is
// required if behavior is set to 'allow'.
func (p SetDownloadBehaviorParams) WithDownloadPath(downloadPath string) *SetDownloadBehaviorParams {
p.DownloadPath = downloadPath
return &p
}
// Do executes Page.setDownloadBehavior against the provided context and
// target handler.
func (p *SetDownloadBehaviorParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandPageSetDownloadBehavior, p, nil)
}

View File

@ -473,3 +473,49 @@ func (t *ScreencastFormat) UnmarshalEasyJSON(in *jlexer.Lexer) {
func (t *ScreencastFormat) UnmarshalJSON(buf []byte) error { func (t *ScreencastFormat) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t) return easyjson.Unmarshal(buf, t)
} }
// SetDownloadBehaviorBehavior whether to allow all or deny all download
// requests, or use default Chrome behavior if available (otherwise deny).
type SetDownloadBehaviorBehavior string
// String returns the SetDownloadBehaviorBehavior as string value.
func (t SetDownloadBehaviorBehavior) String() string {
return string(t)
}
// SetDownloadBehaviorBehavior values.
const (
SetDownloadBehaviorBehaviorDeny SetDownloadBehaviorBehavior = "deny"
SetDownloadBehaviorBehaviorAllow SetDownloadBehaviorBehavior = "allow"
SetDownloadBehaviorBehaviorDefault SetDownloadBehaviorBehavior = "default"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t SetDownloadBehaviorBehavior) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t SetDownloadBehaviorBehavior) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *SetDownloadBehaviorBehavior) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch SetDownloadBehaviorBehavior(in.String()) {
case SetDownloadBehaviorBehaviorDeny:
*t = SetDownloadBehaviorBehaviorDeny
case SetDownloadBehaviorBehaviorAllow:
*t = SetDownloadBehaviorBehaviorAllow
case SetDownloadBehaviorBehaviorDefault:
*t = SetDownloadBehaviorBehaviorDefault
default:
in.AddError(errors.New("unknown SetDownloadBehaviorBehavior value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *SetDownloadBehaviorBehavior) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}

View File

@ -411,6 +411,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpProfiler5(in *jlexer.Lexer, ou
switch key { switch key {
case "callCount": case "callCount":
out.CallCount = bool(in.Bool()) out.CallCount = bool(in.Bool())
case "detailed":
out.Detailed = bool(in.Bool())
default: default:
in.SkipRecursive() in.SkipRecursive()
} }
@ -433,6 +435,14 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpProfiler5(out *jwriter.Writer,
out.RawString("\"callCount\":") out.RawString("\"callCount\":")
out.Bool(bool(in.CallCount)) out.Bool(bool(in.CallCount))
} }
if in.Detailed {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"detailed\":")
out.Bool(bool(in.Detailed))
}
out.RawByte('}') out.RawByte('}')
} }

View File

@ -111,6 +111,7 @@ func (p *StopParams) Do(ctxt context.Context, h cdp.Handler) (profile *Profile,
// Enabling prevents running optimized code and resets execution counters. // Enabling prevents running optimized code and resets execution counters.
type StartPreciseCoverageParams struct { type StartPreciseCoverageParams struct {
CallCount bool `json:"callCount,omitempty"` // Collect accurate call counts beyond simple 'covered' or 'not covered'. CallCount bool `json:"callCount,omitempty"` // Collect accurate call counts beyond simple 'covered' or 'not covered'.
Detailed bool `json:"detailed,omitempty"` // Collect block-based coverage.
} }
// StartPreciseCoverage enable precise code coverage. Coverage data for // StartPreciseCoverage enable precise code coverage. Coverage data for
@ -129,6 +130,12 @@ func (p StartPreciseCoverageParams) WithCallCount(callCount bool) *StartPreciseC
return &p return &p
} }
// WithDetailed collect block-based coverage.
func (p StartPreciseCoverageParams) WithDetailed(detailed bool) *StartPreciseCoverageParams {
p.Detailed = detailed
return &p
}
// Do executes Profiler.startPreciseCoverage against the provided context and // Do executes Profiler.startPreciseCoverage against the provided context and
// target handler. // target handler.
func (p *StartPreciseCoverageParams) Do(ctxt context.Context, h cdp.Handler) (err error) { func (p *StartPreciseCoverageParams) Do(ctxt context.Context, h cdp.Handler) (err error) {

View File

@ -953,8 +953,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpRuntime9(in *jlexer.Lexer, out
continue continue
} }
switch key { switch key {
case "constructorObjectId": case "prototypeObjectId":
out.ConstructorObjectID = RemoteObjectID(in.String()) out.PrototypeObjectID = RemoteObjectID(in.String())
default: default:
in.SkipRecursive() in.SkipRecursive()
} }
@ -973,8 +973,8 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpRuntime9(out *jwriter.Writer,
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"constructorObjectId\":") out.RawString("\"prototypeObjectId\":")
out.String(string(in.ConstructorObjectID)) out.String(string(in.PrototypeObjectID))
out.RawByte('}') out.RawByte('}')
} }

View File

@ -606,16 +606,16 @@ func (p *RunScriptParams) Do(ctxt context.Context, h cdp.Handler) (result *Remot
// QueryObjectsParams [no description]. // QueryObjectsParams [no description].
type QueryObjectsParams struct { type QueryObjectsParams struct {
ConstructorObjectID RemoteObjectID `json:"constructorObjectId"` // Identifier of the constructor to return objects for. PrototypeObjectID RemoteObjectID `json:"prototypeObjectId"` // Identifier of the prototype to return objects for.
} }
// QueryObjects [no description]. // QueryObjects [no description].
// //
// parameters: // parameters:
// constructorObjectID - Identifier of the constructor to return objects for. // prototypeObjectID - Identifier of the prototype to return objects for.
func QueryObjects(constructorObjectID RemoteObjectID) *QueryObjectsParams { func QueryObjects(prototypeObjectID RemoteObjectID) *QueryObjectsParams {
return &QueryObjectsParams{ return &QueryObjectsParams{
ConstructorObjectID: constructorObjectID, PrototypeObjectID: prototypeObjectID,
} }
} }

View File

@ -149,7 +149,7 @@ type InternalPropertyDescriptor struct {
// objectId, primitive value, unserializable primitive value or neither of (for // objectId, primitive value, unserializable primitive value or neither of (for
// undefined) them should be specified. // undefined) them should be specified.
type CallArgument struct { type CallArgument struct {
Value easyjson.RawMessage `json:"value,omitempty"` // Primitive value. Value easyjson.RawMessage `json:"value,omitempty"` // Primitive value or serializable javascript object.
UnserializableValue UnserializableValue `json:"unserializableValue,omitempty"` // Primitive value which can not be JSON-stringified. UnserializableValue UnserializableValue `json:"unserializableValue,omitempty"` // Primitive value which can not be JSON-stringified.
ObjectID RemoteObjectID `json:"objectId,omitempty"` // Remote object handle. ObjectID RemoteObjectID `json:"objectId,omitempty"` // Remote object handle.
} }

View File

@ -77,7 +77,6 @@ const (
StateUnknown State = "unknown" StateUnknown State = "unknown"
StateNeutral State = "neutral" StateNeutral State = "neutral"
StateInsecure State = "insecure" StateInsecure State = "insecure"
StateWarning State = "warning"
StateSecure State = "secure" StateSecure State = "secure"
StateInfo State = "info" StateInfo State = "info"
) )
@ -101,8 +100,6 @@ func (t *State) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = StateNeutral *t = StateNeutral
case StateInsecure: case StateInsecure:
*t = StateInsecure *t = StateInsecure
case StateWarning:
*t = StateWarning
case StateSecure: case StateSecure:
*t = StateSecure *t = StateSecure
case StateInfo: case StateInfo:

View File

@ -68,6 +68,9 @@
} }
] ]
}, },
{
"name": "prepareForLeakDetection"
},
{ {
"name": "setPressureNotificationsSuppressed", "name": "setPressureNotificationsSuppressed",
"description": "Enable/disable suppressing memory pressure notifications in all processes.", "description": "Enable/disable suppressing memory pressure notifications in all processes.",
@ -1352,6 +1355,29 @@
{ {
"name": "bringToFront", "name": "bringToFront",
"description": "Brings page to front (activates tab)." "description": "Brings page to front (activates tab)."
},
{
"name": "setDownloadBehavior",
"description": "Set the behavior when downloading a file.",
"experimental": true,
"parameters": [
{
"name": "behavior",
"type": "string",
"enum": [
"deny",
"allow",
"default"
],
"description": "Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny)."
},
{
"name": "downloadPath",
"type": "string",
"optional": true,
"description": "The default path to save downloaded files to. This is requred if behavior is set to 'allow'"
}
]
} }
], ],
"events": [ "events": [
@ -1373,6 +1399,20 @@
} }
] ]
}, },
{
"name": "lifecycleEvent",
"parameters": [
{
"name": "name",
"type": "string"
},
{
"name": "timestamp",
"$ref": "Network.MonotonicTime"
}
],
"description": "Fired for top level page lifecycle events such as navigation, load, paint, etc."
},
{ {
"name": "frameAttached", "name": "frameAttached",
"description": "Fired when frame has been attached to its parent.", "description": "Fired when frame has been attached to its parent.",
@ -2295,7 +2335,6 @@
"unknown", "unknown",
"neutral", "neutral",
"insecure", "insecure",
"warning",
"secure", "secure",
"info" "info"
], ],
@ -3751,11 +3790,21 @@
}, },
{ {
"name": "setRequestInterceptionEnabled", "name": "setRequestInterceptionEnabled",
"description": "Sets the requests to intercept that match a the provided patterns.",
"parameters": [ "parameters": [
{ {
"name": "enabled", "name": "enabled",
"type": "boolean", "type": "boolean",
"description": "Whether or not HTTP requests should be intercepted and Network.requestIntercepted events sent." "description": "Whether requests should be intercepted. If patterns is not set, matches all and resets any previously set patterns. Other parameters are ignored if false."
},
{
"name": "patterns",
"type": "array",
"optional": true,
"items": {
"type": "string"
},
"description": "URLs matching any of these patterns will be forwarded and wait for the corresponding continueInterceptedRequest call. Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. If omitted equivalent to ['*'] (intercept all)."
} }
], ],
"experimental": true "experimental": true
@ -12033,7 +12082,7 @@
"name": "value", "name": "value",
"type": "any", "type": "any",
"optional": true, "optional": true,
"description": "Primitive value." "description": "Primitive value or serializable javascript object."
}, },
{ {
"name": "unserializableValue", "name": "unserializableValue",
@ -12608,9 +12657,9 @@
"name": "queryObjects", "name": "queryObjects",
"parameters": [ "parameters": [
{ {
"name": "constructorObjectId", "name": "prototypeObjectId",
"$ref": "RemoteObjectId", "$ref": "RemoteObjectId",
"description": "Identifier of the constructor to return objects for." "description": "Identifier of the prototype to return objects for."
} }
], ],
"returns": [ "returns": [
@ -14033,6 +14082,12 @@
"type": "boolean", "type": "boolean",
"optional": true, "optional": true,
"description": "Collect accurate call counts beyond simple 'covered' or 'not covered'." "description": "Collect accurate call counts beyond simple 'covered' or 'not covered'."
},
{
"name": "detailed",
"type": "boolean",
"optional": true,
"description": "Collect block-based coverage."
} }
], ],
"description": "Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters.", "description": "Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters.",