diff --git a/cdp/debugger/debugger.go b/cdp/debugger/debugger.go index 22c988b..62921a1 100644 --- a/cdp/debugger/debugger.go +++ b/cdp/debugger/debugger.go @@ -296,7 +296,8 @@ func (p *GetPossibleBreakpointsParams) Do(ctxt context.Context, h cdp.Handler) ( // ContinueToLocationParams continues execution until specific location is // reached. type ContinueToLocationParams struct { - Location *Location `json:"location"` // Location to continue to. + Location *Location `json:"location"` // Location to continue to. + TargetCallFrames ContinueToLocationTargetCallFrames `json:"targetCallFrames,omitempty"` } // ContinueToLocation continues execution until specific location is reached. @@ -309,6 +310,12 @@ func ContinueToLocation(location *Location) *ContinueToLocationParams { } } +// WithTargetCallFrames [no description]. +func (p ContinueToLocationParams) WithTargetCallFrames(targetCallFrames ContinueToLocationTargetCallFrames) *ContinueToLocationParams { + p.TargetCallFrames = targetCallFrames + return &p +} + // Do executes Debugger.continueToLocation against the provided context and // target handler. func (p *ContinueToLocationParams) Do(ctxt context.Context, h cdp.Handler) (err error) { diff --git a/cdp/debugger/easyjson.go b/cdp/debugger/easyjson.go index 2743aa3..bb4586a 100644 --- a/cdp/debugger/easyjson.go +++ b/cdp/debugger/easyjson.go @@ -4016,6 +4016,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpDebugger41(in *jlexer.Lexer, o } (*out.Location).UnmarshalEasyJSON(in) } + case "targetCallFrames": + (out.TargetCallFrames).UnmarshalEasyJSON(in) default: in.SkipRecursive() } @@ -4040,6 +4042,14 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpDebugger41(out *jwriter.Writer } else { (*in.Location).MarshalEasyJSON(out) } + if in.TargetCallFrames != "" { + if !first { + out.RawByte(',') + } + first = false + out.RawString("\"targetCallFrames\":") + (in.TargetCallFrames).MarshalEasyJSON(out) + } out.RawByte('}') } diff --git a/cdp/debugger/types.go b/cdp/debugger/types.go index 4720fbf..b8191a0 100644 --- a/cdp/debugger/types.go +++ b/cdp/debugger/types.go @@ -248,6 +248,48 @@ func (t *PausedReason) UnmarshalJSON(buf []byte) error { return easyjson.Unmarshal(buf, t) } +// ContinueToLocationTargetCallFrames [no description]. +type ContinueToLocationTargetCallFrames string + +// String returns the ContinueToLocationTargetCallFrames as string value. +func (t ContinueToLocationTargetCallFrames) String() string { + return string(t) +} + +// ContinueToLocationTargetCallFrames values. +const ( + ContinueToLocationTargetCallFramesAny ContinueToLocationTargetCallFrames = "any" + ContinueToLocationTargetCallFramesCurrent ContinueToLocationTargetCallFrames = "current" +) + +// MarshalEasyJSON satisfies easyjson.Marshaler. +func (t ContinueToLocationTargetCallFrames) MarshalEasyJSON(out *jwriter.Writer) { + out.String(string(t)) +} + +// MarshalJSON satisfies json.Marshaler. +func (t ContinueToLocationTargetCallFrames) MarshalJSON() ([]byte, error) { + return easyjson.Marshal(t) +} + +// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. +func (t *ContinueToLocationTargetCallFrames) UnmarshalEasyJSON(in *jlexer.Lexer) { + switch ContinueToLocationTargetCallFrames(in.String()) { + case ContinueToLocationTargetCallFramesAny: + *t = ContinueToLocationTargetCallFramesAny + case ContinueToLocationTargetCallFramesCurrent: + *t = ContinueToLocationTargetCallFramesCurrent + + default: + in.AddError(errors.New("unknown ContinueToLocationTargetCallFrames value")) + } +} + +// UnmarshalJSON satisfies json.Unmarshaler. +func (t *ContinueToLocationTargetCallFrames) UnmarshalJSON(buf []byte) error { + return easyjson.Unmarshal(buf, t) +} + // ExceptionsState pause on exceptions mode. type ExceptionsState string diff --git a/cdp/systeminfo/easyjson.go b/cdp/systeminfo/easyjson.go index 4906128..0664adf 100644 --- a/cdp/systeminfo/easyjson.go +++ b/cdp/systeminfo/easyjson.go @@ -50,6 +50,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSysteminfo(in *jlexer.Lexer, o out.ModelName = string(in.String()) case "modelVersion": out.ModelVersion = string(in.String()) + case "commandLine": + out.CommandLine = string(in.String()) default: in.SkipRecursive() } @@ -92,6 +94,14 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSysteminfo(out *jwriter.Writer out.RawString("\"modelVersion\":") out.String(string(in.ModelVersion)) } + if in.CommandLine != "" { + if !first { + out.RawByte(',') + } + first = false + out.RawString("\"commandLine\":") + out.String(string(in.CommandLine)) + } out.RawByte('}') } diff --git a/cdp/systeminfo/systeminfo.go b/cdp/systeminfo/systeminfo.go index b802460..41085e1 100644 --- a/cdp/systeminfo/systeminfo.go +++ b/cdp/systeminfo/systeminfo.go @@ -28,6 +28,7 @@ type GetInfoReturns struct { Gpu *GPUInfo `json:"gpu,omitempty"` // Information about the GPUs on the system. ModelName string `json:"modelName,omitempty"` // A platform-dependent description of the model of the machine. On Mac OS, this is, for example, 'MacBookPro'. Will be the empty string if not supported. ModelVersion string `json:"modelVersion,omitempty"` // A platform-dependent description of the version of the machine. On Mac OS, this is, for example, '10.1'. Will be the empty string if not supported. + CommandLine string `json:"commandLine,omitempty"` // The command line string used to launch the browser. Will be the empty string if not supported. } // Do executes SystemInfo.getInfo against the provided context and @@ -37,13 +38,14 @@ type GetInfoReturns struct { // gpu - Information about the GPUs on the system. // modelName - A platform-dependent description of the model of the machine. On Mac OS, this is, for example, 'MacBookPro'. Will be the empty string if not supported. // modelVersion - A platform-dependent description of the version of the machine. On Mac OS, this is, for example, '10.1'. Will be the empty string if not supported. -func (p *GetInfoParams) Do(ctxt context.Context, h cdp.Handler) (gpu *GPUInfo, modelName string, modelVersion string, err error) { +// commandLine - The command line string used to launch the browser. Will be the empty string if not supported. +func (p *GetInfoParams) Do(ctxt context.Context, h cdp.Handler) (gpu *GPUInfo, modelName string, modelVersion string, commandLine string, err error) { // execute var res GetInfoReturns err = h.Execute(ctxt, cdp.CommandSystemInfoGetInfo, nil, &res) if err != nil { - return nil, "", "", err + return nil, "", "", "", err } - return res.Gpu, res.ModelName, res.ModelVersion, nil + return res.Gpu, res.ModelName, res.ModelVersion, res.CommandLine, nil } diff --git a/cmd/chromedp-gen/protocol.json b/cmd/chromedp-gen/protocol.json index beb1782..b4361e3 100644 --- a/cmd/chromedp-gen/protocol.json +++ b/cmd/chromedp-gen/protocol.json @@ -10256,6 +10256,11 @@ "name": "modelVersion", "type": "string", "description": "A platform-dependent description of the version of the machine. On Mac OS, this is, for example, '10.1'. Will be the empty string if not supported." + }, + { + "name": "commandLine", + "type": "string", + "description": "The command line string used to launch the browser. Will be the empty string if not supported." } ] } @@ -11910,6 +11915,16 @@ "name": "location", "$ref": "Location", "description": "Location to continue to." + }, + { + "name": "targetCallFrames", + "type": "string", + "enum": [ + "any", + "current" + ], + "optional": true, + "experimental": true } ], "description": "Continues execution until specific location is reached."