Update chromedp to fix console errors (#1521)

This commit is contained in:
peolic
2021-06-23 01:05:58 +03:00
committed by GitHub
parent ae3400a9b1
commit be2fe1de26
526 changed files with 55061 additions and 30300 deletions

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput(in *jlexer.Lexer, out *
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -48,6 +48,14 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput(in *jlexer.Lexer, out *
out.RotationAngle = float64(in.Float64())
case "force":
out.Force = float64(in.Float64())
case "tangentialPressure":
out.TangentialPressure = float64(in.Float64())
case "tiltX":
out.TiltX = int64(in.Int64())
case "tiltY":
out.TiltY = int64(in.Int64())
case "twist":
out.Twist = int64(in.Int64())
case "id":
out.ID = float64(in.Float64())
default:
@@ -94,6 +102,26 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput(out *jwriter.Writer, in
out.RawString(prefix)
out.Float64(float64(in.Force))
}
if in.TangentialPressure != 0 {
const prefix string = ",\"tangentialPressure\":"
out.RawString(prefix)
out.Float64(float64(in.TangentialPressure))
}
if in.TiltX != 0 {
const prefix string = ",\"tiltX\":"
out.RawString(prefix)
out.Int64(int64(in.TiltX))
}
if in.TiltY != 0 {
const prefix string = ",\"tiltY\":"
out.RawString(prefix)
out.Int64(int64(in.TiltY))
}
if in.Twist != 0 {
const prefix string = ",\"twist\":"
out.RawString(prefix)
out.Int64(int64(in.Twist))
}
if in.ID != 0 {
const prefix string = ",\"id\":"
out.RawString(prefix)
@@ -136,7 +164,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput1(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -230,7 +258,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput2(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -373,7 +401,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput3(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -456,7 +484,7 @@ func (v *SynthesizePinchGestureParams) UnmarshalJSON(data []byte) error {
func (v *SynthesizePinchGestureParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput3(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput4(in *jlexer.Lexer, out *SetIgnoreInputEventsParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput4(in *jlexer.Lexer, out *SetInterceptDragsParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -467,7 +495,73 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput4(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "enabled":
out.Enabled = bool(in.Bool())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput4(out *jwriter.Writer, in SetInterceptDragsParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"enabled\":"
out.RawString(prefix[1:])
out.Bool(bool(in.Enabled))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v SetInterceptDragsParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput4(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetInterceptDragsParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput4(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetInterceptDragsParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput4(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetInterceptDragsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput4(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput5(in *jlexer.Lexer, out *SetIgnoreInputEventsParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -487,7 +581,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput4(in *jlexer.Lexer, out
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput4(out *jwriter.Writer, in SetIgnoreInputEventsParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput5(out *jwriter.Writer, in SetIgnoreInputEventsParams) {
out.RawByte('{')
first := true
_ = first
@@ -502,27 +596,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput4(out *jwriter.Writer, i
// MarshalJSON supports json.Marshaler interface
func (v SetIgnoreInputEventsParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput4(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput5(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetIgnoreInputEventsParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput4(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput5(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetIgnoreInputEventsParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput4(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput5(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetIgnoreInputEventsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput4(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput5(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput5(in *jlexer.Lexer, out *InsertTextParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput6(in *jlexer.Lexer, out *InsertTextParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -533,7 +627,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput5(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -553,7 +647,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput5(in *jlexer.Lexer, out
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput5(out *jwriter.Writer, in InsertTextParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput6(out *jwriter.Writer, in InsertTextParams) {
out.RawByte('{')
first := true
_ = first
@@ -568,27 +662,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput5(out *jwriter.Writer, i
// MarshalJSON supports json.Marshaler interface
func (v InsertTextParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput5(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput6(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v InsertTextParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput5(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput6(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *InsertTextParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput5(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput6(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *InsertTextParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput5(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput6(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput6(in *jlexer.Lexer, out *EmulateTouchFromMouseEventParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput7(in *jlexer.Lexer, out *EventDragIntercepted) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -599,7 +693,85 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput6(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "data":
if in.IsNull() {
in.Skip()
out.Data = nil
} else {
if out.Data == nil {
out.Data = new(DragData)
}
(*out.Data).UnmarshalEasyJSON(in)
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput7(out *jwriter.Writer, in EventDragIntercepted) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"data\":"
out.RawString(prefix[1:])
if in.Data == nil {
out.RawString("null")
} else {
(*in.Data).MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v EventDragIntercepted) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput7(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventDragIntercepted) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput7(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EventDragIntercepted) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput7(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventDragIntercepted) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput7(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput8(in *jlexer.Lexer, out *EmulateTouchFromMouseEventParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -643,7 +815,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput6(in *jlexer.Lexer, out
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput6(out *jwriter.Writer, in EmulateTouchFromMouseEventParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput8(out *jwriter.Writer, in EmulateTouchFromMouseEventParams) {
out.RawByte('{')
first := true
_ = first
@@ -698,27 +870,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput6(out *jwriter.Writer, i
// MarshalJSON supports json.Marshaler interface
func (v EmulateTouchFromMouseEventParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput6(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput8(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EmulateTouchFromMouseEventParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput6(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput8(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EmulateTouchFromMouseEventParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput6(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput8(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EmulateTouchFromMouseEventParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput6(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput8(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput7(in *jlexer.Lexer, out *DispatchTouchEventParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput9(in *jlexer.Lexer, out *DragDataItem) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -729,7 +901,211 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput7(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "mimeType":
out.MimeType = string(in.String())
case "data":
out.Data = string(in.String())
case "title":
out.Title = string(in.String())
case "baseURL":
out.BaseURL = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput9(out *jwriter.Writer, in DragDataItem) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"mimeType\":"
out.RawString(prefix[1:])
out.String(string(in.MimeType))
}
{
const prefix string = ",\"data\":"
out.RawString(prefix)
out.String(string(in.Data))
}
if in.Title != "" {
const prefix string = ",\"title\":"
out.RawString(prefix)
out.String(string(in.Title))
}
if in.BaseURL != "" {
const prefix string = ",\"baseURL\":"
out.RawString(prefix)
out.String(string(in.BaseURL))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v DragDataItem) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput9(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v DragDataItem) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput9(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *DragDataItem) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput9(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *DragDataItem) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput9(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput10(in *jlexer.Lexer, out *DragData) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "items":
if in.IsNull() {
in.Skip()
out.Items = nil
} else {
in.Delim('[')
if out.Items == nil {
if !in.IsDelim(']') {
out.Items = make([]*DragDataItem, 0, 8)
} else {
out.Items = []*DragDataItem{}
}
} else {
out.Items = (out.Items)[:0]
}
for !in.IsDelim(']') {
var v1 *DragDataItem
if in.IsNull() {
in.Skip()
v1 = nil
} else {
if v1 == nil {
v1 = new(DragDataItem)
}
(*v1).UnmarshalEasyJSON(in)
}
out.Items = append(out.Items, v1)
in.WantComma()
}
in.Delim(']')
}
case "dragOperationsMask":
out.DragOperationsMask = int64(in.Int64())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput10(out *jwriter.Writer, in DragData) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"items\":"
out.RawString(prefix[1:])
if in.Items == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v2, v3 := range in.Items {
if v2 > 0 {
out.RawByte(',')
}
if v3 == nil {
out.RawString("null")
} else {
(*v3).MarshalEasyJSON(out)
}
}
out.RawByte(']')
}
}
{
const prefix string = ",\"dragOperationsMask\":"
out.RawString(prefix)
out.Int64(int64(in.DragOperationsMask))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v DragData) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput10(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v DragData) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput10(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *DragData) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput10(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *DragData) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput10(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput11(in *jlexer.Lexer, out *DispatchTouchEventParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -755,17 +1131,17 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput7(in *jlexer.Lexer, out
out.TouchPoints = (out.TouchPoints)[:0]
}
for !in.IsDelim(']') {
var v1 *TouchPoint
var v4 *TouchPoint
if in.IsNull() {
in.Skip()
v1 = nil
v4 = nil
} else {
if v1 == nil {
v1 = new(TouchPoint)
if v4 == nil {
v4 = new(TouchPoint)
}
(*v1).UnmarshalEasyJSON(in)
(*v4).UnmarshalEasyJSON(in)
}
out.TouchPoints = append(out.TouchPoints, v1)
out.TouchPoints = append(out.TouchPoints, v4)
in.WantComma()
}
in.Delim(']')
@@ -792,7 +1168,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput7(in *jlexer.Lexer, out
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput7(out *jwriter.Writer, in DispatchTouchEventParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput11(out *jwriter.Writer, in DispatchTouchEventParams) {
out.RawByte('{')
first := true
_ = first
@@ -808,14 +1184,14 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput7(out *jwriter.Writer, i
out.RawString("null")
} else {
out.RawByte('[')
for v2, v3 := range in.TouchPoints {
if v2 > 0 {
for v5, v6 := range in.TouchPoints {
if v5 > 0 {
out.RawByte(',')
}
if v3 == nil {
if v6 == nil {
out.RawString("null")
} else {
(*v3).MarshalEasyJSON(out)
(*v6).MarshalEasyJSON(out)
}
}
out.RawByte(']')
@@ -837,27 +1213,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput7(out *jwriter.Writer, i
// MarshalJSON supports json.Marshaler interface
func (v DispatchTouchEventParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput7(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput11(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v DispatchTouchEventParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput7(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput11(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *DispatchTouchEventParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput7(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput11(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *DispatchTouchEventParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput7(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput11(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput8(in *jlexer.Lexer, out *DispatchMouseEventParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput12(in *jlexer.Lexer, out *DispatchMouseEventParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -868,7 +1244,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput8(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -900,6 +1276,16 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput8(in *jlexer.Lexer, out
out.Buttons = int64(in.Int64())
case "clickCount":
out.ClickCount = int64(in.Int64())
case "force":
out.Force = float64(in.Float64())
case "tangentialPressure":
out.TangentialPressure = float64(in.Float64())
case "tiltX":
out.TiltX = int64(in.Int64())
case "tiltY":
out.TiltY = int64(in.Int64())
case "twist":
out.Twist = int64(in.Int64())
case "deltaX":
out.DeltaX = float64(in.Float64())
case "deltaY":
@@ -916,7 +1302,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput8(in *jlexer.Lexer, out
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput8(out *jwriter.Writer, in DispatchMouseEventParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput12(out *jwriter.Writer, in DispatchMouseEventParams) {
out.RawByte('{')
first := true
_ = first
@@ -960,12 +1346,37 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput8(out *jwriter.Writer, i
out.RawString(prefix)
out.Int64(int64(in.ClickCount))
}
if in.DeltaX != 0 {
if in.Force != 0 {
const prefix string = ",\"force\":"
out.RawString(prefix)
out.Float64(float64(in.Force))
}
if in.TangentialPressure != 0 {
const prefix string = ",\"tangentialPressure\":"
out.RawString(prefix)
out.Float64(float64(in.TangentialPressure))
}
if in.TiltX != 0 {
const prefix string = ",\"tiltX\":"
out.RawString(prefix)
out.Int64(int64(in.TiltX))
}
if in.TiltY != 0 {
const prefix string = ",\"tiltY\":"
out.RawString(prefix)
out.Int64(int64(in.TiltY))
}
if in.Twist != 0 {
const prefix string = ",\"twist\":"
out.RawString(prefix)
out.Int64(int64(in.Twist))
}
{
const prefix string = ",\"deltaX\":"
out.RawString(prefix)
out.Float64(float64(in.DeltaX))
}
if in.DeltaY != 0 {
{
const prefix string = ",\"deltaY\":"
out.RawString(prefix)
out.Float64(float64(in.DeltaY))
@@ -981,27 +1392,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput8(out *jwriter.Writer, i
// MarshalJSON supports json.Marshaler interface
func (v DispatchMouseEventParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput8(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput12(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v DispatchMouseEventParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput8(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput12(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *DispatchMouseEventParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput8(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput12(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *DispatchMouseEventParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput8(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput12(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput9(in *jlexer.Lexer, out *DispatchKeyEventParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput13(in *jlexer.Lexer, out *DispatchKeyEventParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -1012,7 +1423,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput9(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1056,6 +1467,29 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput9(in *jlexer.Lexer, out
out.IsSystemKey = bool(in.Bool())
case "location":
out.Location = int64(in.Int64())
case "commands":
if in.IsNull() {
in.Skip()
out.Commands = nil
} else {
in.Delim('[')
if out.Commands == nil {
if !in.IsDelim(']') {
out.Commands = make([]string, 0, 4)
} else {
out.Commands = []string{}
}
} else {
out.Commands = (out.Commands)[:0]
}
for !in.IsDelim(']') {
var v7 string
v7 = string(in.String())
out.Commands = append(out.Commands, v7)
in.WantComma()
}
in.Delim(']')
}
default:
in.SkipRecursive()
}
@@ -1066,7 +1500,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput9(in *jlexer.Lexer, out
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput9(out *jwriter.Writer, in DispatchKeyEventParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput13(out *jwriter.Writer, in DispatchKeyEventParams) {
out.RawByte('{')
first := true
_ = first
@@ -1140,29 +1574,149 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput9(out *jwriter.Writer, i
out.RawString(prefix)
out.Int64(int64(in.Location))
}
if len(in.Commands) != 0 {
const prefix string = ",\"commands\":"
out.RawString(prefix)
{
out.RawByte('[')
for v8, v9 := range in.Commands {
if v8 > 0 {
out.RawByte(',')
}
out.String(string(v9))
}
out.RawByte(']')
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v DispatchKeyEventParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput9(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput13(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v DispatchKeyEventParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput9(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput13(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *DispatchKeyEventParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput9(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput13(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *DispatchKeyEventParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput9(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput13(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput14(in *jlexer.Lexer, out *DispatchDragEventParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "type":
(out.Type).UnmarshalEasyJSON(in)
case "x":
out.X = float64(in.Float64())
case "y":
out.Y = float64(in.Float64())
case "data":
if in.IsNull() {
in.Skip()
out.Data = nil
} else {
if out.Data == nil {
out.Data = new(DragData)
}
(*out.Data).UnmarshalEasyJSON(in)
}
case "modifiers":
(out.Modifiers).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput14(out *jwriter.Writer, in DispatchDragEventParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"type\":"
out.RawString(prefix[1:])
(in.Type).MarshalEasyJSON(out)
}
{
const prefix string = ",\"x\":"
out.RawString(prefix)
out.Float64(float64(in.X))
}
{
const prefix string = ",\"y\":"
out.RawString(prefix)
out.Float64(float64(in.Y))
}
{
const prefix string = ",\"data\":"
out.RawString(prefix)
if in.Data == nil {
out.RawString("null")
} else {
(*in.Data).MarshalEasyJSON(out)
}
}
{
const prefix string = ",\"modifiers\":"
out.RawString(prefix)
(in.Modifiers).MarshalEasyJSON(out)
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v DispatchDragEventParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput14(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v DispatchDragEventParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoInput14(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *DispatchDragEventParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput14(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *DispatchDragEventParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoInput14(l, v)
}

12
vendor/github.com/chromedp/cdproto/input/events.go generated vendored Normal file
View File

@@ -0,0 +1,12 @@
package input
// Code generated by cdproto-gen. DO NOT EDIT.
// EventDragIntercepted emitted only when Input.setInterceptDrags is enabled.
// Use this data with Input.dispatchDragEvent to restore normal drag and drop
// behavior.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#event-dragIntercepted
type EventDragIntercepted struct {
Data *DragData `json:"data"`
}

View File

@@ -12,6 +12,45 @@ import (
"github.com/chromedp/cdproto/cdp"
)
// DispatchDragEventParams dispatches a drag event into the page.
type DispatchDragEventParams struct {
Type DispatchDragEventType `json:"type"` // Type of the drag event.
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.
Data *DragData `json:"data"`
Modifiers Modifier `json:"modifiers"` // Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
}
// DispatchDragEvent dispatches a drag event into the page.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-dispatchDragEvent
//
// parameters:
// type - Type of the drag event.
// 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.
// data
func DispatchDragEvent(typeVal DispatchDragEventType, x float64, y float64, data *DragData) *DispatchDragEventParams {
return &DispatchDragEventParams{
Type: typeVal,
X: x,
Y: y,
Data: data,
}
}
// WithModifiers bit field representing pressed modifier keys. Alt=1, Ctrl=2,
// Meta/Command=4, Shift=8 (default: 0).
func (p DispatchDragEventParams) WithModifiers(modifiers Modifier) *DispatchDragEventParams {
p.Modifiers = modifiers
return &p
}
// Do executes Input.dispatchDragEvent against the provided context.
func (p *DispatchDragEventParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandDispatchDragEvent, p, nil)
}
// DispatchKeyEventParams dispatches a key event to the page.
type DispatchKeyEventParams struct {
Type KeyType `json:"type"` // Type of the key event.
@@ -28,6 +67,7 @@ type DispatchKeyEventParams struct {
IsKeypad bool `json:"isKeypad"` // Whether the event was generated from the keypad (default: false).
IsSystemKey bool `json:"isSystemKey"` // Whether the event was a system key event (default: false).
Location int64 `json:"location,omitempty"` // Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).
Commands []string `json:"commands,omitempty"` // Editing commands to send with the key event (e.g., 'selectAll') (default: []). These are related to but not equal the command names used in document.execCommand and NSStandardKeyBindingResponding. See https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.
}
// DispatchKeyEvent dispatches a key event to the page.
@@ -131,6 +171,16 @@ func (p DispatchKeyEventParams) WithLocation(location int64) *DispatchKeyEventPa
return &p
}
// WithCommands editing commands to send with the key event (e.g.,
// 'selectAll') (default: []). These are related to but not equal the command
// names used in document.execCommand and NSStandardKeyBindingResponding. See
// https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/editing/commands/editor_command_names.h
// for valid command names.
func (p DispatchKeyEventParams) WithCommands(commands []string) *DispatchKeyEventParams {
p.Commands = commands
return &p
}
// Do executes Input.dispatchKeyEvent against the provided context.
func (p *DispatchKeyEventParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandDispatchKeyEvent, p, nil)
@@ -162,17 +212,22 @@ func (p *InsertTextParams) Do(ctx context.Context) (err error) {
// DispatchMouseEventParams dispatches a mouse event to the page.
type DispatchMouseEventParams struct {
Type MouseType `json:"type"` // Type of the mouse event.
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"` // 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 MouseButton `json:"button,omitempty"` // Mouse button (default: "none").
Buttons int64 `json:"buttons,omitempty"` // A number indicating which buttons are pressed on the mouse when a mouse event is triggered. Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0.
ClickCount int64 `json:"clickCount,omitempty"` // Number of times the mouse button was clicked (default: 0).
DeltaX float64 `json:"deltaX,omitempty"` // X delta in CSS pixels for mouse wheel event (default: 0).
DeltaY float64 `json:"deltaY,omitempty"` // Y delta in CSS pixels for mouse wheel event (default: 0).
PointerType DispatchMouseEventPointerType `json:"pointerType,omitempty"` // Pointer type (default: "mouse").
Type MouseType `json:"type"` // Type of the mouse event.
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"` // 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 MouseButton `json:"button,omitempty"` // Mouse button (default: "none").
Buttons int64 `json:"buttons,omitempty"` // A number indicating which buttons are pressed on the mouse when a mouse event is triggered. Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0.
ClickCount int64 `json:"clickCount,omitempty"` // Number of times the mouse button was clicked (default: 0).
Force float64 `json:"force,omitempty"` // The normalized pressure, which has a range of [0,1] (default: 0).
TangentialPressure float64 `json:"tangentialPressure,omitempty"` // The normalized tangential pressure, which has a range of [-1,1] (default: 0).
TiltX int64 `json:"tiltX,omitempty"` // The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0).
TiltY int64 `json:"tiltY,omitempty"` // The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0).
Twist int64 `json:"twist,omitempty"` // The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0).
DeltaX float64 `json:"deltaX"` // X delta in CSS pixels for mouse wheel event (default: 0).
DeltaY float64 `json:"deltaY"` // Y delta in CSS pixels for mouse wheel event (default: 0).
PointerType DispatchMouseEventPointerType `json:"pointerType,omitempty"` // Pointer type (default: "mouse").
}
// DispatchMouseEvent dispatches a mouse event to the page.
@@ -224,6 +279,43 @@ func (p DispatchMouseEventParams) WithClickCount(clickCount int64) *DispatchMous
return &p
}
// WithForce the normalized pressure, which has a range of [0,1] (default:
// 0).
func (p DispatchMouseEventParams) WithForce(force float64) *DispatchMouseEventParams {
p.Force = force
return &p
}
// WithTangentialPressure the normalized tangential pressure, which has a
// range of [-1,1] (default: 0).
func (p DispatchMouseEventParams) WithTangentialPressure(tangentialPressure float64) *DispatchMouseEventParams {
p.TangentialPressure = tangentialPressure
return &p
}
// WithTiltX the plane angle between the Y-Z plane and the plane containing
// both the stylus axis and the Y axis, in degrees of the range [-90,90], a
// positive tiltX is to the right (default: 0).
func (p DispatchMouseEventParams) WithTiltX(tiltX int64) *DispatchMouseEventParams {
p.TiltX = tiltX
return &p
}
// WithTiltY the plane angle between the X-Z plane and the plane containing
// both the stylus axis and the X axis, in degrees of the range [-90,90], a
// positive tiltY is towards the user (default: 0).
func (p DispatchMouseEventParams) WithTiltY(tiltY int64) *DispatchMouseEventParams {
p.TiltY = tiltY
return &p
}
// WithTwist the clockwise rotation of a pen stylus around its own major
// axis, in degrees in the range [0,359] (default: 0).
func (p DispatchMouseEventParams) WithTwist(twist int64) *DispatchMouseEventParams {
p.Twist = twist
return &p
}
// WithDeltaX X delta in CSS pixels for mouse wheel event (default: 0).
func (p DispatchMouseEventParams) WithDeltaX(deltaX float64) *DispatchMouseEventParams {
p.DeltaX = deltaX
@@ -379,6 +471,32 @@ func (p *SetIgnoreInputEventsParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetIgnoreInputEvents, p, nil)
}
// SetInterceptDragsParams prevents default drag and drop behavior and
// instead emits Input.dragIntercepted events. Drag and drop behavior can be
// directly controlled via Input.dispatchDragEvent.
type SetInterceptDragsParams struct {
Enabled bool `json:"enabled"`
}
// SetInterceptDrags prevents default drag and drop behavior and instead
// emits Input.dragIntercepted events. Drag and drop behavior can be directly
// controlled via Input.dispatchDragEvent.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-setInterceptDrags
//
// parameters:
// enabled
func SetInterceptDrags(enabled bool) *SetInterceptDragsParams {
return &SetInterceptDragsParams{
Enabled: enabled,
}
}
// Do executes Input.setInterceptDrags against the provided context.
func (p *SetInterceptDragsParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetInterceptDrags, p, nil)
}
// SynthesizePinchGestureParams synthesizes a pinch gesture over a time
// period by issuing appropriate touch events.
type SynthesizePinchGestureParams struct {
@@ -582,12 +700,14 @@ func (p *SynthesizeTapGestureParams) Do(ctx context.Context) (err error) {
// Command names.
const (
CommandDispatchDragEvent = "Input.dispatchDragEvent"
CommandDispatchKeyEvent = "Input.dispatchKeyEvent"
CommandInsertText = "Input.insertText"
CommandDispatchMouseEvent = "Input.dispatchMouseEvent"
CommandDispatchTouchEvent = "Input.dispatchTouchEvent"
CommandEmulateTouchFromMouseEvent = "Input.emulateTouchFromMouseEvent"
CommandSetIgnoreInputEvents = "Input.setIgnoreInputEvents"
CommandSetInterceptDrags = "Input.setInterceptDrags"
CommandSynthesizePinchGesture = "Input.synthesizePinchGesture"
CommandSynthesizeScrollGesture = "Input.synthesizeScrollGesture"
CommandSynthesizeTapGesture = "Input.synthesizeTapGesture"

View File

@@ -17,13 +17,17 @@ import (
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#type-TouchPoint
type TouchPoint struct {
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.
RadiusX float64 `json:"radiusX,omitempty"` // X radius of the touch area (default: 1.0).
RadiusY float64 `json:"radiusY,omitempty"` // Y radius of the touch area (default: 1.0).
RotationAngle float64 `json:"rotationAngle,omitempty"` // Rotation angle (default: 0.0).
Force float64 `json:"force,omitempty"` // Force (default: 1.0).
ID float64 `json:"id,omitempty"` // Identifier used to track touch sources between events, must be unique within an event.
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.
RadiusX float64 `json:"radiusX,omitempty"` // X radius of the touch area (default: 1.0).
RadiusY float64 `json:"radiusY,omitempty"` // Y radius of the touch area (default: 1.0).
RotationAngle float64 `json:"rotationAngle,omitempty"` // Rotation angle (default: 0.0).
Force float64 `json:"force,omitempty"` // Force (default: 1.0).
TangentialPressure float64 `json:"tangentialPressure,omitempty"` // The normalized tangential pressure, which has a range of [-1,1] (default: 0).
TiltX int64 `json:"tiltX,omitempty"` // The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0)
TiltY int64 `json:"tiltY,omitempty"` // The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0).
Twist int64 `json:"twist,omitempty"` // The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0).
ID float64 `json:"id,omitempty"` // Identifier used to track touch sources between events, must be unique within an event.
}
// GestureSourceType [no description].
@@ -162,6 +166,24 @@ func (t *TimeSinceEpoch) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// DragDataItem [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#type-DragDataItem
type DragDataItem struct {
MimeType string `json:"mimeType"` // Mime type of the dragged data.
Data string `json:"data"` // Depending of the value of mimeType, it contains the dragged link, text, HTML markup or any other data.
Title string `json:"title,omitempty"` // Title associated with a link. Only valid when mimeType == "text/uri-list".
BaseURL string `json:"baseURL,omitempty"` // Stores the base URL for the contained markup. Only valid when mimeType == "text/html".
}
// DragData [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#type-DragData
type DragData struct {
Items []*DragDataItem `json:"items"`
DragOperationsMask int64 `json:"dragOperationsMask"` // Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16
}
// Modifier input key modifier type.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-dispatchKeyEvent
@@ -236,6 +258,56 @@ func (t *Modifier) UnmarshalJSON(buf []byte) error {
// ModifierCommand is an alias for ModifierMeta.
const ModifierCommand Modifier = ModifierMeta
// DispatchDragEventType type of the drag event.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-dispatchDragEvent
type DispatchDragEventType string
// String returns the DispatchDragEventType as string value.
func (t DispatchDragEventType) String() string {
return string(t)
}
// DispatchDragEventType values.
const (
DragEnter DispatchDragEventType = "dragEnter"
DragOver DispatchDragEventType = "dragOver"
Drop DispatchDragEventType = "drop"
DragCancel DispatchDragEventType = "dragCancel"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t DispatchDragEventType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t DispatchDragEventType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *DispatchDragEventType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch DispatchDragEventType(in.String()) {
case DragEnter:
*t = DragEnter
case DragOver:
*t = DragOver
case Drop:
*t = Drop
case DragCancel:
*t = DragCancel
default:
in.AddError(errors.New("unknown DispatchDragEventType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *DispatchDragEventType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// KeyType type of the key event.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Input#method-dispatchKeyEvent