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 easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp(in *jlexer.Lexer, out *RG
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -104,7 +104,7 @@ func (v *RGBA) UnmarshalJSON(data []byte) error {
func (v *RGBA) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(in *jlexer.Lexer, out *Node) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(in *jlexer.Lexer, out *OriginTrialTokenWithStatus) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -115,7 +115,332 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(in *jlexer.Lexer, out *N
}
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 "rawTokenText":
out.RawTokenText = string(in.String())
case "parsedToken":
if in.IsNull() {
in.Skip()
out.ParsedToken = nil
} else {
if out.ParsedToken == nil {
out.ParsedToken = new(OriginTrialToken)
}
(*out.ParsedToken).UnmarshalEasyJSON(in)
}
case "status":
(out.Status).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp1(out *jwriter.Writer, in OriginTrialTokenWithStatus) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"rawTokenText\":"
out.RawString(prefix[1:])
out.String(string(in.RawTokenText))
}
if in.ParsedToken != nil {
const prefix string = ",\"parsedToken\":"
out.RawString(prefix)
(*in.ParsedToken).MarshalEasyJSON(out)
}
{
const prefix string = ",\"status\":"
out.RawString(prefix)
(in.Status).MarshalEasyJSON(out)
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v OriginTrialTokenWithStatus) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v OriginTrialTokenWithStatus) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp1(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *OriginTrialTokenWithStatus) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *OriginTrialTokenWithStatus) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp2(in *jlexer.Lexer, out *OriginTrialToken) {
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 "origin":
out.Origin = string(in.String())
case "matchSubDomains":
out.MatchSubDomains = bool(in.Bool())
case "trialName":
out.TrialName = string(in.String())
case "expiryTime":
if in.IsNull() {
in.Skip()
out.ExpiryTime = nil
} else {
if out.ExpiryTime == nil {
out.ExpiryTime = new(TimeSinceEpoch)
}
(*out.ExpiryTime).UnmarshalEasyJSON(in)
}
case "isThirdParty":
out.IsThirdParty = bool(in.Bool())
case "usageRestriction":
(out.UsageRestriction).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp2(out *jwriter.Writer, in OriginTrialToken) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"origin\":"
out.RawString(prefix[1:])
out.String(string(in.Origin))
}
{
const prefix string = ",\"matchSubDomains\":"
out.RawString(prefix)
out.Bool(bool(in.MatchSubDomains))
}
{
const prefix string = ",\"trialName\":"
out.RawString(prefix)
out.String(string(in.TrialName))
}
{
const prefix string = ",\"expiryTime\":"
out.RawString(prefix)
if in.ExpiryTime == nil {
out.RawString("null")
} else {
(*in.ExpiryTime).MarshalEasyJSON(out)
}
}
{
const prefix string = ",\"isThirdParty\":"
out.RawString(prefix)
out.Bool(bool(in.IsThirdParty))
}
{
const prefix string = ",\"usageRestriction\":"
out.RawString(prefix)
(in.UsageRestriction).MarshalEasyJSON(out)
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v OriginTrialToken) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp2(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v OriginTrialToken) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp2(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *OriginTrialToken) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp2(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *OriginTrialToken) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp2(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp3(in *jlexer.Lexer, out *OriginTrial) {
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 "trialName":
out.TrialName = string(in.String())
case "status":
(out.Status).UnmarshalEasyJSON(in)
case "tokensWithStatus":
if in.IsNull() {
in.Skip()
out.TokensWithStatus = nil
} else {
in.Delim('[')
if out.TokensWithStatus == nil {
if !in.IsDelim(']') {
out.TokensWithStatus = make([]*OriginTrialTokenWithStatus, 0, 8)
} else {
out.TokensWithStatus = []*OriginTrialTokenWithStatus{}
}
} else {
out.TokensWithStatus = (out.TokensWithStatus)[:0]
}
for !in.IsDelim(']') {
var v1 *OriginTrialTokenWithStatus
if in.IsNull() {
in.Skip()
v1 = nil
} else {
if v1 == nil {
v1 = new(OriginTrialTokenWithStatus)
}
(*v1).UnmarshalEasyJSON(in)
}
out.TokensWithStatus = append(out.TokensWithStatus, v1)
in.WantComma()
}
in.Delim(']')
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp3(out *jwriter.Writer, in OriginTrial) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"trialName\":"
out.RawString(prefix[1:])
out.String(string(in.TrialName))
}
{
const prefix string = ",\"status\":"
out.RawString(prefix)
(in.Status).MarshalEasyJSON(out)
}
{
const prefix string = ",\"tokensWithStatus\":"
out.RawString(prefix)
if in.TokensWithStatus == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v2, v3 := range in.TokensWithStatus {
if v2 > 0 {
out.RawByte(',')
}
if v3 == nil {
out.RawString("null")
} else {
(*v3).MarshalEasyJSON(out)
}
}
out.RawByte(']')
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v OriginTrial) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp3(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v OriginTrial) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp3(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *OriginTrial) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp3(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *OriginTrial) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp3(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp4(in *jlexer.Lexer, out *Node) {
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()
@@ -155,17 +480,17 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(in *jlexer.Lexer, out *N
out.Children = (out.Children)[:0]
}
for !in.IsDelim(']') {
var v1 *Node
var v4 *Node
if in.IsNull() {
in.Skip()
v1 = nil
v4 = nil
} else {
if v1 == nil {
v1 = new(Node)
if v4 == nil {
v4 = new(Node)
}
(*v1).UnmarshalEasyJSON(in)
(*v4).UnmarshalEasyJSON(in)
}
out.Children = append(out.Children, v1)
out.Children = append(out.Children, v4)
in.WantComma()
}
in.Delim(']')
@@ -186,9 +511,9 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(in *jlexer.Lexer, out *N
out.Attributes = (out.Attributes)[:0]
}
for !in.IsDelim(']') {
var v2 string
v2 = string(in.String())
out.Attributes = append(out.Attributes, v2)
var v5 string
v5 = string(in.String())
out.Attributes = append(out.Attributes, v5)
in.WantComma()
}
in.Delim(']')
@@ -241,17 +566,17 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(in *jlexer.Lexer, out *N
out.ShadowRoots = (out.ShadowRoots)[:0]
}
for !in.IsDelim(']') {
var v3 *Node
var v6 *Node
if in.IsNull() {
in.Skip()
v3 = nil
v6 = nil
} else {
if v3 == nil {
v3 = new(Node)
if v6 == nil {
v6 = new(Node)
}
(*v3).UnmarshalEasyJSON(in)
(*v6).UnmarshalEasyJSON(in)
}
out.ShadowRoots = append(out.ShadowRoots, v3)
out.ShadowRoots = append(out.ShadowRoots, v6)
in.WantComma()
}
in.Delim(']')
@@ -282,31 +607,21 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(in *jlexer.Lexer, out *N
out.PseudoElements = (out.PseudoElements)[:0]
}
for !in.IsDelim(']') {
var v4 *Node
var v7 *Node
if in.IsNull() {
in.Skip()
v4 = nil
v7 = nil
} else {
if v4 == nil {
v4 = new(Node)
if v7 == nil {
v7 = new(Node)
}
(*v4).UnmarshalEasyJSON(in)
(*v7).UnmarshalEasyJSON(in)
}
out.PseudoElements = append(out.PseudoElements, v4)
out.PseudoElements = append(out.PseudoElements, v7)
in.WantComma()
}
in.Delim(']')
}
case "importedDocument":
if in.IsNull() {
in.Skip()
out.ImportedDocument = nil
} else {
if out.ImportedDocument == nil {
out.ImportedDocument = new(Node)
}
(*out.ImportedDocument).UnmarshalEasyJSON(in)
}
case "distributedNodes":
if in.IsNull() {
in.Skip()
@@ -323,23 +638,25 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(in *jlexer.Lexer, out *N
out.DistributedNodes = (out.DistributedNodes)[:0]
}
for !in.IsDelim(']') {
var v5 *BackendNode
var v8 *BackendNode
if in.IsNull() {
in.Skip()
v5 = nil
v8 = nil
} else {
if v5 == nil {
v5 = new(BackendNode)
if v8 == nil {
v8 = new(BackendNode)
}
(*v5).UnmarshalEasyJSON(in)
(*v8).UnmarshalEasyJSON(in)
}
out.DistributedNodes = append(out.DistributedNodes, v5)
out.DistributedNodes = append(out.DistributedNodes, v8)
in.WantComma()
}
in.Delim(']')
}
case "isSVG":
out.IsSVG = bool(in.Bool())
case "compatibilityMode":
(out.CompatibilityMode).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
@@ -350,7 +667,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(in *jlexer.Lexer, out *N
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp1(out *jwriter.Writer, in Node) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp4(out *jwriter.Writer, in Node) {
out.RawByte('{')
first := true
_ = first
@@ -399,14 +716,14 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp1(out *jwriter.Writer, in
out.RawString(prefix)
{
out.RawByte('[')
for v6, v7 := range in.Children {
if v6 > 0 {
for v9, v10 := range in.Children {
if v9 > 0 {
out.RawByte(',')
}
if v7 == nil {
if v10 == nil {
out.RawString("null")
} else {
(*v7).MarshalEasyJSON(out)
(*v10).MarshalEasyJSON(out)
}
}
out.RawByte(']')
@@ -417,11 +734,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp1(out *jwriter.Writer, in
out.RawString(prefix)
{
out.RawByte('[')
for v8, v9 := range in.Attributes {
if v8 > 0 {
for v11, v12 := range in.Attributes {
if v11 > 0 {
out.RawByte(',')
}
out.String(string(v9))
out.String(string(v12))
}
out.RawByte(']')
}
@@ -491,14 +808,14 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp1(out *jwriter.Writer, in
out.RawString(prefix)
{
out.RawByte('[')
for v10, v11 := range in.ShadowRoots {
if v10 > 0 {
for v13, v14 := range in.ShadowRoots {
if v13 > 0 {
out.RawByte(',')
}
if v11 == nil {
if v14 == nil {
out.RawString("null")
} else {
(*v11).MarshalEasyJSON(out)
(*v14).MarshalEasyJSON(out)
}
}
out.RawByte(']')
@@ -514,37 +831,32 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp1(out *jwriter.Writer, in
out.RawString(prefix)
{
out.RawByte('[')
for v12, v13 := range in.PseudoElements {
if v12 > 0 {
for v15, v16 := range in.PseudoElements {
if v15 > 0 {
out.RawByte(',')
}
if v13 == nil {
if v16 == nil {
out.RawString("null")
} else {
(*v13).MarshalEasyJSON(out)
(*v16).MarshalEasyJSON(out)
}
}
out.RawByte(']')
}
}
if in.ImportedDocument != nil {
const prefix string = ",\"importedDocument\":"
out.RawString(prefix)
(*in.ImportedDocument).MarshalEasyJSON(out)
}
if len(in.DistributedNodes) != 0 {
const prefix string = ",\"distributedNodes\":"
out.RawString(prefix)
{
out.RawByte('[')
for v14, v15 := range in.DistributedNodes {
if v14 > 0 {
for v17, v18 := range in.DistributedNodes {
if v17 > 0 {
out.RawByte(',')
}
if v15 == nil {
if v18 == nil {
out.RawString("null")
} else {
(*v15).MarshalEasyJSON(out)
(*v18).MarshalEasyJSON(out)
}
}
out.RawByte(']')
@@ -555,33 +867,38 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp1(out *jwriter.Writer, in
out.RawString(prefix)
out.Bool(bool(in.IsSVG))
}
if in.CompatibilityMode != "" {
const prefix string = ",\"compatibilityMode\":"
out.RawString(prefix)
(in.CompatibilityMode).MarshalEasyJSON(out)
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v Node) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp1(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp4(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Node) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp1(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp4(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *Node) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp4(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Node) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp1(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp4(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp2(in *jlexer.Lexer, out *Frame) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp5(in *jlexer.Lexer, out *Frame) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -592,7 +909,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp2(in *jlexer.Lexer, out *F
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -612,12 +929,82 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp2(in *jlexer.Lexer, out *F
out.URL = string(in.String())
case "urlFragment":
out.URLFragment = string(in.String())
case "domainAndRegistry":
out.DomainAndRegistry = string(in.String())
case "securityOrigin":
out.SecurityOrigin = string(in.String())
case "mimeType":
out.MimeType = string(in.String())
case "unreachableUrl":
out.UnreachableURL = string(in.String())
case "adFrameStatus":
if in.IsNull() {
in.Skip()
out.AdFrameStatus = nil
} else {
if out.AdFrameStatus == nil {
out.AdFrameStatus = new(AdFrameStatus)
}
(*out.AdFrameStatus).UnmarshalEasyJSON(in)
}
case "secureContextType":
(out.SecureContextType).UnmarshalEasyJSON(in)
case "crossOriginIsolatedContextType":
(out.CrossOriginIsolatedContextType).UnmarshalEasyJSON(in)
case "gatedAPIFeatures":
if in.IsNull() {
in.Skip()
out.GatedAPIFeatures = nil
} else {
in.Delim('[')
if out.GatedAPIFeatures == nil {
if !in.IsDelim(']') {
out.GatedAPIFeatures = make([]GatedAPIFeatures, 0, 4)
} else {
out.GatedAPIFeatures = []GatedAPIFeatures{}
}
} else {
out.GatedAPIFeatures = (out.GatedAPIFeatures)[:0]
}
for !in.IsDelim(']') {
var v19 GatedAPIFeatures
(v19).UnmarshalEasyJSON(in)
out.GatedAPIFeatures = append(out.GatedAPIFeatures, v19)
in.WantComma()
}
in.Delim(']')
}
case "originTrials":
if in.IsNull() {
in.Skip()
out.OriginTrials = nil
} else {
in.Delim('[')
if out.OriginTrials == nil {
if !in.IsDelim(']') {
out.OriginTrials = make([]*OriginTrial, 0, 8)
} else {
out.OriginTrials = []*OriginTrial{}
}
} else {
out.OriginTrials = (out.OriginTrials)[:0]
}
for !in.IsDelim(']') {
var v20 *OriginTrial
if in.IsNull() {
in.Skip()
v20 = nil
} else {
if v20 == nil {
v20 = new(OriginTrial)
}
(*v20).UnmarshalEasyJSON(in)
}
out.OriginTrials = append(out.OriginTrials, v20)
in.WantComma()
}
in.Delim(']')
}
default:
in.SkipRecursive()
}
@@ -628,7 +1015,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp2(in *jlexer.Lexer, out *F
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp2(out *jwriter.Writer, in Frame) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp5(out *jwriter.Writer, in Frame) {
out.RawByte('{')
first := true
_ = first
@@ -662,6 +1049,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp2(out *jwriter.Writer, in
out.RawString(prefix)
out.String(string(in.URLFragment))
}
{
const prefix string = ",\"domainAndRegistry\":"
out.RawString(prefix)
out.String(string(in.DomainAndRegistry))
}
{
const prefix string = ",\"securityOrigin\":"
out.RawString(prefix)
@@ -677,33 +1069,82 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp2(out *jwriter.Writer, in
out.RawString(prefix)
out.String(string(in.UnreachableURL))
}
if in.AdFrameStatus != nil {
const prefix string = ",\"adFrameStatus\":"
out.RawString(prefix)
(*in.AdFrameStatus).MarshalEasyJSON(out)
}
{
const prefix string = ",\"secureContextType\":"
out.RawString(prefix)
(in.SecureContextType).MarshalEasyJSON(out)
}
{
const prefix string = ",\"crossOriginIsolatedContextType\":"
out.RawString(prefix)
(in.CrossOriginIsolatedContextType).MarshalEasyJSON(out)
}
{
const prefix string = ",\"gatedAPIFeatures\":"
out.RawString(prefix)
if in.GatedAPIFeatures == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v21, v22 := range in.GatedAPIFeatures {
if v21 > 0 {
out.RawByte(',')
}
(v22).MarshalEasyJSON(out)
}
out.RawByte(']')
}
}
if len(in.OriginTrials) != 0 {
const prefix string = ",\"originTrials\":"
out.RawString(prefix)
{
out.RawByte('[')
for v23, v24 := range in.OriginTrials {
if v23 > 0 {
out.RawByte(',')
}
if v24 == nil {
out.RawString("null")
} else {
(*v24).MarshalEasyJSON(out)
}
}
out.RawByte(']')
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v Frame) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp2(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp5(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Frame) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp2(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp5(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *Frame) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp2(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp5(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Frame) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp2(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp5(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp3(in *jlexer.Lexer, out *BackendNode) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp6(in *jlexer.Lexer, out *BackendNode) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -714,7 +1155,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp3(in *jlexer.Lexer, out *B
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -738,7 +1179,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp3(in *jlexer.Lexer, out *B
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp3(out *jwriter.Writer, in BackendNode) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp6(out *jwriter.Writer, in BackendNode) {
out.RawByte('{')
first := true
_ = first
@@ -763,23 +1204,126 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp3(out *jwriter.Writer, in
// MarshalJSON supports json.Marshaler interface
func (v BackendNode) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp3(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp6(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v BackendNode) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp3(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp6(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *BackendNode) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp3(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp6(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *BackendNode) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp3(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp6(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp7(in *jlexer.Lexer, out *AdFrameStatus) {
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 "adFrameType":
(out.AdFrameType).UnmarshalEasyJSON(in)
case "explanations":
if in.IsNull() {
in.Skip()
out.Explanations = nil
} else {
in.Delim('[')
if out.Explanations == nil {
if !in.IsDelim(']') {
out.Explanations = make([]AdFrameExplanation, 0, 4)
} else {
out.Explanations = []AdFrameExplanation{}
}
} else {
out.Explanations = (out.Explanations)[:0]
}
for !in.IsDelim(']') {
var v25 AdFrameExplanation
(v25).UnmarshalEasyJSON(in)
out.Explanations = append(out.Explanations, v25)
in.WantComma()
}
in.Delim(']')
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp7(out *jwriter.Writer, in AdFrameStatus) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"adFrameType\":"
out.RawString(prefix[1:])
(in.AdFrameType).MarshalEasyJSON(out)
}
if len(in.Explanations) != 0 {
const prefix string = ",\"explanations\":"
out.RawString(prefix)
{
out.RawByte('[')
for v26, v27 := range in.Explanations {
if v26 > 0 {
out.RawByte(',')
}
(v27).MarshalEasyJSON(out)
}
out.RawByte(']')
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v AdFrameStatus) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp7(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v AdFrameStatus) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoCdp7(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *AdFrameStatus) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp7(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *AdFrameStatus) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoCdp7(l, v)
}

View File

@@ -11,7 +11,7 @@ import (
"sync"
"time"
"github.com/knq/sysutil"
"github.com/chromedp/sysutil"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
@@ -174,6 +174,9 @@ const (
PseudoTypeMarker PseudoType = "marker"
PseudoTypeBackdrop PseudoType = "backdrop"
PseudoTypeSelection PseudoType = "selection"
PseudoTypeTargetText PseudoType = "target-text"
PseudoTypeSpellingError PseudoType = "spelling-error"
PseudoTypeGrammarError PseudoType = "grammar-error"
PseudoTypeFirstLineInherited PseudoType = "first-line-inherited"
PseudoTypeScrollbar PseudoType = "scrollbar"
PseudoTypeScrollbarThumb PseudoType = "scrollbar-thumb"
@@ -212,6 +215,12 @@ func (t *PseudoType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = PseudoTypeBackdrop
case PseudoTypeSelection:
*t = PseudoTypeSelection
case PseudoTypeTargetText:
*t = PseudoTypeTargetText
case PseudoTypeSpellingError:
*t = PseudoTypeSpellingError
case PseudoTypeGrammarError:
*t = PseudoTypeGrammarError
case PseudoTypeFirstLineInherited:
*t = PseudoTypeFirstLineInherited
case PseudoTypeScrollbar:
@@ -288,57 +297,110 @@ func (t *ShadowRootType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CompatibilityMode document compatibility mode.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-CompatibilityMode
type CompatibilityMode string
// String returns the CompatibilityMode as string value.
func (t CompatibilityMode) String() string {
return string(t)
}
// CompatibilityMode values.
const (
CompatibilityModeQuirksMode CompatibilityMode = "QuirksMode"
CompatibilityModeLimitedQuirksMode CompatibilityMode = "LimitedQuirksMode"
CompatibilityModeNoQuirksMode CompatibilityMode = "NoQuirksMode"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CompatibilityMode) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CompatibilityMode) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CompatibilityMode) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CompatibilityMode(in.String()) {
case CompatibilityModeQuirksMode:
*t = CompatibilityModeQuirksMode
case CompatibilityModeLimitedQuirksMode:
*t = CompatibilityModeLimitedQuirksMode
case CompatibilityModeNoQuirksMode:
*t = CompatibilityModeNoQuirksMode
default:
in.AddError(errors.New("unknown CompatibilityMode value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CompatibilityMode) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// Node DOM interaction is implemented in terms of mirror objects that
// represent the actual DOM nodes. DOMNode is a base node mirror type.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-Node
type Node struct {
NodeID NodeID `json:"nodeId"` // Node identifier that is passed into the rest of the DOM messages as the nodeId. Backend will only push node with given id once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client.
ParentID NodeID `json:"parentId,omitempty"` // The id of the parent node if any.
BackendNodeID BackendNodeID `json:"backendNodeId"` // The BackendNodeId for this node.
NodeType NodeType `json:"nodeType"` // Node's nodeType.
NodeName string `json:"nodeName"` // Node's nodeName.
LocalName string `json:"localName"` // Node's localName.
NodeValue string `json:"nodeValue"` // Node's nodeValue.
ChildNodeCount int64 `json:"childNodeCount,omitempty"` // Child count for Container nodes.
Children []*Node `json:"children,omitempty"` // Child nodes of this node when requested with children.
Attributes []string `json:"attributes,omitempty"` // Attributes of the Element node in the form of flat array [name1, value1, name2, value2].
DocumentURL string `json:"documentURL,omitempty"` // Document URL that Document or FrameOwner node points to.
BaseURL string `json:"baseURL,omitempty"` // Base URL that Document or FrameOwner node uses for URL completion.
PublicID string `json:"publicId,omitempty"` // DocumentType's publicId.
SystemID string `json:"systemId,omitempty"` // DocumentType's systemId.
InternalSubset string `json:"internalSubset,omitempty"` // DocumentType's internalSubset.
XMLVersion string `json:"xmlVersion,omitempty"` // Document's XML version in case of XML documents.
Name string `json:"name,omitempty"` // Attr's name.
Value string `json:"value,omitempty"` // Attr's value.
PseudoType PseudoType `json:"pseudoType,omitempty"` // Pseudo element type for this node.
ShadowRootType ShadowRootType `json:"shadowRootType,omitempty"` // Shadow root type.
FrameID FrameID `json:"frameId,omitempty"` // Frame ID for frame owner elements.
ContentDocument *Node `json:"contentDocument,omitempty"` // Content document for frame owner elements.
ShadowRoots []*Node `json:"shadowRoots,omitempty"` // Shadow root list for given element host.
TemplateContent *Node `json:"templateContent,omitempty"` // Content document fragment for template elements.
PseudoElements []*Node `json:"pseudoElements,omitempty"` // Pseudo elements associated with this node.
ImportedDocument *Node `json:"importedDocument,omitempty"` // Import document for the HTMLImport links.
DistributedNodes []*BackendNode `json:"distributedNodes,omitempty"` // Distributed nodes for given insertion point.
IsSVG bool `json:"isSVG,omitempty"` // Whether the node is SVG.
Parent *Node `json:"-"` // Parent node.
Invalidated chan struct{} `json:"-"` // Invalidated channel.
State NodeState `json:"-"` // Node state.
sync.RWMutex `json:"-"` // Read write mutex.
NodeID NodeID `json:"nodeId"` // Node identifier that is passed into the rest of the DOM messages as the nodeId. Backend will only push node with given id once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client.
ParentID NodeID `json:"parentId,omitempty"` // The id of the parent node if any.
BackendNodeID BackendNodeID `json:"backendNodeId"` // The BackendNodeId for this node.
NodeType NodeType `json:"nodeType"` // Node's nodeType.
NodeName string `json:"nodeName"` // Node's nodeName.
LocalName string `json:"localName"` // Node's localName.
NodeValue string `json:"nodeValue"` // Node's nodeValue.
ChildNodeCount int64 `json:"childNodeCount,omitempty"` // Child count for Container nodes.
Children []*Node `json:"children,omitempty"` // Child nodes of this node when requested with children.
Attributes []string `json:"attributes,omitempty"` // Attributes of the Element node in the form of flat array [name1, value1, name2, value2].
DocumentURL string `json:"documentURL,omitempty"` // Document URL that Document or FrameOwner node points to.
BaseURL string `json:"baseURL,omitempty"` // Base URL that Document or FrameOwner node uses for URL completion.
PublicID string `json:"publicId,omitempty"` // DocumentType's publicId.
SystemID string `json:"systemId,omitempty"` // DocumentType's systemId.
InternalSubset string `json:"internalSubset,omitempty"` // DocumentType's internalSubset.
XMLVersion string `json:"xmlVersion,omitempty"` // Document's XML version in case of XML documents.
Name string `json:"name,omitempty"` // Attr's name.
Value string `json:"value,omitempty"` // Attr's value.
PseudoType PseudoType `json:"pseudoType,omitempty"` // Pseudo element type for this node.
ShadowRootType ShadowRootType `json:"shadowRootType,omitempty"` // Shadow root type.
FrameID FrameID `json:"frameId,omitempty"` // Frame ID for frame owner elements.
ContentDocument *Node `json:"contentDocument,omitempty"` // Content document for frame owner elements.
ShadowRoots []*Node `json:"shadowRoots,omitempty"` // Shadow root list for given element host.
TemplateContent *Node `json:"templateContent,omitempty"` // Content document fragment for template elements.
PseudoElements []*Node `json:"pseudoElements,omitempty"` // Pseudo elements associated with this node.
DistributedNodes []*BackendNode `json:"distributedNodes,omitempty"` // Distributed nodes for given insertion point.
IsSVG bool `json:"isSVG,omitempty"` // Whether the node is SVG.
CompatibilityMode CompatibilityMode `json:"compatibilityMode,omitempty"`
Parent *Node `json:"-"` // Parent node.
Invalidated chan struct{} `json:"-"` // Invalidated channel.
State NodeState `json:"-"` // Node state.
sync.RWMutex `json:"-"` // Read write mutex.
}
// AttributeValue returns the named attribute for the node.
func (n *Node) AttributeValue(name string) string {
value, _ := n.Attribute(name)
return value
}
// Attribute returns the named attribute for the node and if it exists.
func (n *Node) Attribute(name string) (string, bool) {
n.RLock()
defer n.RUnlock()
for i := 0; i < len(n.Attributes); i += 2 {
if n.Attributes[i] == name {
return n.Attributes[i+1]
return n.Attributes[i+1], true
}
}
return ""
return "", false
}
// xpath builds the xpath string.
@@ -730,23 +792,478 @@ func (t *FrameID) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// AdFrameType indicates whether a frame has been identified as an ad.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-AdFrameType
type AdFrameType string
// String returns the AdFrameType as string value.
func (t AdFrameType) String() string {
return string(t)
}
// AdFrameType values.
const (
AdFrameTypeNone AdFrameType = "none"
AdFrameTypeChild AdFrameType = "child"
AdFrameTypeRoot AdFrameType = "root"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t AdFrameType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t AdFrameType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *AdFrameType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch AdFrameType(in.String()) {
case AdFrameTypeNone:
*t = AdFrameTypeNone
case AdFrameTypeChild:
*t = AdFrameTypeChild
case AdFrameTypeRoot:
*t = AdFrameTypeRoot
default:
in.AddError(errors.New("unknown AdFrameType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *AdFrameType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// AdFrameExplanation [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-AdFrameExplanation
type AdFrameExplanation string
// String returns the AdFrameExplanation as string value.
func (t AdFrameExplanation) String() string {
return string(t)
}
// AdFrameExplanation values.
const (
AdFrameExplanationParentIsAd AdFrameExplanation = "ParentIsAd"
AdFrameExplanationCreatedByAdScript AdFrameExplanation = "CreatedByAdScript"
AdFrameExplanationMatchedBlockingRule AdFrameExplanation = "MatchedBlockingRule"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t AdFrameExplanation) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t AdFrameExplanation) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *AdFrameExplanation) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch AdFrameExplanation(in.String()) {
case AdFrameExplanationParentIsAd:
*t = AdFrameExplanationParentIsAd
case AdFrameExplanationCreatedByAdScript:
*t = AdFrameExplanationCreatedByAdScript
case AdFrameExplanationMatchedBlockingRule:
*t = AdFrameExplanationMatchedBlockingRule
default:
in.AddError(errors.New("unknown AdFrameExplanation value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *AdFrameExplanation) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// AdFrameStatus indicates whether a frame has been identified as an ad and
// why.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-AdFrameStatus
type AdFrameStatus struct {
AdFrameType AdFrameType `json:"adFrameType"`
Explanations []AdFrameExplanation `json:"explanations,omitempty"`
}
// SecureContextType indicates whether the frame is a secure context and why
// it is the case.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-SecureContextType
type SecureContextType string
// String returns the SecureContextType as string value.
func (t SecureContextType) String() string {
return string(t)
}
// SecureContextType values.
const (
SecureContextTypeSecure SecureContextType = "Secure"
SecureContextTypeSecureLocalhost SecureContextType = "SecureLocalhost"
SecureContextTypeInsecureScheme SecureContextType = "InsecureScheme"
SecureContextTypeInsecureAncestor SecureContextType = "InsecureAncestor"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t SecureContextType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t SecureContextType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *SecureContextType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch SecureContextType(in.String()) {
case SecureContextTypeSecure:
*t = SecureContextTypeSecure
case SecureContextTypeSecureLocalhost:
*t = SecureContextTypeSecureLocalhost
case SecureContextTypeInsecureScheme:
*t = SecureContextTypeInsecureScheme
case SecureContextTypeInsecureAncestor:
*t = SecureContextTypeInsecureAncestor
default:
in.AddError(errors.New("unknown SecureContextType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *SecureContextType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CrossOriginIsolatedContextType indicates whether the frame is cross-origin
// isolated and why it is the case.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-CrossOriginIsolatedContextType
type CrossOriginIsolatedContextType string
// String returns the CrossOriginIsolatedContextType as string value.
func (t CrossOriginIsolatedContextType) String() string {
return string(t)
}
// CrossOriginIsolatedContextType values.
const (
CrossOriginIsolatedContextTypeIsolated CrossOriginIsolatedContextType = "Isolated"
CrossOriginIsolatedContextTypeNotIsolated CrossOriginIsolatedContextType = "NotIsolated"
CrossOriginIsolatedContextTypeNotIsolatedFeatureDisabled CrossOriginIsolatedContextType = "NotIsolatedFeatureDisabled"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CrossOriginIsolatedContextType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CrossOriginIsolatedContextType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CrossOriginIsolatedContextType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CrossOriginIsolatedContextType(in.String()) {
case CrossOriginIsolatedContextTypeIsolated:
*t = CrossOriginIsolatedContextTypeIsolated
case CrossOriginIsolatedContextTypeNotIsolated:
*t = CrossOriginIsolatedContextTypeNotIsolated
case CrossOriginIsolatedContextTypeNotIsolatedFeatureDisabled:
*t = CrossOriginIsolatedContextTypeNotIsolatedFeatureDisabled
default:
in.AddError(errors.New("unknown CrossOriginIsolatedContextType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CrossOriginIsolatedContextType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// GatedAPIFeatures [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-GatedAPIFeatures
type GatedAPIFeatures string
// String returns the GatedAPIFeatures as string value.
func (t GatedAPIFeatures) String() string {
return string(t)
}
// GatedAPIFeatures values.
const (
GatedAPIFeaturesSharedArrayBuffers GatedAPIFeatures = "SharedArrayBuffers"
GatedAPIFeaturesSharedArrayBuffersTransferAllowed GatedAPIFeatures = "SharedArrayBuffersTransferAllowed"
GatedAPIFeaturesPerformanceMeasureMemory GatedAPIFeatures = "PerformanceMeasureMemory"
GatedAPIFeaturesPerformanceProfile GatedAPIFeatures = "PerformanceProfile"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t GatedAPIFeatures) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t GatedAPIFeatures) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *GatedAPIFeatures) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch GatedAPIFeatures(in.String()) {
case GatedAPIFeaturesSharedArrayBuffers:
*t = GatedAPIFeaturesSharedArrayBuffers
case GatedAPIFeaturesSharedArrayBuffersTransferAllowed:
*t = GatedAPIFeaturesSharedArrayBuffersTransferAllowed
case GatedAPIFeaturesPerformanceMeasureMemory:
*t = GatedAPIFeaturesPerformanceMeasureMemory
case GatedAPIFeaturesPerformanceProfile:
*t = GatedAPIFeaturesPerformanceProfile
default:
in.AddError(errors.New("unknown GatedAPIFeatures value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *GatedAPIFeatures) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// OriginTrialTokenStatus origin
// Trial(https://www.chromium.org/blink/origin-trials) support. Status for an
// Origin Trial token.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-OriginTrialTokenStatus
type OriginTrialTokenStatus string
// String returns the OriginTrialTokenStatus as string value.
func (t OriginTrialTokenStatus) String() string {
return string(t)
}
// OriginTrialTokenStatus values.
const (
OriginTrialTokenStatusSuccess OriginTrialTokenStatus = "Success"
OriginTrialTokenStatusNotSupported OriginTrialTokenStatus = "NotSupported"
OriginTrialTokenStatusInsecure OriginTrialTokenStatus = "Insecure"
OriginTrialTokenStatusExpired OriginTrialTokenStatus = "Expired"
OriginTrialTokenStatusWrongOrigin OriginTrialTokenStatus = "WrongOrigin"
OriginTrialTokenStatusInvalidSignature OriginTrialTokenStatus = "InvalidSignature"
OriginTrialTokenStatusMalformed OriginTrialTokenStatus = "Malformed"
OriginTrialTokenStatusWrongVersion OriginTrialTokenStatus = "WrongVersion"
OriginTrialTokenStatusFeatureDisabled OriginTrialTokenStatus = "FeatureDisabled"
OriginTrialTokenStatusTokenDisabled OriginTrialTokenStatus = "TokenDisabled"
OriginTrialTokenStatusFeatureDisabledForUser OriginTrialTokenStatus = "FeatureDisabledForUser"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t OriginTrialTokenStatus) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t OriginTrialTokenStatus) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *OriginTrialTokenStatus) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch OriginTrialTokenStatus(in.String()) {
case OriginTrialTokenStatusSuccess:
*t = OriginTrialTokenStatusSuccess
case OriginTrialTokenStatusNotSupported:
*t = OriginTrialTokenStatusNotSupported
case OriginTrialTokenStatusInsecure:
*t = OriginTrialTokenStatusInsecure
case OriginTrialTokenStatusExpired:
*t = OriginTrialTokenStatusExpired
case OriginTrialTokenStatusWrongOrigin:
*t = OriginTrialTokenStatusWrongOrigin
case OriginTrialTokenStatusInvalidSignature:
*t = OriginTrialTokenStatusInvalidSignature
case OriginTrialTokenStatusMalformed:
*t = OriginTrialTokenStatusMalformed
case OriginTrialTokenStatusWrongVersion:
*t = OriginTrialTokenStatusWrongVersion
case OriginTrialTokenStatusFeatureDisabled:
*t = OriginTrialTokenStatusFeatureDisabled
case OriginTrialTokenStatusTokenDisabled:
*t = OriginTrialTokenStatusTokenDisabled
case OriginTrialTokenStatusFeatureDisabledForUser:
*t = OriginTrialTokenStatusFeatureDisabledForUser
default:
in.AddError(errors.New("unknown OriginTrialTokenStatus value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *OriginTrialTokenStatus) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// OriginTrialStatus status for an Origin Trial.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-OriginTrialStatus
type OriginTrialStatus string
// String returns the OriginTrialStatus as string value.
func (t OriginTrialStatus) String() string {
return string(t)
}
// OriginTrialStatus values.
const (
OriginTrialStatusEnabled OriginTrialStatus = "Enabled"
OriginTrialStatusValidTokenNotProvided OriginTrialStatus = "ValidTokenNotProvided"
OriginTrialStatusOSNotSupported OriginTrialStatus = "OSNotSupported"
OriginTrialStatusTrialNotAllowed OriginTrialStatus = "TrialNotAllowed"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t OriginTrialStatus) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t OriginTrialStatus) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *OriginTrialStatus) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch OriginTrialStatus(in.String()) {
case OriginTrialStatusEnabled:
*t = OriginTrialStatusEnabled
case OriginTrialStatusValidTokenNotProvided:
*t = OriginTrialStatusValidTokenNotProvided
case OriginTrialStatusOSNotSupported:
*t = OriginTrialStatusOSNotSupported
case OriginTrialStatusTrialNotAllowed:
*t = OriginTrialStatusTrialNotAllowed
default:
in.AddError(errors.New("unknown OriginTrialStatus value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *OriginTrialStatus) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// OriginTrialUsageRestriction [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-OriginTrialUsageRestriction
type OriginTrialUsageRestriction string
// String returns the OriginTrialUsageRestriction as string value.
func (t OriginTrialUsageRestriction) String() string {
return string(t)
}
// OriginTrialUsageRestriction values.
const (
OriginTrialUsageRestrictionNone OriginTrialUsageRestriction = "None"
OriginTrialUsageRestrictionSubset OriginTrialUsageRestriction = "Subset"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t OriginTrialUsageRestriction) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t OriginTrialUsageRestriction) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *OriginTrialUsageRestriction) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch OriginTrialUsageRestriction(in.String()) {
case OriginTrialUsageRestrictionNone:
*t = OriginTrialUsageRestrictionNone
case OriginTrialUsageRestrictionSubset:
*t = OriginTrialUsageRestrictionSubset
default:
in.AddError(errors.New("unknown OriginTrialUsageRestriction value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *OriginTrialUsageRestriction) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// OriginTrialToken [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-OriginTrialToken
type OriginTrialToken struct {
Origin string `json:"origin"`
MatchSubDomains bool `json:"matchSubDomains"`
TrialName string `json:"trialName"`
ExpiryTime *TimeSinceEpoch `json:"expiryTime"`
IsThirdParty bool `json:"isThirdParty"`
UsageRestriction OriginTrialUsageRestriction `json:"usageRestriction"`
}
// OriginTrialTokenWithStatus [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-OriginTrialTokenWithStatus
type OriginTrialTokenWithStatus struct {
RawTokenText string `json:"rawTokenText"`
ParsedToken *OriginTrialToken `json:"parsedToken,omitempty"` // parsedToken is present only when the token is extractable and parsable.
Status OriginTrialTokenStatus `json:"status"`
}
// OriginTrial [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-OriginTrial
type OriginTrial struct {
TrialName string `json:"trialName"`
Status OriginTrialStatus `json:"status"`
TokensWithStatus []*OriginTrialTokenWithStatus `json:"tokensWithStatus"`
}
// Frame information about the Frame on the page.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-Frame
type Frame struct {
ID FrameID `json:"id"` // Frame unique identifier.
ParentID FrameID `json:"parentId,omitempty"` // Parent frame identifier.
LoaderID LoaderID `json:"loaderId"` // Identifier of the loader associated with this frame.
Name string `json:"name,omitempty"` // Frame's name as specified in the tag.
URL string `json:"url"` // Frame document's URL without fragment.
URLFragment string `json:"urlFragment,omitempty"` // Frame document's URL fragment including the '#'.
SecurityOrigin string `json:"securityOrigin"` // Frame document's security origin.
MimeType string `json:"mimeType"` // Frame document's mimeType as determined by the browser.
UnreachableURL string `json:"unreachableUrl,omitempty"` // If the frame failed to load, this contains the URL that could not be loaded. Note that unlike url above, this URL may contain a fragment.
State FrameState `json:"-"` // Frame state.
Root *Node `json:"-"` // Frame document root.
Nodes map[NodeID]*Node `json:"-"` // Frame nodes.
sync.RWMutex `json:"-"` // Read write mutex.
ID FrameID `json:"id"` // Frame unique identifier.
ParentID FrameID `json:"parentId,omitempty"` // Parent frame identifier.
LoaderID LoaderID `json:"loaderId"` // Identifier of the loader associated with this frame.
Name string `json:"name,omitempty"` // Frame's name as specified in the tag.
URL string `json:"url"` // Frame document's URL without fragment.
URLFragment string `json:"urlFragment,omitempty"` // Frame document's URL fragment including the '#'.
DomainAndRegistry string `json:"domainAndRegistry"` // Frame document's registered domain, taking the public suffixes list into account. Extracted from the Frame's url. Example URLs: http://www.google.com/file.html -> "google.com" http://a.b.co.uk/file.html -> "b.co.uk"
SecurityOrigin string `json:"securityOrigin"` // Frame document's security origin.
MimeType string `json:"mimeType"` // Frame document's mimeType as determined by the browser.
UnreachableURL string `json:"unreachableUrl,omitempty"` // If the frame failed to load, this contains the URL that could not be loaded. Note that unlike url above, this URL may contain a fragment.
AdFrameStatus *AdFrameStatus `json:"adFrameStatus,omitempty"` // Indicates whether this frame was tagged as an ad and why.
SecureContextType SecureContextType `json:"secureContextType"` // Indicates whether the main document is a secure context and explains why that is the case.
CrossOriginIsolatedContextType CrossOriginIsolatedContextType `json:"crossOriginIsolatedContextType"` // Indicates whether this is a cross origin isolated context.
GatedAPIFeatures []GatedAPIFeatures `json:"gatedAPIFeatures"` // Indicated which gated APIs / features are available.
OriginTrials []*OriginTrial `json:"originTrials,omitempty"` // Frame document's origin trials with at least one token present.
State FrameState `json:"-"` // Frame state.
Root *Node `json:"-"` // Frame document root.
Nodes map[NodeID]*Node `json:"-"` // Frame nodes.
sync.RWMutex `json:"-"` // Read write mutex.
}
// FrameState is the state of a Frame.