Updating to latest protocol.json

This commit is contained in:
Kenneth Shaw 2017-07-13 07:28:14 +07:00
parent 2dda4650cf
commit 7615cdd4e5
10 changed files with 713 additions and 865 deletions

View File

@ -120,11 +120,8 @@ const (
EventEmulationVirtualTimeBudgetExpired MethodType = "Emulation.virtualTimeBudgetExpired"
CommandEmulationSetDeviceMetricsOverride MethodType = "Emulation.setDeviceMetricsOverride"
CommandEmulationClearDeviceMetricsOverride MethodType = "Emulation.clearDeviceMetricsOverride"
CommandEmulationForceViewport MethodType = "Emulation.forceViewport"
CommandEmulationResetViewport MethodType = "Emulation.resetViewport"
CommandEmulationResetPageScaleFactor MethodType = "Emulation.resetPageScaleFactor"
CommandEmulationSetPageScaleFactor MethodType = "Emulation.setPageScaleFactor"
CommandEmulationSetVisibleSize MethodType = "Emulation.setVisibleSize"
CommandEmulationSetScriptExecutionDisabled MethodType = "Emulation.setScriptExecutionDisabled"
CommandEmulationSetGeolocationOverride MethodType = "Emulation.setGeolocationOverride"
CommandEmulationClearGeolocationOverride MethodType = "Emulation.clearGeolocationOverride"
@ -627,16 +624,10 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CommandEmulationSetDeviceMetricsOverride
case CommandEmulationClearDeviceMetricsOverride:
*t = CommandEmulationClearDeviceMetricsOverride
case CommandEmulationForceViewport:
*t = CommandEmulationForceViewport
case CommandEmulationResetViewport:
*t = CommandEmulationResetViewport
case CommandEmulationResetPageScaleFactor:
*t = CommandEmulationResetPageScaleFactor
case CommandEmulationSetPageScaleFactor:
*t = CommandEmulationSetPageScaleFactor
case CommandEmulationSetVisibleSize:
*t = CommandEmulationSetVisibleSize
case CommandEmulationSetScriptExecutionDisabled:
*t = CommandEmulationSetScriptExecutionDisabled
case CommandEmulationSetGeolocationOverride:

View File

@ -260,21 +260,12 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
case cdp.CommandEmulationClearDeviceMetricsOverride:
return emptyVal, nil
case cdp.CommandEmulationForceViewport:
return emptyVal, nil
case cdp.CommandEmulationResetViewport:
return emptyVal, nil
case cdp.CommandEmulationResetPageScaleFactor:
return emptyVal, nil
case cdp.CommandEmulationSetPageScaleFactor:
return emptyVal, nil
case cdp.CommandEmulationSetVisibleSize:
return emptyVal, nil
case cdp.CommandEmulationSetScriptExecutionDisabled:
return emptyVal, nil

View File

@ -18,82 +18,7 @@ var (
_ easyjson.Marshaler
)
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation(in *jlexer.Lexer, out *SetVisibleSizeParams) {
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 "width":
out.Width = int64(in.Int64())
case "height":
out.Height = int64(in.Int64())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation(out *jwriter.Writer, in SetVisibleSizeParams) {
out.RawByte('{')
first := true
_ = first
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"width\":")
out.Int64(int64(in.Width))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"height\":")
out.Int64(int64(in.Height))
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v SetVisibleSizeParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetVisibleSizeParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetVisibleSizeParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetVisibleSizeParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation1(in *jlexer.Lexer, out *SetVirtualTimePolicyParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation(in *jlexer.Lexer, out *SetVirtualTimePolicyParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -126,7 +51,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation1(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation1(out *jwriter.Writer, in SetVirtualTimePolicyParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation(out *jwriter.Writer, in SetVirtualTimePolicyParams) {
out.RawByte('{')
first := true
_ = first
@ -150,27 +75,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation1(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v SetVirtualTimePolicyParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation1(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetVirtualTimePolicyParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation1(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetVirtualTimePolicyParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation1(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetVirtualTimePolicyParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation1(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation2(in *jlexer.Lexer, out *SetTouchEmulationEnabledParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation1(in *jlexer.Lexer, out *SetTouchEmulationEnabledParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -203,7 +128,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation2(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation2(out *jwriter.Writer, in SetTouchEmulationEnabledParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation1(out *jwriter.Writer, in SetTouchEmulationEnabledParams) {
out.RawByte('{')
first := true
_ = first
@ -227,27 +152,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation2(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v SetTouchEmulationEnabledParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation2(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetTouchEmulationEnabledParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation2(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation1(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetTouchEmulationEnabledParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation2(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation1(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetTouchEmulationEnabledParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation2(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation1(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation3(in *jlexer.Lexer, out *SetScriptExecutionDisabledParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation2(in *jlexer.Lexer, out *SetScriptExecutionDisabledParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -278,7 +203,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation3(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation3(out *jwriter.Writer, in SetScriptExecutionDisabledParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation2(out *jwriter.Writer, in SetScriptExecutionDisabledParams) {
out.RawByte('{')
first := true
_ = first
@ -294,27 +219,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation3(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v SetScriptExecutionDisabledParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation3(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation2(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetScriptExecutionDisabledParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation3(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation2(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetScriptExecutionDisabledParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation3(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation2(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetScriptExecutionDisabledParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation3(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation2(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation4(in *jlexer.Lexer, out *SetPageScaleFactorParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation3(in *jlexer.Lexer, out *SetPageScaleFactorParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -345,7 +270,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation4(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation4(out *jwriter.Writer, in SetPageScaleFactorParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation3(out *jwriter.Writer, in SetPageScaleFactorParams) {
out.RawByte('{')
first := true
_ = first
@ -361,27 +286,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation4(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v SetPageScaleFactorParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation4(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation3(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetPageScaleFactorParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation4(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation3(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetPageScaleFactorParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation4(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation3(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetPageScaleFactorParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation4(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation3(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation5(in *jlexer.Lexer, out *SetGeolocationOverrideParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation4(in *jlexer.Lexer, out *SetGeolocationOverrideParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -416,7 +341,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation5(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation5(out *jwriter.Writer, in SetGeolocationOverrideParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation4(out *jwriter.Writer, in SetGeolocationOverrideParams) {
out.RawByte('{')
first := true
_ = first
@ -450,27 +375,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation5(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v SetGeolocationOverrideParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation5(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation4(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetGeolocationOverrideParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation5(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation4(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetGeolocationOverrideParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation5(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation4(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetGeolocationOverrideParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation5(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation4(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation6(in *jlexer.Lexer, out *SetEmulatedMediaParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation5(in *jlexer.Lexer, out *SetEmulatedMediaParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -501,7 +426,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation6(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation6(out *jwriter.Writer, in SetEmulatedMediaParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation5(out *jwriter.Writer, in SetEmulatedMediaParams) {
out.RawByte('{')
first := true
_ = first
@ -517,27 +442,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation6(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v SetEmulatedMediaParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation6(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation5(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetEmulatedMediaParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation6(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation5(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetEmulatedMediaParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation6(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation5(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetEmulatedMediaParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation6(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation5(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation7(in *jlexer.Lexer, out *SetDeviceMetricsOverrideParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation6(in *jlexer.Lexer, out *SetDeviceMetricsOverrideParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -596,7 +521,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation7(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation7(out *jwriter.Writer, in SetDeviceMetricsOverrideParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation6(out *jwriter.Writer, in SetDeviceMetricsOverrideParams) {
out.RawByte('{')
first := true
_ = first
@ -624,12 +549,14 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation7(out *jwriter.Writer
first = false
out.RawString("\"mobile\":")
out.Bool(bool(in.Mobile))
if !first {
out.RawByte(',')
if in.FitWindow {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"fitWindow\":")
out.Bool(bool(in.FitWindow))
}
first = false
out.RawString("\"fitWindow\":")
out.Bool(bool(in.FitWindow))
if in.Scale != 0 {
if !first {
out.RawByte(',')
@ -688,27 +615,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation7(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v SetDeviceMetricsOverrideParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation7(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation6(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetDeviceMetricsOverrideParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation7(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation6(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetDeviceMetricsOverrideParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation7(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation6(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetDeviceMetricsOverrideParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation7(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation6(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation8(in *jlexer.Lexer, out *SetDefaultBackgroundColorOverrideParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation7(in *jlexer.Lexer, out *SetDefaultBackgroundColorOverrideParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -747,7 +674,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation8(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation8(out *jwriter.Writer, in SetDefaultBackgroundColorOverrideParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation7(out *jwriter.Writer, in SetDefaultBackgroundColorOverrideParams) {
out.RawByte('{')
first := true
_ = first
@ -769,27 +696,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation8(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v SetDefaultBackgroundColorOverrideParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation8(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation7(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetDefaultBackgroundColorOverrideParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation8(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation7(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetDefaultBackgroundColorOverrideParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation8(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation7(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetDefaultBackgroundColorOverrideParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation8(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation7(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation9(in *jlexer.Lexer, out *SetCPUThrottlingRateParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation8(in *jlexer.Lexer, out *SetCPUThrottlingRateParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -820,7 +747,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation9(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation9(out *jwriter.Writer, in SetCPUThrottlingRateParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation8(out *jwriter.Writer, in SetCPUThrottlingRateParams) {
out.RawByte('{')
first := true
_ = first
@ -836,27 +763,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation9(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v SetCPUThrottlingRateParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation9(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation8(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetCPUThrottlingRateParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation9(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation8(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetCPUThrottlingRateParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation9(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation8(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetCPUThrottlingRateParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation9(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation8(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation10(in *jlexer.Lexer, out *ScreenOrientation) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation9(in *jlexer.Lexer, out *ScreenOrientation) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -889,7 +816,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation10(in *jlexer.Lexer,
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation10(out *jwriter.Writer, in ScreenOrientation) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation9(out *jwriter.Writer, in ScreenOrientation) {
out.RawByte('{')
first := true
_ = first
@ -911,27 +838,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation10(out *jwriter.Write
// MarshalJSON supports json.Marshaler interface
func (v ScreenOrientation) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation10(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation9(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ScreenOrientation) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation10(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation9(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ScreenOrientation) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation10(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation9(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ScreenOrientation) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation10(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation9(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation11(in *jlexer.Lexer, out *ResetViewportParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation10(in *jlexer.Lexer, out *ResetPageScaleFactorParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -960,66 +887,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation11(in *jlexer.Lexer,
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation11(out *jwriter.Writer, in ResetViewportParams) {
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ResetViewportParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation11(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ResetViewportParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation11(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ResetViewportParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation11(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ResetViewportParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation11(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation12(in *jlexer.Lexer, out *ResetPageScaleFactorParams) {
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 easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation12(out *jwriter.Writer, in ResetPageScaleFactorParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation10(out *jwriter.Writer, in ResetPageScaleFactorParams) {
out.RawByte('{')
first := true
_ = first
@ -1029,110 +897,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation12(out *jwriter.Write
// MarshalJSON supports json.Marshaler interface
func (v ResetPageScaleFactorParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation12(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation10(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ResetPageScaleFactorParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation12(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation10(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ResetPageScaleFactorParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation12(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation10(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ResetPageScaleFactorParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation12(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation10(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation13(in *jlexer.Lexer, out *ForceViewportParams) {
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 "x":
out.X = float64(in.Float64())
case "y":
out.Y = float64(in.Float64())
case "scale":
out.Scale = float64(in.Float64())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation13(out *jwriter.Writer, in ForceViewportParams) {
out.RawByte('{')
first := true
_ = first
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"x\":")
out.Float64(float64(in.X))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"y\":")
out.Float64(float64(in.Y))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"scale\":")
out.Float64(float64(in.Scale))
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ForceViewportParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation13(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ForceViewportParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation13(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ForceViewportParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation13(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ForceViewportParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation13(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation14(in *jlexer.Lexer, out *EventVirtualTimeBudgetExpired) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation11(in *jlexer.Lexer, out *EventVirtualTimeBudgetExpired) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -1161,7 +946,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation14(in *jlexer.Lexer,
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation14(out *jwriter.Writer, in EventVirtualTimeBudgetExpired) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation11(out *jwriter.Writer, in EventVirtualTimeBudgetExpired) {
out.RawByte('{')
first := true
_ = first
@ -1171,27 +956,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation14(out *jwriter.Write
// MarshalJSON supports json.Marshaler interface
func (v EventVirtualTimeBudgetExpired) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation14(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation11(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventVirtualTimeBudgetExpired) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation14(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation11(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EventVirtualTimeBudgetExpired) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation14(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation11(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventVirtualTimeBudgetExpired) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation14(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation11(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(in *jlexer.Lexer, out *ClearGeolocationOverrideParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation12(in *jlexer.Lexer, out *ClearGeolocationOverrideParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -1220,7 +1005,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(in *jlexer.Lexer,
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(out *jwriter.Writer, in ClearGeolocationOverrideParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation12(out *jwriter.Writer, in ClearGeolocationOverrideParams) {
out.RawByte('{')
first := true
_ = first
@ -1230,27 +1015,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(out *jwriter.Write
// MarshalJSON supports json.Marshaler interface
func (v ClearGeolocationOverrideParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation12(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ClearGeolocationOverrideParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation12(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ClearGeolocationOverrideParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation12(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ClearGeolocationOverrideParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation12(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation16(in *jlexer.Lexer, out *ClearDeviceMetricsOverrideParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation13(in *jlexer.Lexer, out *ClearDeviceMetricsOverrideParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -1279,7 +1064,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation16(in *jlexer.Lexer,
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation16(out *jwriter.Writer, in ClearDeviceMetricsOverrideParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation13(out *jwriter.Writer, in ClearDeviceMetricsOverrideParams) {
out.RawByte('{')
first := true
_ = first
@ -1289,27 +1074,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation16(out *jwriter.Write
// MarshalJSON supports json.Marshaler interface
func (v ClearDeviceMetricsOverrideParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation16(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation13(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ClearDeviceMetricsOverrideParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation16(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation13(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ClearDeviceMetricsOverrideParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation16(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation13(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ClearDeviceMetricsOverrideParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation16(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation13(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation17(in *jlexer.Lexer, out *CanEmulateReturns) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation14(in *jlexer.Lexer, out *CanEmulateReturns) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -1340,7 +1125,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation17(in *jlexer.Lexer,
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation17(out *jwriter.Writer, in CanEmulateReturns) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation14(out *jwriter.Writer, in CanEmulateReturns) {
out.RawByte('{')
first := true
_ = first
@ -1358,27 +1143,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation17(out *jwriter.Write
// MarshalJSON supports json.Marshaler interface
func (v CanEmulateReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation17(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation14(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v CanEmulateReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation17(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation14(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *CanEmulateReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation17(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation14(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CanEmulateReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation17(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation14(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation18(in *jlexer.Lexer, out *CanEmulateParams) {
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(in *jlexer.Lexer, out *CanEmulateParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@ -1407,7 +1192,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation18(in *jlexer.Lexer,
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation18(out *jwriter.Writer, in CanEmulateParams) {
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(out *jwriter.Writer, in CanEmulateParams) {
out.RawByte('{')
first := true
_ = first
@ -1417,23 +1202,23 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation18(out *jwriter.Write
// MarshalJSON supports json.Marshaler interface
func (v CanEmulateParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation18(&w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v CanEmulateParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation18(w, v)
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpEmulation15(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *CanEmulateParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation18(&r, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CanEmulateParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation18(l, v)
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpEmulation15(l, v)
}

View File

@ -23,7 +23,7 @@ type SetDeviceMetricsOverrideParams struct {
Height int64 `json:"height"` // Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
DeviceScaleFactor float64 `json:"deviceScaleFactor"` // Overriding device scale factor value. 0 disables the override.
Mobile bool `json:"mobile"` // Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
FitWindow bool `json:"fitWindow"` // Whether a view that exceeds the available browser window area should be scaled down to fit.
FitWindow bool `json:"fitWindow,omitempty"` // Whether a view that exceeds the available browser window area should be scaled down to fit.
Scale float64 `json:"scale,omitempty"` // Scale to apply to resulting view image. Ignored in |fitWindow| mode.
ScreenWidth int64 `json:"screenWidth,omitempty"` // Overriding screen width value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
ScreenHeight int64 `json:"screenHeight,omitempty"` // Overriding screen height value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
@ -42,17 +42,22 @@ type SetDeviceMetricsOverrideParams struct {
// height - Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
// deviceScaleFactor - Overriding device scale factor value. 0 disables the override.
// mobile - Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
// fitWindow - Whether a view that exceeds the available browser window area should be scaled down to fit.
func SetDeviceMetricsOverride(width int64, height int64, deviceScaleFactor float64, mobile bool, fitWindow bool) *SetDeviceMetricsOverrideParams {
func SetDeviceMetricsOverride(width int64, height int64, deviceScaleFactor float64, mobile bool) *SetDeviceMetricsOverrideParams {
return &SetDeviceMetricsOverrideParams{
Width: width,
Height: height,
DeviceScaleFactor: deviceScaleFactor,
Mobile: mobile,
FitWindow: fitWindow,
}
}
// WithFitWindow whether a view that exceeds the available browser window
// area should be scaled down to fit.
func (p SetDeviceMetricsOverrideParams) WithFitWindow(fitWindow bool) *SetDeviceMetricsOverrideParams {
p.FitWindow = fitWindow
return &p
}
// WithScale scale to apply to resulting view image. Ignored in |fitWindow|
// mode.
func (p SetDeviceMetricsOverrideParams) WithScale(scale float64) *SetDeviceMetricsOverrideParams {
@ -114,55 +119,6 @@ func (p *ClearDeviceMetricsOverrideParams) Do(ctxt context.Context, h cdp.Handle
return h.Execute(ctxt, cdp.CommandEmulationClearDeviceMetricsOverride, nil, nil)
}
// ForceViewportParams overrides the visible area of the page. The change is
// hidden from the page, i.e. the observable scroll position and page scale does
// not change. In effect, the command moves the specified area of the page into
// the top-left corner of the frame.
type ForceViewportParams struct {
X float64 `json:"x"` // X coordinate of top-left corner of the area (CSS pixels).
Y float64 `json:"y"` // Y coordinate of top-left corner of the area (CSS pixels).
Scale float64 `json:"scale"` // Scale to apply to the area (relative to a page scale of 1.0).
}
// ForceViewport overrides the visible area of the page. The change is hidden
// from the page, i.e. the observable scroll position and page scale does not
// change. In effect, the command moves the specified area of the page into the
// top-left corner of the frame.
//
// parameters:
// x - X coordinate of top-left corner of the area (CSS pixels).
// y - Y coordinate of top-left corner of the area (CSS pixels).
// scale - Scale to apply to the area (relative to a page scale of 1.0).
func ForceViewport(x float64, y float64, scale float64) *ForceViewportParams {
return &ForceViewportParams{
X: x,
Y: y,
Scale: scale,
}
}
// Do executes Emulation.forceViewport against the provided context and
// target handler.
func (p *ForceViewportParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandEmulationForceViewport, p, nil)
}
// ResetViewportParams resets the visible area of the page to the original
// viewport, undoing any effects of the forceViewport command.
type ResetViewportParams struct{}
// ResetViewport resets the visible area of the page to the original
// viewport, undoing any effects of the forceViewport command.
func ResetViewport() *ResetViewportParams {
return &ResetViewportParams{}
}
// Do executes Emulation.resetViewport against the provided context and
// target handler.
func (p *ResetViewportParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandEmulationResetViewport, nil, nil)
}
// ResetPageScaleFactorParams requests that page scale factor is reset to
// initial values.
type ResetPageScaleFactorParams struct{}
@ -200,34 +156,6 @@ func (p *SetPageScaleFactorParams) Do(ctxt context.Context, h cdp.Handler) (err
return h.Execute(ctxt, cdp.CommandEmulationSetPageScaleFactor, p, nil)
}
// SetVisibleSizeParams resizes the frame/viewport of the page. Note that
// this does not affect the frame's container (e.g. browser window). Can be used
// to produce screenshots of the specified size. Not supported on Android.
type SetVisibleSizeParams struct {
Width int64 `json:"width"` // Frame width (DIP).
Height int64 `json:"height"` // Frame height (DIP).
}
// SetVisibleSize resizes the frame/viewport of the page. Note that this does
// not affect the frame's container (e.g. browser window). Can be used to
// produce screenshots of the specified size. Not supported on Android.
//
// parameters:
// width - Frame width (DIP).
// height - Frame height (DIP).
func SetVisibleSize(width int64, height int64) *SetVisibleSizeParams {
return &SetVisibleSizeParams{
Width: width,
Height: height,
}
}
// Do executes Emulation.setVisibleSize against the provided context and
// target handler.
func (p *SetVisibleSizeParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandEmulationSetVisibleSize, p, nil)
}
// SetScriptExecutionDisabledParams switches script execution in the page.
type SetScriptExecutionDisabledParams struct {
Value bool `json:"value"` // Whether script execution should be disabled in the page.

View File

@ -170,9 +170,9 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpInput1(in *jlexer.Lexer, out *
}
switch key {
case "x":
out.X = int64(in.Int64())
out.X = float64(in.Float64())
case "y":
out.Y = int64(in.Int64())
out.Y = float64(in.Float64())
case "duration":
out.Duration = int64(in.Int64())
case "tapCount":
@ -198,13 +198,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpInput1(out *jwriter.Writer, in
}
first = false
out.RawString("\"x\":")
out.Int64(int64(in.X))
out.Float64(float64(in.X))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"y\":")
out.Int64(int64(in.Y))
out.Float64(float64(in.Y))
if in.Duration != 0 {
if !first {
out.RawByte(',')
@ -275,17 +275,17 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpInput2(in *jlexer.Lexer, out *
}
switch key {
case "x":
out.X = int64(in.Int64())
out.X = float64(in.Float64())
case "y":
out.Y = int64(in.Int64())
out.Y = float64(in.Float64())
case "xDistance":
out.XDistance = int64(in.Int64())
out.XDistance = float64(in.Float64())
case "yDistance":
out.YDistance = int64(in.Int64())
out.YDistance = float64(in.Float64())
case "xOverscroll":
out.XOverscroll = int64(in.Int64())
out.XOverscroll = float64(in.Float64())
case "yOverscroll":
out.YOverscroll = int64(in.Int64())
out.YOverscroll = float64(in.Float64())
case "preventFling":
out.PreventFling = bool(in.Bool())
case "speed":
@ -317,20 +317,20 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpInput2(out *jwriter.Writer, in
}
first = false
out.RawString("\"x\":")
out.Int64(int64(in.X))
out.Float64(float64(in.X))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"y\":")
out.Int64(int64(in.Y))
out.Float64(float64(in.Y))
if in.XDistance != 0 {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"xDistance\":")
out.Int64(int64(in.XDistance))
out.Float64(float64(in.XDistance))
}
if in.YDistance != 0 {
if !first {
@ -338,7 +338,7 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpInput2(out *jwriter.Writer, in
}
first = false
out.RawString("\"yDistance\":")
out.Int64(int64(in.YDistance))
out.Float64(float64(in.YDistance))
}
if in.XOverscroll != 0 {
if !first {
@ -346,7 +346,7 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpInput2(out *jwriter.Writer, in
}
first = false
out.RawString("\"xOverscroll\":")
out.Int64(int64(in.XOverscroll))
out.Float64(float64(in.XOverscroll))
}
if in.YOverscroll != 0 {
if !first {
@ -354,7 +354,7 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpInput2(out *jwriter.Writer, in
}
first = false
out.RawString("\"yOverscroll\":")
out.Int64(int64(in.YOverscroll))
out.Float64(float64(in.YOverscroll))
}
if in.PreventFling {
if !first {
@ -450,9 +450,9 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpInput3(in *jlexer.Lexer, out *
}
switch key {
case "x":
out.X = int64(in.Int64())
out.X = float64(in.Float64())
case "y":
out.Y = int64(in.Int64())
out.Y = float64(in.Float64())
case "scaleFactor":
out.ScaleFactor = float64(in.Float64())
case "relativeSpeed":
@ -478,13 +478,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpInput3(out *jwriter.Writer, in
}
first = false
out.RawString("\"x\":")
out.Int64(int64(in.X))
out.Float64(float64(in.X))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"y\":")
out.Int64(int64(in.Y))
out.Float64(float64(in.Y))
if !first {
out.RawByte(',')
}
@ -924,9 +924,9 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpInput7(in *jlexer.Lexer, out *
case "type":
(out.Type).UnmarshalEasyJSON(in)
case "x":
out.X = int64(in.Int64())
out.X = float64(in.Float64())
case "y":
out.Y = int64(in.Int64())
out.Y = float64(in.Float64())
case "modifiers":
(out.Modifiers).UnmarshalEasyJSON(in)
case "timestamp":
@ -968,13 +968,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpInput7(out *jwriter.Writer, in
}
first = false
out.RawString("\"x\":")
out.Int64(int64(in.X))
out.Float64(float64(in.X))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"y\":")
out.Int64(int64(in.Y))
out.Float64(float64(in.Y))
if in.Modifiers != 0 {
if !first {
out.RawByte(',')

View File

@ -152,8 +152,8 @@ func (p *DispatchKeyEventParams) Do(ctxt context.Context, h cdp.Handler) (err er
// DispatchMouseEventParams dispatches a mouse event to the page.
type DispatchMouseEventParams struct {
Type MouseType `json:"type"` // Type of the mouse event.
X int64 `json:"x"` // X coordinate of the event relative to the main frame's viewport.
Y int64 `json:"y"` // Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
X float64 `json:"x"` // X coordinate of the event relative to the main frame's viewport in CSS pixels.
Y float64 `json:"y"` // Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
Modifiers Modifier `json:"modifiers,omitempty"` // Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
Timestamp *TimeSinceEpoch `json:"timestamp,omitempty"` // Time at which the event occurred.
Button ButtonType `json:"button,omitempty"` // Mouse button (default: "none").
@ -164,9 +164,9 @@ type DispatchMouseEventParams struct {
//
// parameters:
// type - Type of the mouse event.
// x - X coordinate of the event relative to the main frame's viewport.
// y - Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
func DispatchMouseEvent(typeVal MouseType, x int64, y int64) *DispatchMouseEventParams {
// x - X coordinate of the event relative to the main frame's viewport in CSS pixels.
// y - Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
func DispatchMouseEvent(typeVal MouseType, x float64, y float64) *DispatchMouseEventParams {
return &DispatchMouseEventParams{
Type: typeVal,
X: x,
@ -311,8 +311,8 @@ func (p *EmulateTouchFromMouseEventParams) Do(ctxt context.Context, h cdp.Handle
// SynthesizePinchGestureParams synthesizes a pinch gesture over a time
// period by issuing appropriate touch events.
type SynthesizePinchGestureParams struct {
X int64 `json:"x"` // X coordinate of the start of the gesture in CSS pixels.
Y int64 `json:"y"` // Y coordinate of the start of the gesture in CSS pixels.
X float64 `json:"x"` // X coordinate of the start of the gesture in CSS pixels.
Y float64 `json:"y"` // Y coordinate of the start of the gesture in CSS pixels.
ScaleFactor float64 `json:"scaleFactor"` // Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).
RelativeSpeed int64 `json:"relativeSpeed,omitempty"` // Relative pointer speed in pixels per second (default: 800).
GestureSourceType GestureType `json:"gestureSourceType,omitempty"` // Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
@ -325,7 +325,7 @@ type SynthesizePinchGestureParams struct {
// x - X coordinate of the start of the gesture in CSS pixels.
// y - Y coordinate of the start of the gesture in CSS pixels.
// scaleFactor - Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).
func SynthesizePinchGesture(x int64, y int64, scaleFactor float64) *SynthesizePinchGestureParams {
func SynthesizePinchGesture(x float64, y float64, scaleFactor float64) *SynthesizePinchGestureParams {
return &SynthesizePinchGestureParams{
X: x,
Y: y,
@ -356,12 +356,12 @@ func (p *SynthesizePinchGestureParams) Do(ctxt context.Context, h cdp.Handler) (
// SynthesizeScrollGestureParams synthesizes a scroll gesture over a time
// period by issuing appropriate touch events.
type SynthesizeScrollGestureParams struct {
X int64 `json:"x"` // X coordinate of the start of the gesture in CSS pixels.
Y int64 `json:"y"` // Y coordinate of the start of the gesture in CSS pixels.
XDistance int64 `json:"xDistance,omitempty"` // The distance to scroll along the X axis (positive to scroll left).
YDistance int64 `json:"yDistance,omitempty"` // The distance to scroll along the Y axis (positive to scroll up).
XOverscroll int64 `json:"xOverscroll,omitempty"` // The number of additional pixels to scroll back along the X axis, in addition to the given distance.
YOverscroll int64 `json:"yOverscroll,omitempty"` // The number of additional pixels to scroll back along the Y axis, in addition to the given distance.
X float64 `json:"x"` // X coordinate of the start of the gesture in CSS pixels.
Y float64 `json:"y"` // Y coordinate of the start of the gesture in CSS pixels.
XDistance float64 `json:"xDistance,omitempty"` // The distance to scroll along the X axis (positive to scroll left).
YDistance float64 `json:"yDistance,omitempty"` // The distance to scroll along the Y axis (positive to scroll up).
XOverscroll float64 `json:"xOverscroll,omitempty"` // The number of additional pixels to scroll back along the X axis, in addition to the given distance.
YOverscroll float64 `json:"yOverscroll,omitempty"` // The number of additional pixels to scroll back along the Y axis, in addition to the given distance.
PreventFling bool `json:"preventFling,omitempty"` // Prevent fling (default: true).
Speed int64 `json:"speed,omitempty"` // Swipe speed in pixels per second (default: 800).
GestureSourceType GestureType `json:"gestureSourceType,omitempty"` // Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
@ -376,7 +376,7 @@ type SynthesizeScrollGestureParams struct {
// parameters:
// x - X coordinate of the start of the gesture in CSS pixels.
// y - Y coordinate of the start of the gesture in CSS pixels.
func SynthesizeScrollGesture(x int64, y int64) *SynthesizeScrollGestureParams {
func SynthesizeScrollGesture(x float64, y float64) *SynthesizeScrollGestureParams {
return &SynthesizeScrollGestureParams{
X: x,
Y: y,
@ -385,28 +385,28 @@ func SynthesizeScrollGesture(x int64, y int64) *SynthesizeScrollGestureParams {
// WithXDistance the distance to scroll along the X axis (positive to scroll
// left).
func (p SynthesizeScrollGestureParams) WithXDistance(xDistance int64) *SynthesizeScrollGestureParams {
func (p SynthesizeScrollGestureParams) WithXDistance(xDistance float64) *SynthesizeScrollGestureParams {
p.XDistance = xDistance
return &p
}
// WithYDistance the distance to scroll along the Y axis (positive to scroll
// up).
func (p SynthesizeScrollGestureParams) WithYDistance(yDistance int64) *SynthesizeScrollGestureParams {
func (p SynthesizeScrollGestureParams) WithYDistance(yDistance float64) *SynthesizeScrollGestureParams {
p.YDistance = yDistance
return &p
}
// WithXOverscroll the number of additional pixels to scroll back along the X
// axis, in addition to the given distance.
func (p SynthesizeScrollGestureParams) WithXOverscroll(xOverscroll int64) *SynthesizeScrollGestureParams {
func (p SynthesizeScrollGestureParams) WithXOverscroll(xOverscroll float64) *SynthesizeScrollGestureParams {
p.XOverscroll = xOverscroll
return &p
}
// WithYOverscroll the number of additional pixels to scroll back along the Y
// axis, in addition to the given distance.
func (p SynthesizeScrollGestureParams) WithYOverscroll(yOverscroll int64) *SynthesizeScrollGestureParams {
func (p SynthesizeScrollGestureParams) WithYOverscroll(yOverscroll float64) *SynthesizeScrollGestureParams {
p.YOverscroll = yOverscroll
return &p
}
@ -459,8 +459,8 @@ func (p *SynthesizeScrollGestureParams) Do(ctxt context.Context, h cdp.Handler)
// SynthesizeTapGestureParams synthesizes a tap gesture over a time period by
// issuing appropriate touch events.
type SynthesizeTapGestureParams struct {
X int64 `json:"x"` // X coordinate of the start of the gesture in CSS pixels.
Y int64 `json:"y"` // Y coordinate of the start of the gesture in CSS pixels.
X float64 `json:"x"` // X coordinate of the start of the gesture in CSS pixels.
Y float64 `json:"y"` // Y coordinate of the start of the gesture in CSS pixels.
Duration int64 `json:"duration,omitempty"` // Duration between touchdown and touchup events in ms (default: 50).
TapCount int64 `json:"tapCount,omitempty"` // Number of times to perform the tap (e.g. 2 for double tap, default: 1).
GestureSourceType GestureType `json:"gestureSourceType,omitempty"` // Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
@ -472,7 +472,7 @@ type SynthesizeTapGestureParams struct {
// parameters:
// x - X coordinate of the start of the gesture in CSS pixels.
// y - Y coordinate of the start of the gesture in CSS pixels.
func SynthesizeTapGesture(x int64, y int64) *SynthesizeTapGestureParams {
func SynthesizeTapGesture(x float64, y float64) *SynthesizeTapGestureParams {
return &SynthesizeTapGestureParams{
X: x,
Y: y,

File diff suppressed because it is too large Load Diff

View File

@ -446,6 +446,7 @@ func (p *SetDocumentContentParams) Do(ctxt context.Context, h cdp.Handler) (err
type CaptureScreenshotParams struct {
Format CaptureScreenshotFormat `json:"format,omitempty"` // Image compression format (defaults to png).
Quality int64 `json:"quality,omitempty"` // Compression quality from range [0..100] (jpeg only).
Clip *Viewport `json:"clip,omitempty"` // Capture the screenshot of a given region only.
FromSurface bool `json:"fromSurface,omitempty"` // Capture the screenshot from the surface, rather than the view. Defaults to true.
}
@ -468,6 +469,12 @@ func (p CaptureScreenshotParams) WithQuality(quality int64) *CaptureScreenshotPa
return &p
}
// WithClip capture the screenshot of a given region only.
func (p CaptureScreenshotParams) WithClip(clip *Viewport) *CaptureScreenshotParams {
p.Clip = clip
return &p
}
// WithFromSurface capture the screenshot from the surface, rather than the
// view. Defaults to true.
func (p CaptureScreenshotParams) WithFromSurface(fromSurface bool) *CaptureScreenshotParams {

View File

@ -327,6 +327,15 @@ type VisualViewport struct {
Scale float64 `json:"scale"` // Scale relative to the ideal viewport (size at width=device-width).
}
// Viewport viewport for capturing screenshot.
type Viewport struct {
X float64 `json:"x"` // X offset in CSS pixels.
Y float64 `json:"y"` // Y offset in CSS pixels
Width float64 `json:"width"` // Rectangle width in CSS pixels
Height float64 `json:"height"` // Rectangle height in CSS pixels
Scale float64 `json:"scale"` // Page scale factor.
}
// CaptureScreenshotFormat image compression format (defaults to png).
type CaptureScreenshotFormat string

View File

@ -478,6 +478,39 @@
"description": "Scale relative to the ideal viewport (size at width=device-width)."
}
]
},
{
"id": "Viewport",
"type": "object",
"description": "Viewport for capturing screenshot.",
"experimental": true,
"properties": [
{
"name": "x",
"type": "number",
"description": "X offset in CSS pixels."
},
{
"name": "y",
"type": "number",
"description": "Y offset in CSS pixels"
},
{
"name": "width",
"type": "number",
"description": "Rectangle width in CSS pixels"
},
{
"name": "height",
"type": "number",
"description": "Rectangle height in CSS pixels"
},
{
"name": "scale",
"type": "number",
"description": "Page scale factor."
}
]
}
],
"commands": [
@ -812,6 +845,7 @@
{
"name": "fitWindow",
"type": "boolean",
"optional": true,
"description": "Whether a view that exceeds the available browser window area should be scaled down to fit."
},
{
@ -974,6 +1008,13 @@
"optional": true,
"description": "Compression quality from range [0..100] (jpeg only)."
},
{
"name": "clip",
"$ref": "Viewport",
"optional": true,
"description": "Capture the screenshot of a given region only.",
"experimental": true
},
{
"name": "fromSurface",
"type": "boolean",
@ -1901,6 +1942,7 @@
{
"name": "fitWindow",
"type": "boolean",
"optional": true,
"description": "Whether a view that exceeds the available browser window area should be scaled down to fit."
},
{
@ -1966,33 +2008,6 @@
"name": "clearDeviceMetricsOverride",
"description": "Clears the overriden device metrics."
},
{
"name": "forceViewport",
"description": "Overrides the visible area of the page. The change is hidden from the page, i.e. the observable scroll position and page scale does not change. In effect, the command moves the specified area of the page into the top-left corner of the frame.",
"experimental": true,
"parameters": [
{
"name": "x",
"type": "number",
"description": "X coordinate of top-left corner of the area (CSS pixels)."
},
{
"name": "y",
"type": "number",
"description": "Y coordinate of top-left corner of the area (CSS pixels)."
},
{
"name": "scale",
"type": "number",
"description": "Scale to apply to the area (relative to a page scale of 1.0)."
}
]
},
{
"name": "resetViewport",
"description": "Resets the visible area of the page to the original viewport, undoing any effects of the <code>forceViewport</code> command.",
"experimental": true
},
{
"name": "resetPageScaleFactor",
"experimental": true,
@ -2012,8 +2027,9 @@
},
{
"name": "setVisibleSize",
"description": "Resizes the frame/viewport of the page. Note that this does not affect the frame's container (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported on Android.",
"description": "Deprecated, does nothing. Please use setDeviceMetricsOverride instead.",
"experimental": true,
"deprecated": true,
"parameters": [
{
"name": "width",
@ -8821,13 +8837,13 @@
},
{
"name": "x",
"type": "integer",
"description": "X coordinate of the event relative to the main frame's viewport."
"type": "number",
"description": "X coordinate of the event relative to the main frame's viewport in CSS pixels."
},
{
"name": "y",
"type": "integer",
"description": "Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport."
"type": "number",
"description": "Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport."
},
{
"name": "modifiers",
@ -8972,12 +8988,12 @@
"parameters": [
{
"name": "x",
"type": "integer",
"type": "number",
"description": "X coordinate of the start of the gesture in CSS pixels."
},
{
"name": "y",
"type": "integer",
"type": "number",
"description": "Y coordinate of the start of the gesture in CSS pixels."
},
{
@ -9006,35 +9022,35 @@
"parameters": [
{
"name": "x",
"type": "integer",
"type": "number",
"description": "X coordinate of the start of the gesture in CSS pixels."
},
{
"name": "y",
"type": "integer",
"type": "number",
"description": "Y coordinate of the start of the gesture in CSS pixels."
},
{
"name": "xDistance",
"type": "integer",
"type": "number",
"optional": true,
"description": "The distance to scroll along the X axis (positive to scroll left)."
},
{
"name": "yDistance",
"type": "integer",
"type": "number",
"optional": true,
"description": "The distance to scroll along the Y axis (positive to scroll up)."
},
{
"name": "xOverscroll",
"type": "integer",
"type": "number",
"optional": true,
"description": "The number of additional pixels to scroll back along the X axis, in addition to the given distance."
},
{
"name": "yOverscroll",
"type": "integer",
"type": "number",
"optional": true,
"description": "The number of additional pixels to scroll back along the Y axis, in addition to the given distance."
},
@ -9083,12 +9099,12 @@
"parameters": [
{
"name": "x",
"type": "integer",
"type": "number",
"description": "X coordinate of the start of the gesture in CSS pixels."
},
{
"name": "y",
"type": "integer",
"type": "number",
"description": "Y coordinate of the start of the gesture in CSS pixels."
},
{