Updating to latest protocol.json

This commit is contained in:
Kenneth Shaw 2017-11-28 09:41:21 +07:00
parent 4f13da10e7
commit df58ab5964
11 changed files with 993 additions and 796 deletions

View File

@ -422,7 +422,6 @@ const (
CommandBrowserGetVersion MethodType = "Browser.getVersion" CommandBrowserGetVersion MethodType = "Browser.getVersion"
CommandBrowserSetWindowBounds MethodType = "Browser.setWindowBounds" CommandBrowserSetWindowBounds MethodType = "Browser.setWindowBounds"
CommandBrowserGetWindowBounds MethodType = "Browser.getWindowBounds" CommandBrowserGetWindowBounds MethodType = "Browser.getWindowBounds"
CommandSchemaGetDomains MethodType = "Schema.getDomains"
EventRuntimeExecutionContextCreated MethodType = "Runtime.executionContextCreated" EventRuntimeExecutionContextCreated MethodType = "Runtime.executionContextCreated"
EventRuntimeExecutionContextDestroyed MethodType = "Runtime.executionContextDestroyed" EventRuntimeExecutionContextDestroyed MethodType = "Runtime.executionContextDestroyed"
EventRuntimeExecutionContextsCleared MethodType = "Runtime.executionContextsCleared" EventRuntimeExecutionContextsCleared MethodType = "Runtime.executionContextsCleared"
@ -459,13 +458,14 @@ const (
CommandDebuggerRemoveBreakpoint MethodType = "Debugger.removeBreakpoint" CommandDebuggerRemoveBreakpoint MethodType = "Debugger.removeBreakpoint"
CommandDebuggerGetPossibleBreakpoints MethodType = "Debugger.getPossibleBreakpoints" CommandDebuggerGetPossibleBreakpoints MethodType = "Debugger.getPossibleBreakpoints"
CommandDebuggerContinueToLocation MethodType = "Debugger.continueToLocation" CommandDebuggerContinueToLocation MethodType = "Debugger.continueToLocation"
CommandDebuggerPauseOnAsyncTask MethodType = "Debugger.pauseOnAsyncTask" CommandDebuggerPauseOnAsyncCall MethodType = "Debugger.pauseOnAsyncCall"
CommandDebuggerStepOver MethodType = "Debugger.stepOver" CommandDebuggerStepOver MethodType = "Debugger.stepOver"
CommandDebuggerStepInto MethodType = "Debugger.stepInto" CommandDebuggerStepInto MethodType = "Debugger.stepInto"
CommandDebuggerStepOut MethodType = "Debugger.stepOut" CommandDebuggerStepOut MethodType = "Debugger.stepOut"
CommandDebuggerPause MethodType = "Debugger.pause" CommandDebuggerPause MethodType = "Debugger.pause"
CommandDebuggerScheduleStepIntoAsync MethodType = "Debugger.scheduleStepIntoAsync" CommandDebuggerScheduleStepIntoAsync MethodType = "Debugger.scheduleStepIntoAsync"
CommandDebuggerResume MethodType = "Debugger.resume" CommandDebuggerResume MethodType = "Debugger.resume"
CommandDebuggerGetStackTrace MethodType = "Debugger.getStackTrace"
CommandDebuggerSearchInContent MethodType = "Debugger.searchInContent" CommandDebuggerSearchInContent MethodType = "Debugger.searchInContent"
CommandDebuggerSetScriptSource MethodType = "Debugger.setScriptSource" CommandDebuggerSetScriptSource MethodType = "Debugger.setScriptSource"
CommandDebuggerRestartFrame MethodType = "Debugger.restartFrame" CommandDebuggerRestartFrame MethodType = "Debugger.restartFrame"
@ -1269,8 +1269,6 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CommandBrowserSetWindowBounds *t = CommandBrowserSetWindowBounds
case CommandBrowserGetWindowBounds: case CommandBrowserGetWindowBounds:
*t = CommandBrowserGetWindowBounds *t = CommandBrowserGetWindowBounds
case CommandSchemaGetDomains:
*t = CommandSchemaGetDomains
case EventRuntimeExecutionContextCreated: case EventRuntimeExecutionContextCreated:
*t = EventRuntimeExecutionContextCreated *t = EventRuntimeExecutionContextCreated
case EventRuntimeExecutionContextDestroyed: case EventRuntimeExecutionContextDestroyed:
@ -1343,8 +1341,8 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CommandDebuggerGetPossibleBreakpoints *t = CommandDebuggerGetPossibleBreakpoints
case CommandDebuggerContinueToLocation: case CommandDebuggerContinueToLocation:
*t = CommandDebuggerContinueToLocation *t = CommandDebuggerContinueToLocation
case CommandDebuggerPauseOnAsyncTask: case CommandDebuggerPauseOnAsyncCall:
*t = CommandDebuggerPauseOnAsyncTask *t = CommandDebuggerPauseOnAsyncCall
case CommandDebuggerStepOver: case CommandDebuggerStepOver:
*t = CommandDebuggerStepOver *t = CommandDebuggerStepOver
case CommandDebuggerStepInto: case CommandDebuggerStepInto:
@ -1357,6 +1355,8 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CommandDebuggerScheduleStepIntoAsync *t = CommandDebuggerScheduleStepIntoAsync
case CommandDebuggerResume: case CommandDebuggerResume:
*t = CommandDebuggerResume *t = CommandDebuggerResume
case CommandDebuggerGetStackTrace:
*t = CommandDebuggerGetStackTrace
case CommandDebuggerSearchInContent: case CommandDebuggerSearchInContent:
*t = CommandDebuggerSearchInContent *t = CommandDebuggerSearchInContent
case CommandDebuggerSetScriptSource: case CommandDebuggerSetScriptSource:

View File

@ -34,7 +34,6 @@ import (
"github.com/knq/chromedp/cdp/performance" "github.com/knq/chromedp/cdp/performance"
"github.com/knq/chromedp/cdp/profiler" "github.com/knq/chromedp/cdp/profiler"
"github.com/knq/chromedp/cdp/runtime" "github.com/knq/chromedp/cdp/runtime"
"github.com/knq/chromedp/cdp/schema"
"github.com/knq/chromedp/cdp/security" "github.com/knq/chromedp/cdp/security"
"github.com/knq/chromedp/cdp/serviceworker" "github.com/knq/chromedp/cdp/serviceworker"
"github.com/knq/chromedp/cdp/storage" "github.com/knq/chromedp/cdp/storage"
@ -1172,9 +1171,6 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
case cdp.CommandBrowserGetWindowBounds: case cdp.CommandBrowserGetWindowBounds:
v = new(browser.GetWindowBoundsReturns) v = new(browser.GetWindowBoundsReturns)
case cdp.CommandSchemaGetDomains:
v = new(schema.GetDomainsReturns)
case cdp.CommandRuntimeEvaluate: case cdp.CommandRuntimeEvaluate:
v = new(runtime.EvaluateReturns) v = new(runtime.EvaluateReturns)
@ -1242,7 +1238,7 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
v = new(runtime.EventInspectRequested) v = new(runtime.EventInspectRequested)
case cdp.CommandDebuggerEnable: case cdp.CommandDebuggerEnable:
return emptyVal, nil v = new(debugger.EnableReturns)
case cdp.CommandDebuggerDisable: case cdp.CommandDebuggerDisable:
return emptyVal, nil return emptyVal, nil
@ -1268,7 +1264,7 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
case cdp.CommandDebuggerContinueToLocation: case cdp.CommandDebuggerContinueToLocation:
return emptyVal, nil return emptyVal, nil
case cdp.CommandDebuggerPauseOnAsyncTask: case cdp.CommandDebuggerPauseOnAsyncCall:
return emptyVal, nil return emptyVal, nil
case cdp.CommandDebuggerStepOver: case cdp.CommandDebuggerStepOver:
@ -1289,6 +1285,9 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
case cdp.CommandDebuggerResume: case cdp.CommandDebuggerResume:
return emptyVal, nil return emptyVal, nil
case cdp.CommandDebuggerGetStackTrace:
v = new(debugger.GetStackTraceReturns)
case cdp.CommandDebuggerSearchInContent: case cdp.CommandDebuggerSearchInContent:
v = new(debugger.SearchInContentReturns) v = new(debugger.SearchInContentReturns)

View File

@ -28,10 +28,25 @@ func Enable() *EnableParams {
return &EnableParams{} return &EnableParams{}
} }
// EnableReturns return values.
type EnableReturns struct {
DebuggerID runtime.UniqueDebuggerID `json:"debuggerId,omitempty"` // Unique identifier of the debugger.
}
// Do executes Debugger.enable against the provided context and // Do executes Debugger.enable against the provided context and
// target handler. // target handler.
func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) { //
return h.Execute(ctxt, cdp.CommandDebuggerEnable, nil, nil) // returns:
// debuggerID - Unique identifier of the debugger.
func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (debuggerID runtime.UniqueDebuggerID, err error) {
// execute
var res EnableReturns
err = h.Execute(ctxt, cdp.CommandDebuggerEnable, nil, &res)
if err != nil {
return "", err
}
return res.DebuggerID, nil
} }
// DisableParams disables debugger for given page. // DisableParams disables debugger for given page.
@ -329,25 +344,25 @@ func (p *ContinueToLocationParams) Do(ctxt context.Context, h cdp.Handler) (err
return h.Execute(ctxt, cdp.CommandDebuggerContinueToLocation, p, nil) return h.Execute(ctxt, cdp.CommandDebuggerContinueToLocation, p, nil)
} }
// PauseOnAsyncTaskParams [no description]. // PauseOnAsyncCallParams [no description].
type PauseOnAsyncTaskParams struct { type PauseOnAsyncCallParams struct {
AsyncTaskID runtime.AsyncTaskID `json:"asyncTaskId"` // Debugger will pause when given async task is started. ParentStackTraceID *runtime.StackTraceID `json:"parentStackTraceId"` // Debugger will pause when async call with given stack trace is started.
} }
// PauseOnAsyncTask [no description]. // PauseOnAsyncCall [no description].
// //
// parameters: // parameters:
// asyncTaskID - Debugger will pause when given async task is started. // parentStackTraceID - Debugger will pause when async call with given stack trace is started.
func PauseOnAsyncTask(asyncTaskID runtime.AsyncTaskID) *PauseOnAsyncTaskParams { func PauseOnAsyncCall(parentStackTraceID *runtime.StackTraceID) *PauseOnAsyncCallParams {
return &PauseOnAsyncTaskParams{ return &PauseOnAsyncCallParams{
AsyncTaskID: asyncTaskID, ParentStackTraceID: parentStackTraceID,
} }
} }
// Do executes Debugger.pauseOnAsyncTask against the provided context and // Do executes Debugger.pauseOnAsyncCall against the provided context and
// target handler. // target handler.
func (p *PauseOnAsyncTaskParams) Do(ctxt context.Context, h cdp.Handler) (err error) { func (p *PauseOnAsyncCallParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandDebuggerPauseOnAsyncTask, p, nil) return h.Execute(ctxt, cdp.CommandDebuggerPauseOnAsyncCall, p, nil)
} }
// StepOverParams steps over the statement. // StepOverParams steps over the statement.
@ -453,6 +468,42 @@ func (p *ResumeParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandDebuggerResume, nil, nil) return h.Execute(ctxt, cdp.CommandDebuggerResume, nil, nil)
} }
// GetStackTraceParams returns stack trace with given stackTraceId.
type GetStackTraceParams struct {
StackTraceID *runtime.StackTraceID `json:"stackTraceId"`
}
// GetStackTrace returns stack trace with given stackTraceId.
//
// parameters:
// stackTraceID
func GetStackTrace(stackTraceID *runtime.StackTraceID) *GetStackTraceParams {
return &GetStackTraceParams{
StackTraceID: stackTraceID,
}
}
// GetStackTraceReturns return values.
type GetStackTraceReturns struct {
StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"`
}
// Do executes Debugger.getStackTrace against the provided context and
// target handler.
//
// returns:
// stackTrace
func (p *GetStackTraceParams) Do(ctxt context.Context, h cdp.Handler) (stackTrace *runtime.StackTrace, err error) {
// execute
var res GetStackTraceReturns
err = h.Execute(ctxt, cdp.CommandDebuggerGetStackTrace, p, &res)
if err != nil {
return nil, err
}
return res.StackTrace, nil
}
// SearchInContentParams searches for given string in script content. // SearchInContentParams searches for given string in script content.
type SearchInContentParams struct { type SearchInContentParams struct {
ScriptID runtime.ScriptID `json:"scriptId"` // Id of the script to search in. ScriptID runtime.ScriptID `json:"scriptId"` // Id of the script to search in.
@ -537,6 +588,7 @@ type SetScriptSourceReturns struct {
CallFrames []*CallFrame `json:"callFrames,omitempty"` // New stack trace in case editing has happened while VM was stopped. CallFrames []*CallFrame `json:"callFrames,omitempty"` // New stack trace in case editing has happened while VM was stopped.
StackChanged bool `json:"stackChanged,omitempty"` // Whether current call stack was modified after applying the changes. StackChanged bool `json:"stackChanged,omitempty"` // Whether current call stack was modified after applying the changes.
AsyncStackTrace *runtime.StackTrace `json:"asyncStackTrace,omitempty"` // Async stack trace, if any. AsyncStackTrace *runtime.StackTrace `json:"asyncStackTrace,omitempty"` // Async stack trace, if any.
AsyncStackTraceID *runtime.StackTraceID `json:"asyncStackTraceId,omitempty"` // Async stack trace, if any.
ExceptionDetails *runtime.ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details if any. ExceptionDetails *runtime.ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details if any.
} }
@ -547,16 +599,17 @@ type SetScriptSourceReturns struct {
// callFrames - New stack trace in case editing has happened while VM was stopped. // callFrames - New stack trace in case editing has happened while VM was stopped.
// stackChanged - Whether current call stack was modified after applying the changes. // stackChanged - Whether current call stack was modified after applying the changes.
// asyncStackTrace - Async stack trace, if any. // asyncStackTrace - Async stack trace, if any.
// asyncStackTraceID - Async stack trace, if any.
// exceptionDetails - Exception details if any. // exceptionDetails - Exception details if any.
func (p *SetScriptSourceParams) Do(ctxt context.Context, h cdp.Handler) (callFrames []*CallFrame, stackChanged bool, asyncStackTrace *runtime.StackTrace, exceptionDetails *runtime.ExceptionDetails, err error) { func (p *SetScriptSourceParams) Do(ctxt context.Context, h cdp.Handler) (callFrames []*CallFrame, stackChanged bool, asyncStackTrace *runtime.StackTrace, asyncStackTraceID *runtime.StackTraceID, exceptionDetails *runtime.ExceptionDetails, err error) {
// execute // execute
var res SetScriptSourceReturns var res SetScriptSourceReturns
err = h.Execute(ctxt, cdp.CommandDebuggerSetScriptSource, p, &res) err = h.Execute(ctxt, cdp.CommandDebuggerSetScriptSource, p, &res)
if err != nil { if err != nil {
return nil, false, nil, nil, err return nil, false, nil, nil, nil, err
} }
return res.CallFrames, res.StackChanged, res.AsyncStackTrace, res.ExceptionDetails, nil return res.CallFrames, res.StackChanged, res.AsyncStackTrace, res.AsyncStackTraceID, res.ExceptionDetails, nil
} }
// RestartFrameParams restarts particular call frame from the beginning. // RestartFrameParams restarts particular call frame from the beginning.
@ -578,6 +631,7 @@ func RestartFrame(callFrameID CallFrameID) *RestartFrameParams {
type RestartFrameReturns struct { type RestartFrameReturns struct {
CallFrames []*CallFrame `json:"callFrames,omitempty"` // New stack trace. CallFrames []*CallFrame `json:"callFrames,omitempty"` // New stack trace.
AsyncStackTrace *runtime.StackTrace `json:"asyncStackTrace,omitempty"` // Async stack trace, if any. AsyncStackTrace *runtime.StackTrace `json:"asyncStackTrace,omitempty"` // Async stack trace, if any.
AsyncStackTraceID *runtime.StackTraceID `json:"asyncStackTraceId,omitempty"` // Async stack trace, if any.
} }
// Do executes Debugger.restartFrame against the provided context and // Do executes Debugger.restartFrame against the provided context and
@ -586,15 +640,16 @@ type RestartFrameReturns struct {
// returns: // returns:
// callFrames - New stack trace. // callFrames - New stack trace.
// asyncStackTrace - Async stack trace, if any. // asyncStackTrace - Async stack trace, if any.
func (p *RestartFrameParams) Do(ctxt context.Context, h cdp.Handler) (callFrames []*CallFrame, asyncStackTrace *runtime.StackTrace, err error) { // asyncStackTraceID - Async stack trace, if any.
func (p *RestartFrameParams) Do(ctxt context.Context, h cdp.Handler) (callFrames []*CallFrame, asyncStackTrace *runtime.StackTrace, asyncStackTraceID *runtime.StackTraceID, err error) {
// execute // execute
var res RestartFrameReturns var res RestartFrameReturns
err = h.Execute(ctxt, cdp.CommandDebuggerRestartFrame, p, &res) err = h.Execute(ctxt, cdp.CommandDebuggerRestartFrame, p, &res)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, nil, err
} }
return res.CallFrames, res.AsyncStackTrace, nil return res.CallFrames, res.AsyncStackTrace, res.AsyncStackTraceID, nil
} }
// GetScriptSourceParams returns source for the script with given id. // GetScriptSourceParams returns source for the script with given id.

File diff suppressed because it is too large Load Diff

View File

@ -62,7 +62,8 @@ type EventPaused struct {
Data easyjson.RawMessage `json:"data,omitempty"` Data easyjson.RawMessage `json:"data,omitempty"`
HitBreakpoints []string `json:"hitBreakpoints,omitempty"` // Hit breakpoints IDs HitBreakpoints []string `json:"hitBreakpoints,omitempty"` // Hit breakpoints IDs
AsyncStackTrace *runtime.StackTrace `json:"asyncStackTrace,omitempty"` // Async stack trace, if any. AsyncStackTrace *runtime.StackTrace `json:"asyncStackTrace,omitempty"` // Async stack trace, if any.
ScheduledAsyncTaskID runtime.AsyncTaskID `json:"scheduledAsyncTaskId,omitempty"` // Scheduled async task id. AsyncStackTraceID *runtime.StackTraceID `json:"asyncStackTraceId,omitempty"` // Async stack trace, if any.
AsyncCallStackTraceID *runtime.StackTraceID `json:"asyncCallStackTraceId,omitempty"` // Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag.
} }
// EventResumed fired when the virtual machine resumed execution. // EventResumed fired when the virtual machine resumed execution.

File diff suppressed because it is too large Load Diff

View File

@ -236,16 +236,25 @@ type StackTrace struct {
Description string `json:"description,omitempty"` // String label of this stack trace. For async traces this may be a name of the function that initiated the async call. Description string `json:"description,omitempty"` // String label of this stack trace. For async traces this may be a name of the function that initiated the async call.
CallFrames []*CallFrame `json:"callFrames"` // JavaScript function name. CallFrames []*CallFrame `json:"callFrames"` // JavaScript function name.
Parent *StackTrace `json:"parent,omitempty"` // Asynchronous JavaScript stack trace that preceded this stack, if available. Parent *StackTrace `json:"parent,omitempty"` // Asynchronous JavaScript stack trace that preceded this stack, if available.
ParentID *StackTraceID `json:"parentId,omitempty"` // Asynchronous JavaScript stack trace that preceded this stack, if available.
} }
// AsyncTaskID [no description]. // UniqueDebuggerID unique identifier of current debugger.
type AsyncTaskID string type UniqueDebuggerID string
// String returns the AsyncTaskID as string value. // String returns the UniqueDebuggerID as string value.
func (t AsyncTaskID) String() string { func (t UniqueDebuggerID) String() string {
return string(t) return string(t)
} }
// StackTraceID if debuggerId is set stack trace comes from another debugger
// and can be resolved there. This allows to track cross-debugger calls. See
// Runtime.StackTrace and Debugger.paused for usages.
type StackTraceID struct {
ID string `json:"id"`
DebuggerID UniqueDebuggerID `json:"debuggerId,omitempty"`
}
// Type object type. // Type object type.
type Type string type Type string

