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

View File

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

View File

@ -151,7 +151,66 @@ func (v *SetPressureNotificationsSuppressedParams) UnmarshalJSON(data []byte) er
func (v *SetPressureNotificationsSuppressedParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
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()
if in.IsNull() {
if isTopLevel {
@ -186,7 +245,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory2(in *jlexer.Lexer, out
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory2(out *jwriter.Writer, in GetDOMCountersReturns) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(out *jwriter.Writer, in GetDOMCountersReturns) {
out.RawByte('{')
first := true
_ = first
@ -220,27 +279,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory2(out *jwriter.Writer, i
// MarshalJSON supports json.Marshaler interface
func (v GetDOMCountersReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory2(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetDOMCountersReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory2(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetDOMCountersReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory2(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory3(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
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()
if in.IsNull() {
if isTopLevel {
@ -269,7 +328,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory3(in *jlexer.Lexer, out
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(out *jwriter.Writer, in GetDOMCountersParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory4(out *jwriter.Writer, in GetDOMCountersParams) {
out.RawByte('{')
first := true
_ = first
@ -279,23 +338,23 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(out *jwriter.Writer, i
// MarshalJSON supports json.Marshaler interface
func (v GetDOMCountersParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory4(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetDOMCountersParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory3(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpMemory4(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetDOMCountersParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory3(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpMemory4(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
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
}
// 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
// pressure notifications in all processes.
type SetPressureNotificationsSuppressedParams struct {

View File

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

View File

@ -702,21 +702,33 @@ func (p *GetCertificateParams) Do(ctxt context.Context, h cdp.Handler) (tableNam
return res.TableNames, nil
}
// SetRequestInterceptionEnabledParams [no description].
// SetRequestInterceptionEnabledParams sets the requests to intercept that
// match a the provided patterns.
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:
// 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 {
return &SetRequestInterceptionEnabledParams{
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
// target handler.
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"`
}
// 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.
type EventFrameAttached struct {
FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has been attached.
@ -103,6 +110,7 @@ type EventInterstitialHidden struct{}
var EventTypes = []cdp.MethodType{
cdp.EventPageDomContentEventFired,
cdp.EventPageLoadEventFired,
cdp.EventPageLifecycleEvent,
cdp.EventPageFrameAttached,
cdp.EventPageFrameNavigated,
cdp.EventPageFrameDetached,

View File

@ -922,3 +922,32 @@ func BringToFront() *BringToFrontParams {
func (p *BringToFrontParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
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 {
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 {
case "callCount":
out.CallCount = bool(in.Bool())
case "detailed":
out.Detailed = bool(in.Bool())
default:
in.SkipRecursive()
}
@ -433,6 +435,14 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpProfiler5(out *jwriter.Writer,
out.RawString("\"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('}')
}

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.
type StartPreciseCoverageParams struct {
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
@ -129,6 +130,12 @@ func (p StartPreciseCoverageParams) WithCallCount(callCount bool) *StartPreciseC
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
// target handler.
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
}
switch key {
case "constructorObjectId":
out.ConstructorObjectID = RemoteObjectID(in.String())
case "prototypeObjectId":
out.PrototypeObjectID = RemoteObjectID(in.String())
default:
in.SkipRecursive()
}
@ -973,8 +973,8 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpRuntime9(out *jwriter.Writer,
out.RawByte(',')
}
first = false
out.RawString("\"constructorObjectId\":")
out.String(string(in.ConstructorObjectID))
out.RawString("\"prototypeObjectId\":")
out.String(string(in.PrototypeObjectID))
out.RawByte('}')
}

View File

@ -606,16 +606,16 @@ func (p *RunScriptParams) Do(ctxt context.Context, h cdp.Handler) (result *Remot
// QueryObjectsParams [no description].
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].
//
// parameters:
// constructorObjectID - Identifier of the constructor to return objects for.
func QueryObjects(constructorObjectID RemoteObjectID) *QueryObjectsParams {
// prototypeObjectID - Identifier of the prototype to return objects for.
func QueryObjects(prototypeObjectID RemoteObjectID) *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
// undefined) them should be specified.
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.
ObjectID RemoteObjectID `json:"objectId,omitempty"` // Remote object handle.
}

View File

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

View File

@ -68,6 +68,9 @@
}
]
},
{
"name": "prepareForLeakDetection"
},
{
"name": "setPressureNotificationsSuppressed",
"description": "Enable/disable suppressing memory pressure notifications in all processes.",
@ -1352,6 +1355,29 @@
{
"name": "bringToFront",
"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": [
@ -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",
"description": "Fired when frame has been attached to its parent.",
@ -2295,7 +2335,6 @@
"unknown",
"neutral",
"insecure",
"warning",
"secure",
"info"
],
@ -3751,11 +3790,21 @@
},
{
"name": "setRequestInterceptionEnabled",
"description": "Sets the requests to intercept that match a the provided patterns.",
"parameters": [
{
"name": "enabled",
"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
@ -12033,7 +12082,7 @@
"name": "value",
"type": "any",
"optional": true,
"description": "Primitive value."
"description": "Primitive value or serializable javascript object."
},
{
"name": "unserializableValue",
@ -12608,9 +12657,9 @@
"name": "queryObjects",
"parameters": [
{
"name": "constructorObjectId",
"name": "prototypeObjectId",
"$ref": "RemoteObjectId",
"description": "Identifier of the constructor to return objects for."
"description": "Identifier of the prototype to return objects for."
}
],
"returns": [
@ -14033,6 +14082,12 @@
"type": "boolean",
"optional": true,
"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.",