View File

@ -1,274 +0,0 @@
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
package schema
import (
json "encoding/json"
easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
)
// suppress unused package warning
var (
_ *json.RawMessage
_ *jlexer.Lexer
_ *jwriter.Writer
_ easyjson.Marshaler
)
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema(in *jlexer.Lexer, out *GetDomainsReturns) {
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 {
case "domains":
if in.IsNull() {
in.Skip()
out.Domains = nil
} else {
in.Delim('[')
if out.Domains == nil {
if !in.IsDelim(']') {
out.Domains = make([]*Domain, 0, 8)
} else {
out.Domains = []*Domain{}
}
} else {
out.Domains = (out.Domains)[:0]
}
for !in.IsDelim(']') {
var v1 *Domain
if in.IsNull() {
in.Skip()
v1 = nil
} else {
if v1 == nil {
v1 = new(Domain)
}
(*v1).UnmarshalEasyJSON(in)
}
out.Domains = append(out.Domains, v1)
in.WantComma()
}
in.Delim(']')
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema(out *jwriter.Writer, in GetDomainsReturns) {
out.RawByte('{')
first := true
_ = first
if len(in.Domains) != 0 {
const prefix string = ",\"domains\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
{
out.RawByte('[')
for v2, v3 := range in.Domains {
if v2 > 0 {
out.RawByte(',')
}
if v3 == nil {
out.RawString("null")
} else {
(*v3).MarshalEasyJSON(out)
}
}
out.RawByte(']')
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v GetDomainsReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetDomainsReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetDomainsReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetDomainsReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema1(in *jlexer.Lexer, out *GetDomainsParams) {
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 easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema1(out *jwriter.Writer, in GetDomainsParams) {
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v GetDomainsParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetDomainsParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema1(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetDomainsParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema1(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetDomainsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema1(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema2(in *jlexer.Lexer, out *Domain) {
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 {
case "name":
out.Name = string(in.String())
case "version":
out.Version = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema2(out *jwriter.Writer, in Domain) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"name\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.String(string(in.Name))
}
{
const prefix string = ",\"version\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.String(string(in.Version))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v Domain) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema2(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Domain) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSchema2(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *Domain) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema2(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Domain) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSchema2(l, v)
}

View File

@ -1,44 +0,0 @@
// Package schema provides the Chrome Debugging Protocol
// commands, types, and events for the Schema domain.
//
// Provides information about the protocol schema.
//
// Generated by the chromedp-gen command.
package schema
// Code generated by chromedp-gen. DO NOT EDIT.
import (
"context"
cdp "github.com/knq/chromedp/cdp"
)
// GetDomainsParams returns supported domains.
type GetDomainsParams struct{}
// GetDomains returns supported domains.
func GetDomains() *GetDomainsParams {
return &GetDomainsParams{}
}
// GetDomainsReturns return values.
type GetDomainsReturns struct {
Domains []*Domain `json:"domains,omitempty"` // List of supported domains.
}
// Do executes Schema.getDomains against the provided context and
// target handler.
//
// returns:
// domains - List of supported domains.
func (p *GetDomainsParams) Do(ctxt context.Context, h cdp.Handler) (domains []*Domain, err error) {
// execute
var res GetDomainsReturns
err = h.Execute(ctxt, cdp.CommandSchemaGetDomains, nil, &res)
if err != nil {
return nil, err
}
return res.Domains, nil
}

View File

@ -1,9 +0,0 @@
package schema
// Code generated by chromedp-gen. DO NOT EDIT.
// Domain description of the protocol domain.
type Domain struct {
Name string `json:"name"` // Domain name.
Version string `json:"version"` // Domain version.
}

View File

@ -12027,7 +12027,8 @@
}, },
{ {
"domain": "Schema", "domain": "Schema",
"description": "Provides information about the protocol schema.", "description": "This domain is deprecated.",
"deprecated": true,
"types": [ "types": [
{ {
"id": "Domain", "id": "Domain",
@ -12613,12 +12614,37 @@
"$ref": "StackTrace", "$ref": "StackTrace",
"optional": true, "optional": true,
"description": "Asynchronous JavaScript stack trace that preceded this stack, if available." "description": "Asynchronous JavaScript stack trace that preceded this stack, if available."
},
{
"name": "parentId",
"$ref": "StackTraceId",
"optional": true,
"experimental": true,
"description": "Asynchronous JavaScript stack trace that preceded this stack, if available."
} }
] ]
}, },
{ {
"id": "AsyncTaskId", "id": "UniqueDebuggerId",
"type": "string", "type": "string",
"description": "Unique identifier of current debugger.",
"experimental": true
},
{
"id": "StackTraceId",
"type": "object",
"description": "If <code>debuggerId</code> is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See <code>Runtime.StackTrace</code> and <code>Debugger.paused</code> for usages.",
"properties": [
{
"name": "id",
"type": "string"
},
{
"name": "debuggerId",
"$ref": "UniqueDebuggerId",
"optional": true
}
],
"experimental": true "experimental": true
} }
], ],
@ -12672,7 +12698,6 @@
"name": "userGesture", "name": "userGesture",
"type": "boolean", "type": "boolean",
"optional": true, "optional": true,
"experimental": true,
"description": "Whether execution should be treated as initiated by user in the UI." "description": "Whether execution should be treated as initiated by user in the UI."
}, },
{ {
@ -12780,7 +12805,6 @@
"name": "userGesture", "name": "userGesture",
"type": "boolean", "type": "boolean",
"optional": true, "optional": true,
"experimental": true,
"description": "Whether execution should be treated as initiated by user in the UI." "description": "Whether execution should be treated as initiated by user in the UI."
}, },
{ {
@ -13043,8 +13067,7 @@
"$ref": "RemoteObject", "$ref": "RemoteObject",
"description": "Array with objects." "description": "Array with objects."
} }
], ]
"experimental": true
}, },
{ {
"name": "globalLexicalScopeNames", "name": "globalLexicalScopeNames",
@ -13065,8 +13088,7 @@
} }
} }
], ],
"description": "Returns all let, const and class variables from global scope.", "description": "Returns all let, const and class variables from global scope."
"experimental": true
} }
], ],
"events": [ "events": [
@ -13279,7 +13301,6 @@
"name": "functionLocation", "name": "functionLocation",
"$ref": "Location", "$ref": "Location",
"optional": true, "optional": true,
"experimental": true,
"description": "Location in the source code." "description": "Location in the source code."
}, },
{ {
@ -13374,8 +13395,7 @@
"type": "string", "type": "string",
"description": "Line with match content." "description": "Line with match content."
} }
], ]
"experimental": true
}, },
{ {
"id": "BreakLocation", "id": "BreakLocation",
@ -13407,13 +13427,20 @@
], ],
"optional": true "optional": true
} }
], ]
"experimental": true
} }
], ],
"commands": [ "commands": [
{ {
"name": "enable", "name": "enable",
"returns": [
{
"name": "debuggerId",
"$ref": "Runtime.UniqueDebuggerId",
"experimental": true,
"description": "Unique identifier of the debugger."
}
],
"description": "Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received." "description": "Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received."
}, },
{ {
@ -13466,7 +13493,6 @@
"name": "scriptHash", "name": "scriptHash",
"type": "string", "type": "string",
"optional": true, "optional": true,
"experimental": true,
"description": "Script hash of the resources to set breakpoint on." "description": "Script hash of the resources to set breakpoint on."
}, },
{ {
@ -13569,8 +13595,7 @@
"description": "List of the possible breakpoint locations." "description": "List of the possible breakpoint locations."
} }
], ],
"description": "Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.", "description": "Returns possible locations for breakpoint. scriptId in start and end range locations should be the same."
"experimental": true
}, },
{ {
"name": "continueToLocation", "name": "continueToLocation",
@ -13587,19 +13612,18 @@
"any", "any",
"current" "current"
], ],
"optional": true, "optional": true
"experimental": true
} }
], ],
"description": "Continues execution until specific location is reached." "description": "Continues execution until specific location is reached."
}, },
{ {
"name": "pauseOnAsyncTask", "name": "pauseOnAsyncCall",
"parameters": [ "parameters": [
{ {
"name": "asyncTaskId", "name": "parentStackTraceId",
"$ref": "Runtime.AsyncTaskId", "$ref": "Runtime.StackTraceId",
"description": "Debugger will pause when given async task is started." "description": "Debugger will pause when async call with given stack trace is started."
} }
], ],
"experimental": true "experimental": true
@ -13638,6 +13662,23 @@
"name": "resume", "name": "resume",
"description": "Resumes JavaScript execution." "description": "Resumes JavaScript execution."
}, },
{
"name": "getStackTrace",
"parameters": [
{
"name": "stackTraceId",
"$ref": "Runtime.StackTraceId"
}
],
"returns": [
{
"name": "stackTrace",
"$ref": "Runtime.StackTrace"
}
],
"description": "Returns stack trace with given <code>stackTraceId</code>.",
"experimental": true
},
{ {
"name": "searchInContent", "name": "searchInContent",
"parameters": [ "parameters": [
@ -13674,7 +13715,6 @@
"description": "List of search matches." "description": "List of search matches."
} }
], ],
"experimental": true,
"description": "Searches for given string in script content." "description": "Searches for given string in script content."
}, },
{ {
@ -13719,6 +13759,13 @@
"optional": true, "optional": true,
"description": "Async stack trace, if any." "description": "Async stack trace, if any."
}, },
{
"name": "asyncStackTraceId",
"$ref": "Runtime.StackTraceId",
"optional": true,
"experimental": true,
"description": "Async stack trace, if any."
},
{ {
"name": "exceptionDetails", "name": "exceptionDetails",
"optional": true, "optional": true,
@ -13751,6 +13798,13 @@
"$ref": "Runtime.StackTrace", "$ref": "Runtime.StackTrace",
"optional": true, "optional": true,
"description": "Async stack trace, if any." "description": "Async stack trace, if any."
},
{
"name": "asyncStackTraceId",
"$ref": "Runtime.StackTraceId",
"optional": true,
"experimental": true,
"description": "Async stack trace, if any."
} }
], ],
"description": "Restarts particular call frame from the beginning." "description": "Restarts particular call frame from the beginning."
@ -13837,7 +13891,6 @@
"name": "throwOnSideEffect", "name": "throwOnSideEffect",
"type": "boolean", "type": "boolean",
"optional": true, "optional": true,
"experimental": true,
"description": "Whether to throw an exception if side effect cannot be ruled out during evaluation." "description": "Whether to throw an exception if side effect cannot be ruled out during evaluation."
} }
], ],
@ -14007,22 +14060,19 @@
"name": "hasSourceURL", "name": "hasSourceURL",
"type": "boolean", "type": "boolean",
"optional": true, "optional": true,
"description": "True, if this script has sourceURL.", "description": "True, if this script has sourceURL."
"experimental": true
}, },
{ {
"name": "isModule", "name": "isModule",
"type": "boolean", "type": "boolean",
"optional": true, "optional": true,
"description": "True, if this script is ES6 module.", "description": "True, if this script is ES6 module."
"experimental": true
}, },
{ {
"name": "length", "name": "length",
"type": "integer", "type": "integer",
"optional": true, "optional": true,
"description": "This script length.", "description": "This script length."
"experimental": true
}, },
{ {
"name": "stackTrace", "name": "stackTrace",
@ -14093,22 +14143,19 @@
"name": "hasSourceURL", "name": "hasSourceURL",
"type": "boolean", "type": "boolean",
"optional": true, "optional": true,
"description": "True, if this script has sourceURL.", "description": "True, if this script has sourceURL."
"experimental": true
}, },
{ {
"name": "isModule", "name": "isModule",
"type": "boolean", "type": "boolean",
"optional": true, "optional": true,
"description": "True, if this script is ES6 module.", "description": "True, if this script is ES6 module."
"experimental": true
}, },
{ {
"name": "length", "name": "length",
"type": "integer", "type": "integer",
"optional": true, "optional": true,
"description": "This script length.", "description": "This script length."
"experimental": true
}, },
{ {
"name": "stackTrace", "name": "stackTrace",
@ -14186,11 +14233,18 @@
"description": "Async stack trace, if any." "description": "Async stack trace, if any."
}, },
{ {
"name": "scheduledAsyncTaskId", "name": "asyncStackTraceId",
"$ref": "Runtime.AsyncTaskId", "$ref": "Runtime.StackTraceId",
"optional": true, "optional": true,
"experimental": true, "experimental": true,
"description": "Scheduled async task id." "description": "Async stack trace, if any."
},
{
"name": "asyncCallStackTraceId",
"$ref": "Runtime.StackTraceId",
"optional": true,
"experimental": true,
"description": "Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after <code>Debugger.stepInto</code> call with <code>breakOnAsynCall</code> flag."
} }
], ],
"description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria." "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria."
@ -14324,7 +14378,6 @@
"name": "hitCount", "name": "hitCount",
"type": "integer", "type": "integer",
"optional": true, "optional": true,
"experimental": true,
"description": "Number of samples where this node was on top of the call stack." "description": "Number of samples where this node was on top of the call stack."
}, },
{ {
@ -14349,7 +14402,6 @@
"$ref": "PositionTickInfo" "$ref": "PositionTickInfo"
}, },
"optional": true, "optional": true,
"experimental": true,
"description": "An array of source position ticks." "description": "An array of source position ticks."
} }
] ]
@ -14400,7 +14452,6 @@
{ {
"id": "PositionTickInfo", "id": "PositionTickInfo",
"type": "object", "type": "object",
"experimental": true,
"description": "Specifies a number of samples attributed to a certain source position.", "description": "Specifies a number of samples attributed to a certain source position.",
"properties": [ "properties": [
{ {
@ -14435,8 +14486,7 @@
"type": "integer", "type": "integer",
"description": "Collected execution count of the source range." "description": "Collected execution count of the source range."
} }
], ]
"experimental": true
}, },
{ {
"id": "FunctionCoverage", "id": "FunctionCoverage",
@ -14461,8 +14511,7 @@
"type": "boolean", "type": "boolean",
"description": "Whether coverage data for this function has block granularity." "description": "Whether coverage data for this function has block granularity."
} }
], ]
"experimental": true
}, },
{ {
"id": "ScriptCoverage", "id": "ScriptCoverage",
@ -14487,8 +14536,7 @@
}, },
"description": "Functions contained in the script that has coverage data." "description": "Functions contained in the script that has coverage data."
} }
], ]
"experimental": true
}, },
{ {
"id": "TypeObject", "id": "TypeObject",
@ -14598,13 +14646,11 @@
"description": "Collect block-based coverage." "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."
"experimental": true
}, },
{ {
"name": "stopPreciseCoverage", "name": "stopPreciseCoverage",
"description": "Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.", "description": "Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code."
"experimental": true
}, },
{ {
"name": "takePreciseCoverage", "name": "takePreciseCoverage",
@ -14618,8 +14664,7 @@
"description": "Coverage data for the current isolate." "description": "Coverage data for the current isolate."
} }
], ],
"description": "Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.", "description": "Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started."
"experimental": true
}, },
{ {
"name": "getBestEffortCoverage", "name": "getBestEffortCoverage",
@ -14633,8 +14678,7 @@
"description": "Coverage data for the current isolate." "description": "Coverage data for the current isolate."
} }
], ],
"description": "Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.", "description": "Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection."
"experimental": true
}, },
{ {
"name": "startTypeProfile", "name": "startTypeProfile",