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

7
go.mod
View File

@@ -5,8 +5,8 @@ require (
github.com/Yamashou/gqlgenc v0.0.0-20200902035953-4dbef3551953
github.com/anacrolix/dms v1.2.2
github.com/antchfx/htmlquery v1.2.3
github.com/chromedp/cdproto v0.0.0-20200608134039-8a80cdaf865c
github.com/chromedp/chromedp v0.5.3
github.com/chromedp/cdproto v0.0.0-20210622022015-fe1827b46b84
github.com/chromedp/chromedp v0.7.3
github.com/corona10/goimagehash v1.0.3
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/disintegration/imaging v1.6.0
@@ -21,6 +21,7 @@ require (
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a
github.com/jmoiron/sqlx v1.2.0
github.com/json-iterator/go v1.1.9
github.com/knq/sysutil v0.0.0-20191005231841-15668db23d08 // indirect
github.com/mattn/go-sqlite3 v1.14.6
github.com/natefinch/pie v0.0.0-20170715172608-9a0d72014007
github.com/remeh/sizedwaitgroup v1.0.0
@@ -37,7 +38,7 @@ require (
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb
golang.org/x/net v0.0.0-20200822124328-c89045814202
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22
golang.org/x/tools v0.0.0-20200915031644-64986481280e // indirect
gopkg.in/sourcemap.v1 v1.0.5 // indirect
gopkg.in/yaml.v2 v2.3.0

21
go.sum
View File

@@ -78,8 +78,15 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf
github.com/chromedp/cdproto v0.0.0-20200116234248-4da64dd111ac/go.mod h1:PfAWWKJqjlGFYJEidUM6aVIWPr0EpobeyVWEEmplX7g=
github.com/chromedp/cdproto v0.0.0-20200608134039-8a80cdaf865c h1:qM1xzKK8kc93zKPkxK4iqtjksqDDrU6g9wGnr30jyLo=
github.com/chromedp/cdproto v0.0.0-20200608134039-8a80cdaf865c/go.mod h1:E6LPWRdIJc11h/di5p0rwvRmUYbhGpBEH7ZbPfzDIOE=
github.com/chromedp/cdproto v0.0.0-20210526005521-9e51b9051fd0/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U=
github.com/chromedp/cdproto v0.0.0-20210622022015-fe1827b46b84 h1:Xxl4imt7LA3SbkrlIH5mm+mbzsv0tpHomLASTPINlvQ=
github.com/chromedp/cdproto v0.0.0-20210622022015-fe1827b46b84/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U=
github.com/chromedp/chromedp v0.5.3 h1:F9LafxmYpsQhWQBdCs+6Sret1zzeeFyHS5LkRF//Ffg=
github.com/chromedp/chromedp v0.5.3/go.mod h1:YLdPtndaHQ4rCpSpBG+IPpy9JvX0VD+7aaLxYgYj28w=
github.com/chromedp/chromedp v0.7.3 h1:FvgJICfjvXtDX+miuMUY0NHuY8zQvjS/TcEQEG6Ldzs=
github.com/chromedp/chromedp v0.7.3/go.mod h1:9gC521Yzgrk078Ulv6KIgG7hJ2x9aWrxMBBobTFk30A=
github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic=
github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk=
@@ -368,10 +375,16 @@ github.com/gobuffalo/x v0.0.0-20181003152136-452098b06085/go.mod h1:WevpGD+5YOre
github.com/gobuffalo/x v0.0.0-20181007152206-913e47c59ca7/go.mod h1:9rDPXaB3kXdKWzMc4odGQQdG2e2DIEmANy5aSJ9yesY=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
github.com/gobwas/ws v1.1.0-rc.5 h1:QOAag7FoBaBYYHRqzqkhhd8fq5RTubvI4v3Ft/gDVVQ=
github.com/gobwas/ws v1.1.0-rc.5/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0=
github.com/gocql/gocql v0.0.0-20190301043612-f6df8288f9b4/go.mod h1:4Fw1eo5iaEhDUs8XyuhSVCVy52Jq3L+/3GJgYkwc+/0=
github.com/gofrs/uuid v3.1.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
@@ -485,6 +498,8 @@ github.com/joho/godotenv v1.2.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqx
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -526,6 +541,8 @@ github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8=
github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/markbates/deplist v1.0.4/go.mod h1:gRRbPbbuA8TmMiRvaOzUlRfzfjeCCBqX2A6arxN01MM=
github.com/markbates/deplist v1.0.5/go.mod h1:gRRbPbbuA8TmMiRvaOzUlRfzfjeCCBqX2A6arxN01MM=
github.com/markbates/going v1.0.2/go.mod h1:UWCk3zm0UKefHZ7l8BNqi26UyiEMniznk8naLdTcy6c=
@@ -949,6 +966,10 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

View File

@@ -95,7 +95,7 @@ func setCDPCookies(driverOptions scraperDriverOptions) chromedp.Tasks {
for _, ckURL := range driverOptions.Cookies {
for _, cookie := range ckURL.Cookies {
success, err := network.SetCookie(cookie.Name, getCookieValue(cookie)).
err := network.SetCookie(cookie.Name, getCookieValue(cookie)).
WithExpires(&expr).
WithDomain(cookie.Domain).
WithPath(cookie.Path).
@@ -103,12 +103,8 @@ func setCDPCookies(driverOptions scraperDriverOptions) chromedp.Tasks {
WithSecure(false).
Do(ctx)
if err != nil {
return err
return fmt.Errorf("could not set chrome cookie %s: %s", cookie.Name, err)
}
if !success {
return fmt.Errorf("could not set chrome cookie %s", cookie.Name)
}
}
}
return nil

View File

@@ -1,24 +0,0 @@
dist: bionic
language: go
go:
- 1.12.x
- 1.13.x
env:
- GO111MODULE=off
services:
- docker
addons:
apt:
chrome: stable
before_install:
- mkdir -p $GOPATH/src/github.com/chromedp
- git clone https://github.com/chromedp/chromedp.git $GOPATH/src/github.com/chromedp/chromedp
- cd $GOPATH/src/github.com/chromedp/chromedp
- go get -d -t
script:
- cd $GOPATH/src/github.com/chromedp/cdproto
- go install ./...
- cd $GOPATH/src/github.com/chromedp/chromedp
- go test -v
- go test -c
- docker run --rm --volume=$PWD:/chromedp --entrypoint=/chromedp/chromedp.test --workdir=/chromedp --env=PATH=/headless-shell chromedp/headless-shell:latest -test.v

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016-2020 Kenneth Shaw
Copyright (c) 2016-2021 Kenneth Shaw
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -3,13 +3,16 @@
Package `cdproto` contains the generated commands, types, and events for the
[Chrome DevTools Protocol domains][devtools-protocol].
[![Unit Tests][cdproto-ci-status]][cdproto-ci]
[![Go Reference][goref-cdproto-status]][goref-cdproto]
This package is generated by the [`cdproto-gen`][cdproto-gen] command. Please
refer to that project and to the main [`chromedp`][chromedp] project for
information on using the commands, types, and events available here.
## API
Please see the [GoDoc listing][godoc].
Please see the [Go Reference][goref-cdproto].
## Contributing
@@ -17,7 +20,10 @@ If you would like to submit a change to the code in this package, please submit
your Pull Request to the [`cdproto-gen`][cdproto-gen] project. Any Issues and
Pull Requests submitted to this project will be closed without being reviewed.
[devtools-protocol]: https://chromedevtools.github.io/devtools-protocol/
[cdproto-ci]: https://github.com/chromedp/cdproto/actions/workflows/build.yml (Build CI)
[cdproto-ci-status]: https://github.com/chromedp/cdproto/actions/workflows/build.yml/badge.svg (Build CI)
[cdproto-gen]: https://github.com/chromedp/cdproto-gen
[chromedp]: https://github.com/chromedp/chromedp
[godoc]: https://godoc.org/github.com/chromedp/cdproto
[devtools-protocol]: https://chromedevtools.github.io/devtools-protocol/
[goref-cdproto]: https://pkg.go.dev/github.com/chromedp/cdproto
[goref-cdproto-status]: https://pkg.go.dev/badge/github.com/chromedp/chromedp.svg

View File

@@ -114,16 +114,28 @@ func (p *GetPartialAXTreeParams) Do(ctx context.Context) (nodes []*Node, err err
return res.Nodes, nil
}
// GetFullAXTreeParams fetches the entire accessibility tree.
type GetFullAXTreeParams struct{}
// GetFullAXTreeParams fetches the entire accessibility tree for the root
// Document.
type GetFullAXTreeParams struct {
MaxDepth int64 `json:"max_depth,omitempty"` // The maximum depth at which descendants of the root node should be retrieved. If omitted, the full tree is returned.
}
// GetFullAXTree fetches the entire accessibility tree.
// GetFullAXTree fetches the entire accessibility tree for the root Document.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Accessibility#method-getFullAXTree
//
// parameters:
func GetFullAXTree() *GetFullAXTreeParams {
return &GetFullAXTreeParams{}
}
// WithMaxDepth the maximum depth at which descendants of the root node
// should be retrieved. If omitted, the full tree is returned.
func (p GetFullAXTreeParams) WithMaxDepth(maxDepth int64) *GetFullAXTreeParams {
p.MaxDepth = maxDepth
return &p
}
// GetFullAXTreeReturns return values.
type GetFullAXTreeReturns struct {
Nodes []*Node `json:"nodes,omitempty"`
@@ -136,7 +148,127 @@ type GetFullAXTreeReturns struct {
func (p *GetFullAXTreeParams) Do(ctx context.Context) (nodes []*Node, err error) {
// execute
var res GetFullAXTreeReturns
err = cdp.Execute(ctx, CommandGetFullAXTree, nil, &res)
err = cdp.Execute(ctx, CommandGetFullAXTree, p, &res)
if err != nil {
return nil, err
}
return res.Nodes, nil
}
// GetChildAXNodesParams fetches a particular accessibility node by AXNodeId.
// Requires enable() to have been called previously.
type GetChildAXNodesParams struct {
ID NodeID `json:"id"`
}
// GetChildAXNodes fetches a particular accessibility node by AXNodeId.
// Requires enable() to have been called previously.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Accessibility#method-getChildAXNodes
//
// parameters:
// id
func GetChildAXNodes(id NodeID) *GetChildAXNodesParams {
return &GetChildAXNodesParams{
ID: id,
}
}
// GetChildAXNodesReturns return values.
type GetChildAXNodesReturns struct {
Nodes []*Node `json:"nodes,omitempty"`
}
// Do executes Accessibility.getChildAXNodes against the provided context.
//
// returns:
// nodes
func (p *GetChildAXNodesParams) Do(ctx context.Context) (nodes []*Node, err error) {
// execute
var res GetChildAXNodesReturns
err = cdp.Execute(ctx, CommandGetChildAXNodes, p, &res)
if err != nil {
return nil, err
}
return res.Nodes, nil
}
// QueryAXTreeParams query a DOM node's accessibility subtree for accessible
// name and role. This command computes the name and role for all nodes in the
// subtree, including those that are ignored for accessibility, and returns
// those that mactch the specified name and role. If no DOM node is specified,
// or the DOM node does not exist, the command returns an error. If neither
// accessibleName or role is specified, it returns all the accessibility nodes
// in the subtree.
type QueryAXTreeParams struct {
NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node for the root to query.
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node for the root to query.
ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node wrapper for the root to query.
AccessibleName string `json:"accessibleName,omitempty"` // Find nodes with this computed name.
Role string `json:"role,omitempty"` // Find nodes with this computed role.
}
// QueryAXTree query a DOM node's accessibility subtree for accessible name
// and role. This command computes the name and role for all nodes in the
// subtree, including those that are ignored for accessibility, and returns
// those that mactch the specified name and role. If no DOM node is specified,
// or the DOM node does not exist, the command returns an error. If neither
// accessibleName or role is specified, it returns all the accessibility nodes
// in the subtree.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Accessibility#method-queryAXTree
//
// parameters:
func QueryAXTree() *QueryAXTreeParams {
return &QueryAXTreeParams{}
}
// WithNodeID identifier of the node for the root to query.
func (p QueryAXTreeParams) WithNodeID(nodeID cdp.NodeID) *QueryAXTreeParams {
p.NodeID = nodeID
return &p
}
// WithBackendNodeID identifier of the backend node for the root to query.
func (p QueryAXTreeParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *QueryAXTreeParams {
p.BackendNodeID = backendNodeID
return &p
}
// WithObjectID JavaScript object id of the node wrapper for the root to
// query.
func (p QueryAXTreeParams) WithObjectID(objectID runtime.RemoteObjectID) *QueryAXTreeParams {
p.ObjectID = objectID
return &p
}
// WithAccessibleName find nodes with this computed name.
func (p QueryAXTreeParams) WithAccessibleName(accessibleName string) *QueryAXTreeParams {
p.AccessibleName = accessibleName
return &p
}
// WithRole find nodes with this computed role.
func (p QueryAXTreeParams) WithRole(role string) *QueryAXTreeParams {
p.Role = role
return &p
}
// QueryAXTreeReturns return values.
type QueryAXTreeReturns struct {
Nodes []*Node `json:"nodes,omitempty"` // A list of Accessibility.AXNode matching the specified attributes, including nodes that are ignored for accessibility.
}
// Do executes Accessibility.queryAXTree against the provided context.
//
// returns:
// nodes - A list of Accessibility.AXNode matching the specified attributes, including nodes that are ignored for accessibility.
func (p *QueryAXTreeParams) Do(ctx context.Context) (nodes []*Node, err error) {
// execute
var res QueryAXTreeReturns
err = cdp.Execute(ctx, CommandQueryAXTree, p, &res)
if err != nil {
return nil, err
}
@@ -150,4 +282,6 @@ const (
CommandEnable = "Accessibility.enable"
CommandGetPartialAXTree = "Accessibility.getPartialAXTree"
CommandGetFullAXTree = "Accessibility.getFullAXTree"
CommandGetChildAXNodes = "Accessibility.getChildAXNodes"
CommandQueryAXTree = "Accessibility.queryAXTree"
)

File diff suppressed because it is too large Load Diff

View File

@@ -179,14 +179,15 @@ func (t ValueNativeSourceType) String() string {
// ValueNativeSourceType values.
const (
ValueNativeSourceTypeFigcaption ValueNativeSourceType = "figcaption"
ValueNativeSourceTypeLabel ValueNativeSourceType = "label"
ValueNativeSourceTypeLabelfor ValueNativeSourceType = "labelfor"
ValueNativeSourceTypeLabelwrapped ValueNativeSourceType = "labelwrapped"
ValueNativeSourceTypeLegend ValueNativeSourceType = "legend"
ValueNativeSourceTypeTablecaption ValueNativeSourceType = "tablecaption"
ValueNativeSourceTypeTitle ValueNativeSourceType = "title"
ValueNativeSourceTypeOther ValueNativeSourceType = "other"
ValueNativeSourceTypeFigcaption ValueNativeSourceType = "figcaption"
ValueNativeSourceTypeLabel ValueNativeSourceType = "label"
ValueNativeSourceTypeLabelfor ValueNativeSourceType = "labelfor"
ValueNativeSourceTypeLabelwrapped ValueNativeSourceType = "labelwrapped"
ValueNativeSourceTypeLegend ValueNativeSourceType = "legend"
ValueNativeSourceTypeRubyannotation ValueNativeSourceType = "rubyannotation"
ValueNativeSourceTypeTablecaption ValueNativeSourceType = "tablecaption"
ValueNativeSourceTypeTitle ValueNativeSourceType = "title"
ValueNativeSourceTypeOther ValueNativeSourceType = "other"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -212,6 +213,8 @@ func (t *ValueNativeSourceType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = ValueNativeSourceTypeLabelwrapped
case ValueNativeSourceTypeLegend:
*t = ValueNativeSourceTypeLegend
case ValueNativeSourceTypeRubyannotation:
*t = ValueNativeSourceTypeRubyannotation
case ValueNativeSourceTypeTablecaption:
*t = ValueNativeSourceTypeTablecaption
case ValueNativeSourceTypeTitle:

View File

@@ -29,7 +29,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -109,7 +109,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation1(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -175,7 +175,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation2(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -280,7 +280,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation3(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -385,7 +385,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation4(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -460,7 +460,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation5(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -526,7 +526,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation6(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -624,7 +624,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation7(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -747,7 +747,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation8(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -820,7 +820,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation9(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -887,7 +887,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation10(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -946,7 +946,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation11(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1013,7 +1013,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation12(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1079,7 +1079,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation13(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1157,7 +1157,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation14(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1223,7 +1223,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation15(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1289,7 +1289,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation16(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1348,7 +1348,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation17(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1485,7 +1485,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation18(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1544,7 +1544,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoAnimation19(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache(in *jlexer.L
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -108,7 +108,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache1(in *jlexer.
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -175,7 +175,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache2(in *jlexer.
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -241,7 +241,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache3(in *jlexer.
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -350,7 +350,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache4(in *jlexer.
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -409,7 +409,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache5(in *jlexer.
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -484,7 +484,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache6(in *jlexer.
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -550,7 +550,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache7(in *jlexer.
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -630,7 +630,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache8(in *jlexer.
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -696,7 +696,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache9(in *jlexer.
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -776,7 +776,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache10(in *jlexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -835,7 +835,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache11(in *jlexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -118,9 +118,37 @@ func (p *EnableParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandEnable, nil, nil)
}
// CheckContrastParams runs the contrast check for the target page. Found
// issues are reported using Audits.issueAdded event.
type CheckContrastParams struct {
ReportAAA bool `json:"reportAAA,omitempty"` // Whether to report WCAG AAA level issues. Default is false.
}
// CheckContrast runs the contrast check for the target page. Found issues
// are reported using Audits.issueAdded event.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#method-checkContrast
//
// parameters:
func CheckContrast() *CheckContrastParams {
return &CheckContrastParams{}
}
// WithReportAAA whether to report WCAG AAA level issues. Default is false.
func (p CheckContrastParams) WithReportAAA(reportAAA bool) *CheckContrastParams {
p.ReportAAA = reportAAA
return &p
}
// Do executes Audits.checkContrast against the provided context.
func (p *CheckContrastParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandCheckContrast, p, nil)
}
// Command names.
const (
CommandGetEncodedResponse = "Audits.getEncodedResponse"
CommandDisable = "Audits.disable"
CommandEnable = "Audits.enable"
CommandCheckContrast = "Audits.checkContrast"
)

File diff suppressed because it is too large Load Diff

View File

@@ -7,6 +7,7 @@ import (
"github.com/chromedp/cdproto/cdp"
"github.com/chromedp/cdproto/network"
"github.com/chromedp/cdproto/runtime"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
@@ -52,6 +53,9 @@ func (t SameSiteCookieExclusionReason) String() string {
const (
SameSiteCookieExclusionReasonExcludeSameSiteUnspecifiedTreatedAsLax SameSiteCookieExclusionReason = "ExcludeSameSiteUnspecifiedTreatedAsLax"
SameSiteCookieExclusionReasonExcludeSameSiteNoneInsecure SameSiteCookieExclusionReason = "ExcludeSameSiteNoneInsecure"
SameSiteCookieExclusionReasonExcludeSameSiteLax SameSiteCookieExclusionReason = "ExcludeSameSiteLax"
SameSiteCookieExclusionReasonExcludeSameSiteStrict SameSiteCookieExclusionReason = "ExcludeSameSiteStrict"
SameSiteCookieExclusionReasonExcludeInvalidSameParty SameSiteCookieExclusionReason = "ExcludeInvalidSameParty"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -71,6 +75,12 @@ func (t *SameSiteCookieExclusionReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = SameSiteCookieExclusionReasonExcludeSameSiteUnspecifiedTreatedAsLax
case SameSiteCookieExclusionReasonExcludeSameSiteNoneInsecure:
*t = SameSiteCookieExclusionReasonExcludeSameSiteNoneInsecure
case SameSiteCookieExclusionReasonExcludeSameSiteLax:
*t = SameSiteCookieExclusionReasonExcludeSameSiteLax
case SameSiteCookieExclusionReasonExcludeSameSiteStrict:
*t = SameSiteCookieExclusionReasonExcludeSameSiteStrict
case SameSiteCookieExclusionReasonExcludeInvalidSameParty:
*t = SameSiteCookieExclusionReasonExcludeInvalidSameParty
default:
in.AddError(errors.New("unknown SameSiteCookieExclusionReason value"))
@@ -194,7 +204,8 @@ func (t *SameSiteCookieOperation) UnmarshalJSON(buf []byte) error {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-SameSiteCookieIssueDetails
type SameSiteCookieIssueDetails struct {
Cookie *AffectedCookie `json:"cookie"`
Cookie *AffectedCookie `json:"cookie,omitempty"` // If AffectedCookie is not set then rawCookieLine contains the raw Set-Cookie header string. This hints at a problem where the cookie line is syntactically or semantically malformed in a way that no valid cookie could be created.
RawCookieLine string `json:"rawCookieLine,omitempty"`
CookieWarningReasons []SameSiteCookieWarningReason `json:"cookieWarningReasons"`
CookieExclusionReasons []SameSiteCookieExclusionReason `json:"cookieExclusionReasons"`
Operation SameSiteCookieOperation `json:"operation"` // Optionally identifies the site-for-cookies and the cookie url, which may be used by the front-end as additional context.
@@ -438,9 +449,412 @@ func (t *BlockedByResponseReason) UnmarshalJSON(buf []byte) error {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-BlockedByResponseIssueDetails
type BlockedByResponseIssueDetails struct {
Request *AffectedRequest `json:"request"`
Frame *AffectedFrame `json:"frame,omitempty"`
Reason BlockedByResponseReason `json:"reason"`
Request *AffectedRequest `json:"request"`
ParentFrame *AffectedFrame `json:"parentFrame,omitempty"`
BlockedFrame *AffectedFrame `json:"blockedFrame,omitempty"`
Reason BlockedByResponseReason `json:"reason"`
}
// HeavyAdResolutionStatus [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-HeavyAdResolutionStatus
type HeavyAdResolutionStatus string
// String returns the HeavyAdResolutionStatus as string value.
func (t HeavyAdResolutionStatus) String() string {
return string(t)
}
// HeavyAdResolutionStatus values.
const (
HeavyAdResolutionStatusHeavyAdBlocked HeavyAdResolutionStatus = "HeavyAdBlocked"
HeavyAdResolutionStatusHeavyAdWarning HeavyAdResolutionStatus = "HeavyAdWarning"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t HeavyAdResolutionStatus) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t HeavyAdResolutionStatus) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *HeavyAdResolutionStatus) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch HeavyAdResolutionStatus(in.String()) {
case HeavyAdResolutionStatusHeavyAdBlocked:
*t = HeavyAdResolutionStatusHeavyAdBlocked
case HeavyAdResolutionStatusHeavyAdWarning:
*t = HeavyAdResolutionStatusHeavyAdWarning
default:
in.AddError(errors.New("unknown HeavyAdResolutionStatus value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *HeavyAdResolutionStatus) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// HeavyAdReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-HeavyAdReason
type HeavyAdReason string
// String returns the HeavyAdReason as string value.
func (t HeavyAdReason) String() string {
return string(t)
}
// HeavyAdReason values.
const (
HeavyAdReasonNetworkTotalLimit HeavyAdReason = "NetworkTotalLimit"
HeavyAdReasonCPUTotalLimit HeavyAdReason = "CpuTotalLimit"
HeavyAdReasonCPUPeakLimit HeavyAdReason = "CpuPeakLimit"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t HeavyAdReason) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t HeavyAdReason) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *HeavyAdReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch HeavyAdReason(in.String()) {
case HeavyAdReasonNetworkTotalLimit:
*t = HeavyAdReasonNetworkTotalLimit
case HeavyAdReasonCPUTotalLimit:
*t = HeavyAdReasonCPUTotalLimit
case HeavyAdReasonCPUPeakLimit:
*t = HeavyAdReasonCPUPeakLimit
default:
in.AddError(errors.New("unknown HeavyAdReason value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *HeavyAdReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// HeavyAdIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-HeavyAdIssueDetails
type HeavyAdIssueDetails struct {
Resolution HeavyAdResolutionStatus `json:"resolution"` // The resolution status, either blocking the content or warning.
Reason HeavyAdReason `json:"reason"` // The reason the ad was blocked, total network or cpu or peak cpu.
Frame *AffectedFrame `json:"frame"` // The frame that was blocked.
}
// ContentSecurityPolicyViolationType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-ContentSecurityPolicyViolationType
type ContentSecurityPolicyViolationType string
// String returns the ContentSecurityPolicyViolationType as string value.
func (t ContentSecurityPolicyViolationType) String() string {
return string(t)
}
// ContentSecurityPolicyViolationType values.
const (
ContentSecurityPolicyViolationTypeKInlineViolation ContentSecurityPolicyViolationType = "kInlineViolation"
ContentSecurityPolicyViolationTypeKEvalViolation ContentSecurityPolicyViolationType = "kEvalViolation"
ContentSecurityPolicyViolationTypeKURLViolation ContentSecurityPolicyViolationType = "kURLViolation"
ContentSecurityPolicyViolationTypeKTrustedTypesSinkViolation ContentSecurityPolicyViolationType = "kTrustedTypesSinkViolation"
ContentSecurityPolicyViolationTypeKTrustedTypesPolicyViolation ContentSecurityPolicyViolationType = "kTrustedTypesPolicyViolation"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t ContentSecurityPolicyViolationType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t ContentSecurityPolicyViolationType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *ContentSecurityPolicyViolationType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch ContentSecurityPolicyViolationType(in.String()) {
case ContentSecurityPolicyViolationTypeKInlineViolation:
*t = ContentSecurityPolicyViolationTypeKInlineViolation
case ContentSecurityPolicyViolationTypeKEvalViolation:
*t = ContentSecurityPolicyViolationTypeKEvalViolation
case ContentSecurityPolicyViolationTypeKURLViolation:
*t = ContentSecurityPolicyViolationTypeKURLViolation
case ContentSecurityPolicyViolationTypeKTrustedTypesSinkViolation:
*t = ContentSecurityPolicyViolationTypeKTrustedTypesSinkViolation
case ContentSecurityPolicyViolationTypeKTrustedTypesPolicyViolation:
*t = ContentSecurityPolicyViolationTypeKTrustedTypesPolicyViolation
default:
in.AddError(errors.New("unknown ContentSecurityPolicyViolationType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *ContentSecurityPolicyViolationType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// SourceCodeLocation [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-SourceCodeLocation
type SourceCodeLocation struct {
ScriptID runtime.ScriptID `json:"scriptId,omitempty"`
URL string `json:"url"`
LineNumber int64 `json:"lineNumber"`
ColumnNumber int64 `json:"columnNumber"`
}
// ContentSecurityPolicyIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-ContentSecurityPolicyIssueDetails
type ContentSecurityPolicyIssueDetails struct {
BlockedURL string `json:"blockedURL,omitempty"` // The url not included in allowed sources.
ViolatedDirective string `json:"violatedDirective"` // Specific directive that is violated, causing the CSP issue.
IsReportOnly bool `json:"isReportOnly"`
ContentSecurityPolicyViolationType ContentSecurityPolicyViolationType `json:"contentSecurityPolicyViolationType"`
FrameAncestor *AffectedFrame `json:"frameAncestor,omitempty"`
SourceCodeLocation *SourceCodeLocation `json:"sourceCodeLocation,omitempty"`
ViolatingNodeID cdp.BackendNodeID `json:"violatingNodeId,omitempty"`
}
// SharedArrayBufferIssueType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-SharedArrayBufferIssueType
type SharedArrayBufferIssueType string
// String returns the SharedArrayBufferIssueType as string value.
func (t SharedArrayBufferIssueType) String() string {
return string(t)
}
// SharedArrayBufferIssueType values.
const (
SharedArrayBufferIssueTypeTransferIssue SharedArrayBufferIssueType = "TransferIssue"
SharedArrayBufferIssueTypeCreationIssue SharedArrayBufferIssueType = "CreationIssue"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t SharedArrayBufferIssueType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t SharedArrayBufferIssueType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *SharedArrayBufferIssueType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch SharedArrayBufferIssueType(in.String()) {
case SharedArrayBufferIssueTypeTransferIssue:
*t = SharedArrayBufferIssueTypeTransferIssue
case SharedArrayBufferIssueTypeCreationIssue:
*t = SharedArrayBufferIssueTypeCreationIssue
default:
in.AddError(errors.New("unknown SharedArrayBufferIssueType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *SharedArrayBufferIssueType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// SharedArrayBufferIssueDetails details for a issue arising from an SAB
// being instantiated in, or transferred to a context that is not cross-origin
// isolated.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-SharedArrayBufferIssueDetails
type SharedArrayBufferIssueDetails struct {
SourceCodeLocation *SourceCodeLocation `json:"sourceCodeLocation"`
IsWarning bool `json:"isWarning"`
Type SharedArrayBufferIssueType `json:"type"`
}
// TwaQualityEnforcementViolationType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-TwaQualityEnforcementViolationType
type TwaQualityEnforcementViolationType string
// String returns the TwaQualityEnforcementViolationType as string value.
func (t TwaQualityEnforcementViolationType) String() string {
return string(t)
}
// TwaQualityEnforcementViolationType values.
const (
TwaQualityEnforcementViolationTypeKHTTPError TwaQualityEnforcementViolationType = "kHttpError"
TwaQualityEnforcementViolationTypeKUnavailableOffline TwaQualityEnforcementViolationType = "kUnavailableOffline"
TwaQualityEnforcementViolationTypeKDigitalAssetLinks TwaQualityEnforcementViolationType = "kDigitalAssetLinks"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t TwaQualityEnforcementViolationType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t TwaQualityEnforcementViolationType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *TwaQualityEnforcementViolationType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch TwaQualityEnforcementViolationType(in.String()) {
case TwaQualityEnforcementViolationTypeKHTTPError:
*t = TwaQualityEnforcementViolationTypeKHTTPError
case TwaQualityEnforcementViolationTypeKUnavailableOffline:
*t = TwaQualityEnforcementViolationTypeKUnavailableOffline
case TwaQualityEnforcementViolationTypeKDigitalAssetLinks:
*t = TwaQualityEnforcementViolationTypeKDigitalAssetLinks
default:
in.AddError(errors.New("unknown TwaQualityEnforcementViolationType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *TwaQualityEnforcementViolationType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// TrustedWebActivityIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-TrustedWebActivityIssueDetails
type TrustedWebActivityIssueDetails struct {
URL string `json:"url"` // The url that triggers the violation.
ViolationType TwaQualityEnforcementViolationType `json:"violationType"`
HTTPStatusCode int64 `json:"httpStatusCode,omitempty"`
PackageName string `json:"packageName,omitempty"` // The package name of the Trusted Web Activity client app. This field is only used when violation type is kDigitalAssetLinks.
Signature string `json:"signature,omitempty"` // The signature of the Trusted Web Activity client app. This field is only used when violation type is kDigitalAssetLinks.
}
// LowTextContrastIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-LowTextContrastIssueDetails
type LowTextContrastIssueDetails struct {
ViolatingNodeID cdp.BackendNodeID `json:"violatingNodeId"`
ViolatingNodeSelector string `json:"violatingNodeSelector"`
ContrastRatio float64 `json:"contrastRatio"`
ThresholdAA float64 `json:"thresholdAA"`
ThresholdAAA float64 `json:"thresholdAAA"`
FontSize string `json:"fontSize"`
FontWeight string `json:"fontWeight"`
}
// CorsIssueDetails details for a CORS related issue, e.g. a warning or error
// related to CORS RFC1918 enforcement.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-CorsIssueDetails
type CorsIssueDetails struct {
CorsErrorStatus *network.CorsErrorStatus `json:"corsErrorStatus"`
IsWarning bool `json:"isWarning"`
Request *AffectedRequest `json:"request"`
Location *SourceCodeLocation `json:"location,omitempty"`
InitiatorOrigin string `json:"initiatorOrigin,omitempty"`
ResourceIPAddressSpace network.IPAddressSpace `json:"resourceIPAddressSpace,omitempty"`
ClientSecurityState *network.ClientSecurityState `json:"clientSecurityState,omitempty"`
}
// AttributionReportingIssueType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-AttributionReportingIssueType
type AttributionReportingIssueType string
// String returns the AttributionReportingIssueType as string value.
func (t AttributionReportingIssueType) String() string {
return string(t)
}
// AttributionReportingIssueType values.
const (
AttributionReportingIssueTypePermissionPolicyDisabled AttributionReportingIssueType = "PermissionPolicyDisabled"
AttributionReportingIssueTypeInvalidAttributionSourceEventID AttributionReportingIssueType = "InvalidAttributionSourceEventId"
AttributionReportingIssueTypeInvalidAttributionData AttributionReportingIssueType = "InvalidAttributionData"
AttributionReportingIssueTypeAttributionSourceUntrustworthyOrigin AttributionReportingIssueType = "AttributionSourceUntrustworthyOrigin"
AttributionReportingIssueTypeAttributionUntrustworthyOrigin AttributionReportingIssueType = "AttributionUntrustworthyOrigin"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t AttributionReportingIssueType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t AttributionReportingIssueType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *AttributionReportingIssueType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch AttributionReportingIssueType(in.String()) {
case AttributionReportingIssueTypePermissionPolicyDisabled:
*t = AttributionReportingIssueTypePermissionPolicyDisabled
case AttributionReportingIssueTypeInvalidAttributionSourceEventID:
*t = AttributionReportingIssueTypeInvalidAttributionSourceEventID
case AttributionReportingIssueTypeInvalidAttributionData:
*t = AttributionReportingIssueTypeInvalidAttributionData
case AttributionReportingIssueTypeAttributionSourceUntrustworthyOrigin:
*t = AttributionReportingIssueTypeAttributionSourceUntrustworthyOrigin
case AttributionReportingIssueTypeAttributionUntrustworthyOrigin:
*t = AttributionReportingIssueTypeAttributionUntrustworthyOrigin
default:
in.AddError(errors.New("unknown AttributionReportingIssueType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *AttributionReportingIssueType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// AttributionReportingIssueDetails details for issues around "Attribution
// Reporting API" usage. Explainer:
// https://github.com/WICG/conversion-measurement-api.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-AttributionReportingIssueDetails
type AttributionReportingIssueDetails struct {
ViolationType AttributionReportingIssueType `json:"violationType"`
Frame *AffectedFrame `json:"frame,omitempty"`
Request *AffectedRequest `json:"request,omitempty"`
ViolatingNodeID cdp.BackendNodeID `json:"violatingNodeId,omitempty"`
InvalidParameter string `json:"invalidParameter,omitempty"`
}
// QuirksModeIssueDetails details for issues about documents in Quirks Mode
// or Limited Quirks Mode that affects page layouting.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-QuirksModeIssueDetails
type QuirksModeIssueDetails struct {
IsLimitedQuirksMode bool `json:"isLimitedQuirksMode"` // If false, it means the document's mode is "quirks" instead of "limited-quirks".
DocumentNodeID cdp.BackendNodeID `json:"documentNodeId"`
URL string `json:"url"`
FrameID cdp.FrameID `json:"frameId"`
LoaderID cdp.LoaderID `json:"loaderId"`
}
// NavigatorUserAgentIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-NavigatorUserAgentIssueDetails
type NavigatorUserAgentIssueDetails struct {
URL string `json:"url"`
Location *SourceCodeLocation `json:"location,omitempty"`
}
// InspectorIssueCode a unique identifier for the type of issue. Each type
@@ -457,9 +871,18 @@ func (t InspectorIssueCode) String() string {
// InspectorIssueCode values.
const (
InspectorIssueCodeSameSiteCookieIssue InspectorIssueCode = "SameSiteCookieIssue"
InspectorIssueCodeMixedContentIssue InspectorIssueCode = "MixedContentIssue"
InspectorIssueCodeBlockedByResponseIssue InspectorIssueCode = "BlockedByResponseIssue"
InspectorIssueCodeSameSiteCookieIssue InspectorIssueCode = "SameSiteCookieIssue"
InspectorIssueCodeMixedContentIssue InspectorIssueCode = "MixedContentIssue"
InspectorIssueCodeBlockedByResponseIssue InspectorIssueCode = "BlockedByResponseIssue"
InspectorIssueCodeHeavyAdIssue InspectorIssueCode = "HeavyAdIssue"
InspectorIssueCodeContentSecurityPolicyIssue InspectorIssueCode = "ContentSecurityPolicyIssue"
InspectorIssueCodeSharedArrayBufferIssue InspectorIssueCode = "SharedArrayBufferIssue"
InspectorIssueCodeTrustedWebActivityIssue InspectorIssueCode = "TrustedWebActivityIssue"
InspectorIssueCodeLowTextContrastIssue InspectorIssueCode = "LowTextContrastIssue"
InspectorIssueCodeCorsIssue InspectorIssueCode = "CorsIssue"
InspectorIssueCodeAttributionReportingIssue InspectorIssueCode = "AttributionReportingIssue"
InspectorIssueCodeQuirksModeIssue InspectorIssueCode = "QuirksModeIssue"
InspectorIssueCodeNavigatorUserAgentIssue InspectorIssueCode = "NavigatorUserAgentIssue"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -481,6 +904,24 @@ func (t *InspectorIssueCode) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = InspectorIssueCodeMixedContentIssue
case InspectorIssueCodeBlockedByResponseIssue:
*t = InspectorIssueCodeBlockedByResponseIssue
case InspectorIssueCodeHeavyAdIssue:
*t = InspectorIssueCodeHeavyAdIssue
case InspectorIssueCodeContentSecurityPolicyIssue:
*t = InspectorIssueCodeContentSecurityPolicyIssue
case InspectorIssueCodeSharedArrayBufferIssue:
*t = InspectorIssueCodeSharedArrayBufferIssue
case InspectorIssueCodeTrustedWebActivityIssue:
*t = InspectorIssueCodeTrustedWebActivityIssue
case InspectorIssueCodeLowTextContrastIssue:
*t = InspectorIssueCodeLowTextContrastIssue
case InspectorIssueCodeCorsIssue:
*t = InspectorIssueCodeCorsIssue
case InspectorIssueCodeAttributionReportingIssue:
*t = InspectorIssueCodeAttributionReportingIssue
case InspectorIssueCodeQuirksModeIssue:
*t = InspectorIssueCodeQuirksModeIssue
case InspectorIssueCodeNavigatorUserAgentIssue:
*t = InspectorIssueCodeNavigatorUserAgentIssue
default:
in.AddError(errors.New("unknown InspectorIssueCode value"))
@@ -498,9 +939,18 @@ func (t *InspectorIssueCode) UnmarshalJSON(buf []byte) error {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-InspectorIssueDetails
type InspectorIssueDetails struct {
SameSiteCookieIssueDetails *SameSiteCookieIssueDetails `json:"sameSiteCookieIssueDetails,omitempty"`
MixedContentIssueDetails *MixedContentIssueDetails `json:"mixedContentIssueDetails,omitempty"`
BlockedByResponseIssueDetails *BlockedByResponseIssueDetails `json:"blockedByResponseIssueDetails,omitempty"`
SameSiteCookieIssueDetails *SameSiteCookieIssueDetails `json:"sameSiteCookieIssueDetails,omitempty"`
MixedContentIssueDetails *MixedContentIssueDetails `json:"mixedContentIssueDetails,omitempty"`
BlockedByResponseIssueDetails *BlockedByResponseIssueDetails `json:"blockedByResponseIssueDetails,omitempty"`
HeavyAdIssueDetails *HeavyAdIssueDetails `json:"heavyAdIssueDetails,omitempty"`
ContentSecurityPolicyIssueDetails *ContentSecurityPolicyIssueDetails `json:"contentSecurityPolicyIssueDetails,omitempty"`
SharedArrayBufferIssueDetails *SharedArrayBufferIssueDetails `json:"sharedArrayBufferIssueDetails,omitempty"`
TwaQualityEnforcementDetails *TrustedWebActivityIssueDetails `json:"twaQualityEnforcementDetails,omitempty"`
LowTextContrastIssueDetails *LowTextContrastIssueDetails `json:"lowTextContrastIssueDetails,omitempty"`
CorsIssueDetails *CorsIssueDetails `json:"corsIssueDetails,omitempty"`
AttributionReportingIssueDetails *AttributionReportingIssueDetails `json:"attributionReportingIssueDetails,omitempty"`
QuirksModeIssueDetails *QuirksModeIssueDetails `json:"quirksModeIssueDetails,omitempty"`
NavigatorUserAgentIssueDetails *NavigatorUserAgentIssueDetails `json:"navigatorUserAgentIssueDetails,omitempty"`
}
// InspectorIssue an inspector issue reported from the back-end.
@@ -509,6 +959,7 @@ type InspectorIssueDetails struct {
type InspectorIssue struct {
Code InspectorIssueCode `json:"code"`
Details *InspectorIssueDetails `json:"details"`
IssueID string `json:"issueId,omitempty"` // A unique id for this issue. May be omitted if no other entity (e.g. exception, CDP message, etc.) is referencing this issue.
}
// GetEncodedResponseEncoding the encoding to use.

View File

@@ -30,7 +30,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBackgroundservice(in *jlexer.
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -96,7 +96,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBackgroundservice1(in *jlexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -162,7 +162,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBackgroundservice2(in *jlexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -235,7 +235,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBackgroundservice3(in *jlexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -308,7 +308,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBackgroundservice4(in *jlexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -381,7 +381,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBackgroundservice5(in *jlexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -459,7 +459,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBackgroundservice6(in *jlexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -623,7 +623,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBackgroundservice7(in *jlexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -125,6 +125,7 @@ type SetDownloadBehaviorParams struct {
Behavior SetDownloadBehaviorBehavior `json:"behavior"` // Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). |allowAndName| allows download and names files according to their dowmload guids.
BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty"` // BrowserContext to set download behavior. When omitted, default browser context is used.
DownloadPath string `json:"downloadPath,omitempty"` // The default path to save downloaded files to. This is required if behavior is set to 'allow' or 'allowAndName'.
EventsEnabled bool `json:"eventsEnabled,omitempty"` // Whether to emit download events (defaults to false).
}
// SetDownloadBehavior set the behavior when downloading a file.
@@ -153,11 +154,47 @@ func (p SetDownloadBehaviorParams) WithDownloadPath(downloadPath string) *SetDow
return &p
}
// WithEventsEnabled whether to emit download events (defaults to false).
func (p SetDownloadBehaviorParams) WithEventsEnabled(eventsEnabled bool) *SetDownloadBehaviorParams {
p.EventsEnabled = eventsEnabled
return &p
}
// Do executes Browser.setDownloadBehavior against the provided context.
func (p *SetDownloadBehaviorParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDownloadBehavior, p, nil)
}
// CancelDownloadParams cancel a download if in progress.
type CancelDownloadParams struct {
GUID string `json:"guid"` // Global unique identifier of the download.
BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty"` // BrowserContext to perform the action in. When omitted, default browser context is used.
}
// CancelDownload cancel a download if in progress.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-cancelDownload
//
// parameters:
// guid - Global unique identifier of the download.
func CancelDownload(guid string) *CancelDownloadParams {
return &CancelDownloadParams{
GUID: guid,
}
}
// WithBrowserContextID browserContext to perform the action in. When
// omitted, default browser context is used.
func (p CancelDownloadParams) WithBrowserContextID(browserContextID cdp.BrowserContextID) *CancelDownloadParams {
p.BrowserContextID = browserContextID
return &p
}
// Do executes Browser.cancelDownload against the provided context.
func (p *CancelDownloadParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandCancelDownload, p, nil)
}
// CloseParams close browser gracefully.
type CloseParams struct{}
@@ -505,12 +542,36 @@ func (p *SetDockTileParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDockTile, p, nil)
}
// ExecuteBrowserCommandParams invoke custom browser commands used by
// telemetry.
type ExecuteBrowserCommandParams struct {
CommandID CommandID `json:"commandId"`
}
// ExecuteBrowserCommand invoke custom browser commands used by telemetry.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-executeBrowserCommand
//
// parameters:
// commandID
func ExecuteBrowserCommand(commandID CommandID) *ExecuteBrowserCommandParams {
return &ExecuteBrowserCommandParams{
CommandID: commandID,
}
}
// Do executes Browser.executeBrowserCommand against the provided context.
func (p *ExecuteBrowserCommandParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandExecuteBrowserCommand, p, nil)
}
// Command names.
const (
CommandSetPermission = "Browser.setPermission"
CommandGrantPermissions = "Browser.grantPermissions"
CommandResetPermissions = "Browser.resetPermissions"
CommandSetDownloadBehavior = "Browser.setDownloadBehavior"
CommandCancelDownload = "Browser.cancelDownload"
CommandClose = "Browser.close"
CommandCrash = "Browser.crash"
CommandCrashGpuProcess = "Browser.crashGpuProcess"
@@ -522,4 +583,5 @@ const (
CommandGetWindowForTarget = "Browser.getWindowForTarget"
CommandSetWindowBounds = "Browser.setWindowBounds"
CommandSetDockTile = "Browser.setDockTile"
CommandExecuteBrowserCommand = "Browser.executeBrowserCommand"
)

View File

@@ -30,7 +30,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -115,7 +115,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser1(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -214,7 +214,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser2(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -228,6 +228,8 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser2(in *jlexer.Lexer, ou
out.BrowserContextID = cdp.BrowserContextID(in.String())
case "downloadPath":
out.DownloadPath = string(in.String())
case "eventsEnabled":
out.EventsEnabled = bool(in.Bool())
default:
in.SkipRecursive()
}
@@ -257,6 +259,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser2(out *jwriter.Writer,
out.RawString(prefix)
out.String(string(in.DownloadPath))
}
if in.EventsEnabled {
const prefix string = ",\"eventsEnabled\":"
out.RawString(prefix)
out.Bool(bool(in.EventsEnabled))
}
out.RawByte('}')
}
@@ -294,7 +301,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser3(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -373,7 +380,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser4(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -440,7 +447,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser5(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -454,10 +461,10 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser5(in *jlexer.Lexer, ou
out.Sysex = bool(in.Bool())
case "userVisibleOnly":
out.UserVisibleOnly = bool(in.Bool())
case "type":
out.Type = string(in.String())
case "allowWithoutSanitization":
out.AllowWithoutSanitization = bool(in.Bool())
case "panTiltZoom":
out.PanTiltZoom = bool(in.Bool())
default:
in.SkipRecursive()
}
@@ -487,16 +494,16 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser5(out *jwriter.Writer,
out.RawString(prefix)
out.Bool(bool(in.UserVisibleOnly))
}
if in.Type != "" {
const prefix string = ",\"type\":"
out.RawString(prefix)
out.String(string(in.Type))
}
if in.AllowWithoutSanitization {
const prefix string = ",\"allowWithoutSanitization\":"
out.RawString(prefix)
out.Bool(bool(in.AllowWithoutSanitization))
}
if in.PanTiltZoom {
const prefix string = ",\"panTiltZoom\":"
out.RawString(prefix)
out.Bool(bool(in.PanTiltZoom))
}
out.RawByte('}')
}
@@ -534,7 +541,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser6(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -665,7 +672,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser7(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -777,7 +784,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser8(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -864,7 +871,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser9(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -931,7 +938,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser10(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1006,7 +1013,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser11(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1072,7 +1079,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser12(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1187,7 +1194,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser13(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1246,7 +1253,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser14(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1355,7 +1362,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser15(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1434,7 +1441,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser16(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1509,7 +1516,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser17(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1582,7 +1589,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser18(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1679,7 +1686,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser19(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1727,7 +1734,7 @@ func (v *GetBrowserCommandLineParams) UnmarshalJSON(data []byte) error {
func (v *GetBrowserCommandLineParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser19(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser20(in *jlexer.Lexer, out *CrashParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser20(in *jlexer.Lexer, out *ExecuteBrowserCommandParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -1738,7 +1745,247 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser20(in *jlexer.Lexer, o
}
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 "commandId":
(out.CommandID).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser20(out *jwriter.Writer, in ExecuteBrowserCommandParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"commandId\":"
out.RawString(prefix[1:])
(in.CommandID).MarshalEasyJSON(out)
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v ExecuteBrowserCommandParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser20(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ExecuteBrowserCommandParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser20(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ExecuteBrowserCommandParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser20(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ExecuteBrowserCommandParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser20(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser21(in *jlexer.Lexer, out *EventDownloadWillBegin) {
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 "frameId":
(out.FrameID).UnmarshalEasyJSON(in)
case "guid":
out.GUID = string(in.String())
case "url":
out.URL = string(in.String())
case "suggestedFilename":
out.SuggestedFilename = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser21(out *jwriter.Writer, in EventDownloadWillBegin) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"frameId\":"
out.RawString(prefix[1:])
out.String(string(in.FrameID))
}
{
const prefix string = ",\"guid\":"
out.RawString(prefix)
out.String(string(in.GUID))
}
{
const prefix string = ",\"url\":"
out.RawString(prefix)
out.String(string(in.URL))
}
{
const prefix string = ",\"suggestedFilename\":"
out.RawString(prefix)
out.String(string(in.SuggestedFilename))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v EventDownloadWillBegin) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser21(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventDownloadWillBegin) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser21(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EventDownloadWillBegin) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser21(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventDownloadWillBegin) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser21(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser22(in *jlexer.Lexer, out *EventDownloadProgress) {
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 "guid":
out.GUID = string(in.String())
case "totalBytes":
out.TotalBytes = float64(in.Float64())
case "receivedBytes":
out.ReceivedBytes = float64(in.Float64())
case "state":
(out.State).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser22(out *jwriter.Writer, in EventDownloadProgress) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"guid\":"
out.RawString(prefix[1:])
out.String(string(in.GUID))
}
{
const prefix string = ",\"totalBytes\":"
out.RawString(prefix)
out.Float64(float64(in.TotalBytes))
}
{
const prefix string = ",\"receivedBytes\":"
out.RawString(prefix)
out.Float64(float64(in.ReceivedBytes))
}
{
const prefix string = ",\"state\":"
out.RawString(prefix)
(in.State).MarshalEasyJSON(out)
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v EventDownloadProgress) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser22(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventDownloadProgress) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser22(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EventDownloadProgress) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser22(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventDownloadProgress) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser22(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser23(in *jlexer.Lexer, out *CrashParams) {
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()
@@ -1756,7 +2003,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser20(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser20(out *jwriter.Writer, in CrashParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser23(out *jwriter.Writer, in CrashParams) {
out.RawByte('{')
first := true
_ = first
@@ -1766,27 +2013,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser20(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v CrashParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser20(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser23(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v CrashParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser20(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser23(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *CrashParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser20(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser23(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CrashParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser20(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser23(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser21(in *jlexer.Lexer, out *CrashGpuProcessParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser24(in *jlexer.Lexer, out *CrashGpuProcessParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -1797,7 +2044,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser21(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1815,7 +2062,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser21(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser21(out *jwriter.Writer, in CrashGpuProcessParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser24(out *jwriter.Writer, in CrashGpuProcessParams) {
out.RawByte('{')
first := true
_ = first
@@ -1825,27 +2072,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser21(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v CrashGpuProcessParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser21(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser24(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v CrashGpuProcessParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser21(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser24(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *CrashGpuProcessParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser21(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser24(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CrashGpuProcessParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser21(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser24(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser22(in *jlexer.Lexer, out *CloseParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser25(in *jlexer.Lexer, out *CloseParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -1856,7 +2103,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser22(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1874,7 +2121,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser22(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser22(out *jwriter.Writer, in CloseParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser25(out *jwriter.Writer, in CloseParams) {
out.RawByte('{')
first := true
_ = first
@@ -1884,27 +2131,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser22(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v CloseParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser22(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser25(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v CloseParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser22(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser25(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *CloseParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser22(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser25(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CloseParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser22(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser25(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser23(in *jlexer.Lexer, out *Bucket) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser26(in *jlexer.Lexer, out *CancelDownloadParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -1915,7 +2162,80 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser23(in *jlexer.Lexer, o
}
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 "guid":
out.GUID = string(in.String())
case "browserContextId":
out.BrowserContextID = cdp.BrowserContextID(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser26(out *jwriter.Writer, in CancelDownloadParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"guid\":"
out.RawString(prefix[1:])
out.String(string(in.GUID))
}
if in.BrowserContextID != "" {
const prefix string = ",\"browserContextId\":"
out.RawString(prefix)
out.String(string(in.BrowserContextID))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v CancelDownloadParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser26(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v CancelDownloadParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser26(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *CancelDownloadParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser26(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CancelDownloadParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser26(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser27(in *jlexer.Lexer, out *Bucket) {
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()
@@ -1939,7 +2259,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser23(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser23(out *jwriter.Writer, in Bucket) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser27(out *jwriter.Writer, in Bucket) {
out.RawByte('{')
first := true
_ = first
@@ -1964,27 +2284,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser23(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v Bucket) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser23(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser27(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Bucket) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser23(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser27(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *Bucket) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser23(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser27(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Bucket) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser23(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser27(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser24(in *jlexer.Lexer, out *Bounds) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser28(in *jlexer.Lexer, out *Bounds) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -1995,7 +2315,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser24(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2023,7 +2343,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser24(in *jlexer.Lexer, o
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser24(out *jwriter.Writer, in Bounds) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser28(out *jwriter.Writer, in Bounds) {
out.RawByte('{')
first := true
_ = first
@@ -2079,23 +2399,23 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser24(out *jwriter.Writer
// MarshalJSON supports json.Marshaler interface
func (v Bounds) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser24(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser28(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Bounds) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser24(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoBrowser28(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *Bounds) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser24(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser28(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Bounds) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser24(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoBrowser28(l, v)
}

28
vendor/github.com/chromedp/cdproto/browser/events.go generated vendored Normal file
View File

@@ -0,0 +1,28 @@
package browser
// Code generated by cdproto-gen. DO NOT EDIT.
import (
"github.com/chromedp/cdproto/cdp"
)
// EventDownloadWillBegin fired when page is about to start a download.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#event-downloadWillBegin
type EventDownloadWillBegin struct {
FrameID cdp.FrameID `json:"frameId"` // Id of the frame that caused the download to begin.
GUID string `json:"guid"` // Global unique identifier of the download.
URL string `json:"url"` // URL of the resource being downloaded.
SuggestedFilename string `json:"suggestedFilename"` // Suggested file name of the resource (the actual name of the file saved on disk may differ).
}
// EventDownloadProgress fired when download makes progress. Last call has
// |done| == true.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#event-downloadProgress
type EventDownloadProgress struct {
GUID string `json:"guid"` // Global unique identifier of the download.
TotalBytes float64 `json:"totalBytes"` // Total expected bytes to download.
ReceivedBytes float64 `json:"receivedBytes"` // Total bytes received.
State DownloadProgressState `json:"state"` // Download status.
}

View File

@@ -99,6 +99,7 @@ const (
PermissionTypeBackgroundFetch PermissionType = "backgroundFetch"
PermissionTypeClipboardReadWrite PermissionType = "clipboardReadWrite"
PermissionTypeClipboardSanitizedWrite PermissionType = "clipboardSanitizedWrite"
PermissionTypeDisplayCapture PermissionType = "displayCapture"
PermissionTypeDurableStorage PermissionType = "durableStorage"
PermissionTypeFlash PermissionType = "flash"
PermissionTypeGeolocation PermissionType = "geolocation"
@@ -111,6 +112,7 @@ const (
PermissionTypeProtectedMediaIdentifier PermissionType = "protectedMediaIdentifier"
PermissionTypeSensors PermissionType = "sensors"
PermissionTypeVideoCapture PermissionType = "videoCapture"
PermissionTypeVideoCapturePanTiltZoom PermissionType = "videoCapturePanTiltZoom"
PermissionTypeIdleDetection PermissionType = "idleDetection"
PermissionTypeWakeLockScreen PermissionType = "wakeLockScreen"
PermissionTypeWakeLockSystem PermissionType = "wakeLockSystem"
@@ -141,6 +143,8 @@ func (t *PermissionType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = PermissionTypeClipboardReadWrite
case PermissionTypeClipboardSanitizedWrite:
*t = PermissionTypeClipboardSanitizedWrite
case PermissionTypeDisplayCapture:
*t = PermissionTypeDisplayCapture
case PermissionTypeDurableStorage:
*t = PermissionTypeDurableStorage
case PermissionTypeFlash:
@@ -165,6 +169,8 @@ func (t *PermissionType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = PermissionTypeSensors
case PermissionTypeVideoCapture:
*t = PermissionTypeVideoCapture
case PermissionTypeVideoCapturePanTiltZoom:
*t = PermissionTypeVideoCapturePanTiltZoom
case PermissionTypeIdleDetection:
*t = PermissionTypeIdleDetection
case PermissionTypeWakeLockScreen:
@@ -238,8 +244,52 @@ type PermissionDescriptor struct {
Name string `json:"name"` // Name of permission. See https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/permissions/permission_descriptor.idl for valid permission names.
Sysex bool `json:"sysex,omitempty"` // For "midi" permission, may also specify sysex control.
UserVisibleOnly bool `json:"userVisibleOnly,omitempty"` // For "push" permission, may specify userVisibleOnly. Note that userVisibleOnly = true is the only currently supported type.
Type string `json:"type,omitempty"` // For "wake-lock" permission, must specify type as either "screen" or "system".
AllowWithoutSanitization bool `json:"allowWithoutSanitization,omitempty"` // For "clipboard" permission, may specify allowWithoutSanitization.
PanTiltZoom bool `json:"panTiltZoom,omitempty"` // For "camera" permission, may specify panTiltZoom.
}
// CommandID browser command ids used by executeBrowserCommand.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#type-BrowserCommandId
type CommandID string
// String returns the CommandID as string value.
func (t CommandID) String() string {
return string(t)
}
// CommandID values.
const (
CommandIDOpenTabSearch CommandID = "openTabSearch"
CommandIDCloseTabSearch CommandID = "closeTabSearch"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CommandID) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CommandID) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CommandID) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CommandID(in.String()) {
case CommandIDOpenTabSearch:
*t = CommandIDOpenTabSearch
case CommandIDCloseTabSearch:
*t = CommandIDCloseTabSearch
default:
in.AddError(errors.New("unknown CommandID value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CommandID) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// Bucket chrome histogram bucket.
@@ -261,6 +311,53 @@ type Histogram struct {
Buckets []*Bucket `json:"buckets"` // Buckets.
}
// DownloadProgressState download status.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#event-downloadProgress
type DownloadProgressState string
// String returns the DownloadProgressState as string value.
func (t DownloadProgressState) String() string {
return string(t)
}
// DownloadProgressState values.
const (
DownloadProgressStateInProgress DownloadProgressState = "inProgress"
DownloadProgressStateCompleted DownloadProgressState = "completed"
DownloadProgressStateCanceled DownloadProgressState = "canceled"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t DownloadProgressState) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t DownloadProgressState) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *DownloadProgressState) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch DownloadProgressState(in.String()) {
case DownloadProgressStateInProgress:
*t = DownloadProgressStateInProgress
case DownloadProgressStateCompleted:
*t = DownloadProgressStateCompleted
case DownloadProgressStateCanceled:
*t = DownloadProgressStateCanceled
default:
in.AddError(errors.New("unknown DownloadProgressState value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *DownloadProgressState) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// SetDownloadBehaviorBehavior whether to allow all or deny all download
// requests, or use default Chrome behavior if available (otherwise deny).
// |allowAndName| allows download and names files according to their dowmload

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -149,7 +149,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage1(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -236,7 +236,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage2(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -311,7 +311,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage3(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -435,7 +435,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage4(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -544,7 +544,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage5(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -610,7 +610,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage6(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -683,7 +683,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage7(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -756,7 +756,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage8(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -822,7 +822,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage9(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1025,7 +1025,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage10(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1091,7 +1091,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCachestorage11(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCast(in *jlexer.Lexer, out *S
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -94,7 +94,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCast1(in *jlexer.Lexer, out *
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -160,7 +160,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCast2(in *jlexer.Lexer, out *
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -240,7 +240,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCast3(in *jlexer.Lexer, out *
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -306,7 +306,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCast4(in *jlexer.Lexer, out *
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -416,7 +416,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCast5(in *jlexer.Lexer, out *
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -482,7 +482,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCast6(in *jlexer.Lexer, out *
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -549,7 +549,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoCast7(in *jlexer.Lexer, out *
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

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.

View File

@@ -45,6 +45,7 @@ import (
"github.com/chromedp/cdproto/overlay"
"github.com/chromedp/cdproto/page"
"github.com/chromedp/cdproto/performance"
"github.com/chromedp/cdproto/performancetimeline"
"github.com/chromedp/cdproto/profiler"
"github.com/chromedp/cdproto/runtime"
"github.com/chromedp/cdproto/security"
@@ -79,6 +80,8 @@ const (
CommandAccessibilityEnable = accessibility.CommandEnable
CommandAccessibilityGetPartialAXTree = accessibility.CommandGetPartialAXTree
CommandAccessibilityGetFullAXTree = accessibility.CommandGetFullAXTree
CommandAccessibilityGetChildAXNodes = accessibility.CommandGetChildAXNodes
CommandAccessibilityQueryAXTree = accessibility.CommandQueryAXTree
CommandAnimationDisable = animation.CommandDisable
CommandAnimationEnable = animation.CommandEnable
CommandAnimationGetCurrentTime = animation.CommandGetCurrentTime
@@ -101,6 +104,7 @@ const (
CommandAuditsGetEncodedResponse = audits.CommandGetEncodedResponse
CommandAuditsDisable = audits.CommandDisable
CommandAuditsEnable = audits.CommandEnable
CommandAuditsCheckContrast = audits.CommandCheckContrast
EventAuditsIssueAdded = "Audits.issueAdded"
CommandBackgroundServiceStartObserving = backgroundservice.CommandStartObserving
CommandBackgroundServiceStopObserving = backgroundservice.CommandStopObserving
@@ -112,6 +116,7 @@ const (
CommandBrowserGrantPermissions = browser.CommandGrantPermissions
CommandBrowserResetPermissions = browser.CommandResetPermissions
CommandBrowserSetDownloadBehavior = browser.CommandSetDownloadBehavior
CommandBrowserCancelDownload = browser.CommandCancelDownload
CommandBrowserClose = browser.CommandClose
CommandBrowserCrash = browser.CommandCrash
CommandBrowserCrashGpuProcess = browser.CommandCrashGpuProcess
@@ -123,6 +128,9 @@ const (
CommandBrowserGetWindowForTarget = browser.CommandGetWindowForTarget
CommandBrowserSetWindowBounds = browser.CommandSetWindowBounds
CommandBrowserSetDockTile = browser.CommandSetDockTile
CommandBrowserExecuteBrowserCommand = browser.CommandExecuteBrowserCommand
EventBrowserDownloadWillBegin = "Browser.downloadWillBegin"
EventBrowserDownloadProgress = "Browser.downloadProgress"
CommandCSSAddRule = css.CommandAddRule
CommandCSSCollectClassNames = css.CommandCollectClassNames
CommandCSSCreateStyleSheet = css.CommandCreateStyleSheet
@@ -136,15 +144,19 @@ const (
CommandCSSGetMediaQueries = css.CommandGetMediaQueries
CommandCSSGetPlatformFontsForNode = css.CommandGetPlatformFontsForNode
CommandCSSGetStyleSheetText = css.CommandGetStyleSheetText
CommandCSSTrackComputedStyleUpdates = css.CommandTrackComputedStyleUpdates
CommandCSSTakeComputedStyleUpdates = css.CommandTakeComputedStyleUpdates
CommandCSSSetEffectivePropertyValueForNode = css.CommandSetEffectivePropertyValueForNode
CommandCSSSetKeyframeKey = css.CommandSetKeyframeKey
CommandCSSSetMediaText = css.CommandSetMediaText
CommandCSSSetContainerQueryText = css.CommandSetContainerQueryText
CommandCSSSetRuleSelector = css.CommandSetRuleSelector
CommandCSSSetStyleSheetText = css.CommandSetStyleSheetText
CommandCSSSetStyleTexts = css.CommandSetStyleTexts
CommandCSSStartRuleUsageTracking = css.CommandStartRuleUsageTracking
CommandCSSStopRuleUsageTracking = css.CommandStopRuleUsageTracking
CommandCSSTakeCoverageDelta = css.CommandTakeCoverageDelta
CommandCSSSetLocalFontsEnabled = css.CommandSetLocalFontsEnabled
EventCSSFontsUpdated = "CSS.fontsUpdated"
EventCSSMediaQueryResultChanged = "CSS.mediaQueryResultChanged"
EventCSSStyleSheetAdded = "CSS.styleSheetAdded"
@@ -174,7 +186,7 @@ const (
CommandDOMGetBoxModel = dom.CommandGetBoxModel
CommandDOMGetContentQuads = dom.CommandGetContentQuads
CommandDOMGetDocument = dom.CommandGetDocument
CommandDOMGetFlattenedDocument = dom.CommandGetFlattenedDocument
CommandDOMGetNodesForSubtreeByStyle = dom.CommandGetNodesForSubtreeByStyle
CommandDOMGetNodeForLocation = dom.CommandGetNodeForLocation
CommandDOMGetOuterHTML = dom.CommandGetOuterHTML
CommandDOMGetRelayoutBoundary = dom.CommandGetRelayoutBoundary
@@ -223,6 +235,7 @@ const (
CommandDOMDebuggerRemoveEventListenerBreakpoint = domdebugger.CommandRemoveEventListenerBreakpoint
CommandDOMDebuggerRemoveInstrumentationBreakpoint = domdebugger.CommandRemoveInstrumentationBreakpoint
CommandDOMDebuggerRemoveXHRBreakpoint = domdebugger.CommandRemoveXHRBreakpoint
CommandDOMDebuggerSetBreakOnCSPViolation = domdebugger.CommandSetBreakOnCSPViolation
CommandDOMDebuggerSetDOMBreakpoint = domdebugger.CommandSetDOMBreakpoint
CommandDOMDebuggerSetEventListenerBreakpoint = domdebugger.CommandSetEventListenerBreakpoint
CommandDOMDebuggerSetInstrumentationBreakpoint = domdebugger.CommandSetInstrumentationBreakpoint
@@ -249,13 +262,11 @@ const (
CommandDebuggerDisable = debugger.CommandDisable
CommandDebuggerEnable = debugger.CommandEnable
CommandDebuggerEvaluateOnCallFrame = debugger.CommandEvaluateOnCallFrame
CommandDebuggerExecuteWasmEvaluator = debugger.CommandExecuteWasmEvaluator
CommandDebuggerGetPossibleBreakpoints = debugger.CommandGetPossibleBreakpoints
CommandDebuggerGetScriptSource = debugger.CommandGetScriptSource
CommandDebuggerGetStackTrace = debugger.CommandGetStackTrace
CommandDebuggerPause = debugger.CommandPause
CommandDebuggerRemoveBreakpoint = debugger.CommandRemoveBreakpoint
CommandDebuggerRestartFrame = debugger.CommandRestartFrame
CommandDebuggerResume = debugger.CommandResume
CommandDebuggerSearchInContent = debugger.CommandSearchInContent
CommandDebuggerSetAsyncCallStackDepth = debugger.CommandSetAsyncCallStackDepth
@@ -295,12 +306,15 @@ const (
CommandEmulationSetEmulatedMedia = emulation.CommandSetEmulatedMedia
CommandEmulationSetEmulatedVisionDeficiency = emulation.CommandSetEmulatedVisionDeficiency
CommandEmulationSetGeolocationOverride = emulation.CommandSetGeolocationOverride
CommandEmulationSetIdleOverride = emulation.CommandSetIdleOverride
CommandEmulationClearIdleOverride = emulation.CommandClearIdleOverride
CommandEmulationSetPageScaleFactor = emulation.CommandSetPageScaleFactor
CommandEmulationSetScriptExecutionDisabled = emulation.CommandSetScriptExecutionDisabled
CommandEmulationSetTouchEmulationEnabled = emulation.CommandSetTouchEmulationEnabled
CommandEmulationSetVirtualTimePolicy = emulation.CommandSetVirtualTimePolicy
CommandEmulationSetLocaleOverride = emulation.CommandSetLocaleOverride
CommandEmulationSetTimezoneOverride = emulation.CommandSetTimezoneOverride
CommandEmulationSetDisabledImageTypes = emulation.CommandSetDisabledImageTypes
CommandEmulationSetUserAgentOverride = emulation.CommandSetUserAgentOverride
EventEmulationVirtualTimeBudgetExpired = "Emulation.virtualTimeBudgetExpired"
CommandFetchDisable = fetch.CommandDisable
@@ -345,15 +359,18 @@ const (
CommandIndexedDBGetMetadata = indexeddb.CommandGetMetadata
CommandIndexedDBRequestDatabase = indexeddb.CommandRequestDatabase
CommandIndexedDBRequestDatabaseNames = indexeddb.CommandRequestDatabaseNames
CommandInputDispatchDragEvent = input.CommandDispatchDragEvent
CommandInputDispatchKeyEvent = input.CommandDispatchKeyEvent
CommandInputInsertText = input.CommandInsertText
CommandInputDispatchMouseEvent = input.CommandDispatchMouseEvent
CommandInputDispatchTouchEvent = input.CommandDispatchTouchEvent
CommandInputEmulateTouchFromMouseEvent = input.CommandEmulateTouchFromMouseEvent
CommandInputSetIgnoreInputEvents = input.CommandSetIgnoreInputEvents
CommandInputSetInterceptDrags = input.CommandSetInterceptDrags
CommandInputSynthesizePinchGesture = input.CommandSynthesizePinchGesture
CommandInputSynthesizeScrollGesture = input.CommandSynthesizeScrollGesture
CommandInputSynthesizeTapGesture = input.CommandSynthesizeTapGesture
EventInputDragIntercepted = "Input.dragIntercepted"
CommandInspectorDisable = inspector.CommandDisable
CommandInspectorEnable = inspector.CommandEnable
EventInspectorDetached = "Inspector.detached"
@@ -393,6 +410,8 @@ const (
CommandMemoryGetAllTimeSamplingProfile = memory.CommandGetAllTimeSamplingProfile
CommandMemoryGetBrowserSamplingProfile = memory.CommandGetBrowserSamplingProfile
CommandMemoryGetSamplingProfile = memory.CommandGetSamplingProfile
CommandNetworkSetAcceptedEncodings = network.CommandSetAcceptedEncodings
CommandNetworkClearAcceptedEncodingsOverride = network.CommandClearAcceptedEncodingsOverride
CommandNetworkClearBrowserCache = network.CommandClearBrowserCache
CommandNetworkClearBrowserCookies = network.CommandClearBrowserCookies
CommandNetworkDeleteCookies = network.CommandDeleteCookies
@@ -413,8 +432,10 @@ const (
CommandNetworkSetCacheDisabled = network.CommandSetCacheDisabled
CommandNetworkSetCookie = network.CommandSetCookie
CommandNetworkSetCookies = network.CommandSetCookies
CommandNetworkSetDataSizeLimitsForTest = network.CommandSetDataSizeLimitsForTest
CommandNetworkSetExtraHTTPHeaders = network.CommandSetExtraHTTPHeaders
CommandNetworkSetAttachDebugStack = network.CommandSetAttachDebugStack
CommandNetworkGetSecurityIsolationStatus = network.CommandGetSecurityIsolationStatus
CommandNetworkLoadNetworkResource = network.CommandLoadNetworkResource
EventNetworkDataReceived = "Network.dataReceived"
EventNetworkEventSourceMessageReceived = "Network.eventSourceMessageReceived"
EventNetworkLoadingFailed = "Network.loadingFailed"
@@ -431,25 +452,40 @@ const (
EventNetworkWebSocketFrameSent = "Network.webSocketFrameSent"
EventNetworkWebSocketHandshakeResponseReceived = "Network.webSocketHandshakeResponseReceived"
EventNetworkWebSocketWillSendHandshakeRequest = "Network.webSocketWillSendHandshakeRequest"
EventNetworkWebTransportCreated = "Network.webTransportCreated"
EventNetworkWebTransportConnectionEstablished = "Network.webTransportConnectionEstablished"
EventNetworkWebTransportClosed = "Network.webTransportClosed"
EventNetworkRequestWillBeSentExtraInfo = "Network.requestWillBeSentExtraInfo"
EventNetworkResponseReceivedExtraInfo = "Network.responseReceivedExtraInfo"
EventNetworkTrustTokenOperationDone = "Network.trustTokenOperationDone"
EventNetworkSubresourceWebBundleMetadataReceived = "Network.subresourceWebBundleMetadataReceived"
EventNetworkSubresourceWebBundleMetadataError = "Network.subresourceWebBundleMetadataError"
EventNetworkSubresourceWebBundleInnerResponseParsed = "Network.subresourceWebBundleInnerResponseParsed"
EventNetworkSubresourceWebBundleInnerResponseError = "Network.subresourceWebBundleInnerResponseError"
CommandOverlayDisable = overlay.CommandDisable
CommandOverlayEnable = overlay.CommandEnable
CommandOverlayGetHighlightObjectForTest = overlay.CommandGetHighlightObjectForTest
CommandOverlayGetGridHighlightObjectsForTest = overlay.CommandGetGridHighlightObjectsForTest
CommandOverlayGetSourceOrderHighlightObjectForTest = overlay.CommandGetSourceOrderHighlightObjectForTest
CommandOverlayHideHighlight = overlay.CommandHideHighlight
CommandOverlayHighlightFrame = overlay.CommandHighlightFrame
CommandOverlayHighlightNode = overlay.CommandHighlightNode
CommandOverlayHighlightQuad = overlay.CommandHighlightQuad
CommandOverlayHighlightRect = overlay.CommandHighlightRect
CommandOverlayHighlightSourceOrder = overlay.CommandHighlightSourceOrder
CommandOverlaySetInspectMode = overlay.CommandSetInspectMode
CommandOverlaySetShowAdHighlights = overlay.CommandSetShowAdHighlights
CommandOverlaySetPausedInDebuggerMessage = overlay.CommandSetPausedInDebuggerMessage
CommandOverlaySetShowDebugBorders = overlay.CommandSetShowDebugBorders
CommandOverlaySetShowFPSCounter = overlay.CommandSetShowFPSCounter
CommandOverlaySetShowGridOverlays = overlay.CommandSetShowGridOverlays
CommandOverlaySetShowFlexOverlays = overlay.CommandSetShowFlexOverlays
CommandOverlaySetShowScrollSnapOverlays = overlay.CommandSetShowScrollSnapOverlays
CommandOverlaySetShowPaintRects = overlay.CommandSetShowPaintRects
CommandOverlaySetShowLayoutShiftRegions = overlay.CommandSetShowLayoutShiftRegions
CommandOverlaySetShowScrollBottleneckRects = overlay.CommandSetShowScrollBottleneckRects
CommandOverlaySetShowHitTestBorders = overlay.CommandSetShowHitTestBorders
CommandOverlaySetShowWebVitals = overlay.CommandSetShowWebVitals
CommandOverlaySetShowViewportSizeOnResize = overlay.CommandSetShowViewportSizeOnResize
CommandOverlaySetShowHinge = overlay.CommandSetShowHinge
EventOverlayInspectNodeRequested = "Overlay.inspectNodeRequested"
@@ -482,9 +518,11 @@ const (
CommandPageSearchInResource = page.CommandSearchInResource
CommandPageSetAdBlockingEnabled = page.CommandSetAdBlockingEnabled
CommandPageSetBypassCSP = page.CommandSetBypassCSP
CommandPageGetPermissionsPolicyState = page.CommandGetPermissionsPolicyState
CommandPageSetFontFamilies = page.CommandSetFontFamilies
CommandPageSetFontSizes = page.CommandSetFontSizes
CommandPageSetDocumentContent = page.CommandSetDocumentContent
CommandPageSetDownloadBehavior = page.CommandSetDownloadBehavior
CommandPageSetLifecycleEventsEnabled = page.CommandSetLifecycleEventsEnabled
CommandPageStartScreencast = page.CommandStartScreencast
CommandPageStopLoading = page.CommandStopLoading
@@ -493,6 +531,7 @@ const (
CommandPageSetWebLifecycleState = page.CommandSetWebLifecycleState
CommandPageStopScreencast = page.CommandStopScreencast
CommandPageSetProduceCompilationCache = page.CommandSetProduceCompilationCache
CommandPageProduceCompilationCache = page.CommandProduceCompilationCache
CommandPageAddCompilationCache = page.CommandAddCompilationCache
CommandPageClearCompilationCache = page.CommandClearCompilationCache
CommandPageGenerateTestReport = page.CommandGenerateTestReport
@@ -503,17 +542,17 @@ const (
EventPageFrameAttached = "Page.frameAttached"
EventPageFrameDetached = "Page.frameDetached"
EventPageFrameNavigated = "Page.frameNavigated"
EventPageDocumentOpened = "Page.documentOpened"
EventPageFrameResized = "Page.frameResized"
EventPageFrameRequestedNavigation = "Page.frameRequestedNavigation"
EventPageFrameStartedLoading = "Page.frameStartedLoading"
EventPageFrameStoppedLoading = "Page.frameStoppedLoading"
EventPageDownloadWillBegin = "Page.downloadWillBegin"
EventPageDownloadProgress = "Page.downloadProgress"
EventPageInterstitialHidden = "Page.interstitialHidden"
EventPageInterstitialShown = "Page.interstitialShown"
EventPageJavascriptDialogClosed = "Page.javascriptDialogClosed"
EventPageJavascriptDialogOpening = "Page.javascriptDialogOpening"
EventPageLifecycleEvent = "Page.lifecycleEvent"
EventPageBackForwardCacheNotUsed = "Page.backForwardCacheNotUsed"
EventPageLoadEventFired = "Page.loadEventFired"
EventPageNavigatedWithinDocument = "Page.navigatedWithinDocument"
EventPageScreencastFrame = "Page.screencastFrame"
@@ -524,6 +563,8 @@ const (
CommandPerformanceEnable = performance.CommandEnable
CommandPerformanceGetMetrics = performance.CommandGetMetrics
EventPerformanceMetrics = "Performance.metrics"
CommandPerformanceTimelineEnable = performancetimeline.CommandEnable
EventPerformanceTimelineTimelineEventAdded = "PerformanceTimeline.timelineEventAdded"
CommandProfilerDisable = profiler.CommandDisable
CommandProfilerEnable = profiler.CommandEnable
CommandProfilerGetBestEffortCoverage = profiler.CommandGetBestEffortCoverage
@@ -536,6 +577,9 @@ const (
CommandProfilerStopTypeProfile = profiler.CommandStopTypeProfile
CommandProfilerTakePreciseCoverage = profiler.CommandTakePreciseCoverage
CommandProfilerTakeTypeProfile = profiler.CommandTakeTypeProfile
CommandProfilerEnableCounters = profiler.CommandEnableCounters
CommandProfilerDisableCounters = profiler.CommandDisableCounters
CommandProfilerGetCounters = profiler.CommandGetCounters
CommandProfilerEnableRuntimeCallStats = profiler.CommandEnableRuntimeCallStats
CommandProfilerDisableRuntimeCallStats = profiler.CommandDisableRuntimeCallStats
CommandProfilerGetRuntimeCallStats = profiler.CommandGetRuntimeCallStats
@@ -597,10 +641,13 @@ const (
CommandStorageSetCookies = storage.CommandSetCookies
CommandStorageClearCookies = storage.CommandClearCookies
CommandStorageGetUsageAndQuota = storage.CommandGetUsageAndQuota
CommandStorageOverrideQuotaForOrigin = storage.CommandOverrideQuotaForOrigin
CommandStorageTrackCacheStorageForOrigin = storage.CommandTrackCacheStorageForOrigin
CommandStorageTrackIndexedDBForOrigin = storage.CommandTrackIndexedDBForOrigin
CommandStorageUntrackCacheStorageForOrigin = storage.CommandUntrackCacheStorageForOrigin
CommandStorageUntrackIndexedDBForOrigin = storage.CommandUntrackIndexedDBForOrigin
CommandStorageGetTrustTokens = storage.CommandGetTrustTokens
CommandStorageClearTrustTokens = storage.CommandClearTrustTokens
EventStorageCacheStorageContentUpdated = "Storage.cacheStorageContentUpdated"
EventStorageCacheStorageListUpdated = "Storage.cacheStorageListUpdated"
EventStorageIndexedDBContentUpdated = "Storage.indexedDBContentUpdated"
@@ -666,6 +713,7 @@ const (
CommandWebAuthnRemoveCredential = webauthn.CommandRemoveCredential
CommandWebAuthnClearCredentials = webauthn.CommandClearCredentials
CommandWebAuthnSetUserVerified = webauthn.CommandSetUserVerified
CommandWebAuthnSetAutomaticPresenceSimulation = webauthn.CommandSetAutomaticPresenceSimulation
)
// Error error type.
@@ -710,6 +758,12 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandAccessibilityGetFullAXTree:
v = new(accessibility.GetFullAXTreeReturns)
case CommandAccessibilityGetChildAXNodes:
v = new(accessibility.GetChildAXNodesReturns)
case CommandAccessibilityQueryAXTree:
v = new(accessibility.QueryAXTreeReturns)
case CommandAnimationDisable:
return emptyVal, nil
@@ -776,6 +830,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandAuditsEnable:
return emptyVal, nil
case CommandAuditsCheckContrast:
return emptyVal, nil
case EventAuditsIssueAdded:
v = new(audits.EventIssueAdded)
@@ -809,6 +866,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandBrowserSetDownloadBehavior:
return emptyVal, nil
case CommandBrowserCancelDownload:
return emptyVal, nil
case CommandBrowserClose:
return emptyVal, nil
@@ -842,6 +902,15 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandBrowserSetDockTile:
return emptyVal, nil
case CommandBrowserExecuteBrowserCommand:
return emptyVal, nil
case EventBrowserDownloadWillBegin:
v = new(browser.EventDownloadWillBegin)
case EventBrowserDownloadProgress:
v = new(browser.EventDownloadProgress)
case CommandCSSAddRule:
v = new(css.AddRuleReturns)
@@ -881,6 +950,12 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandCSSGetStyleSheetText:
v = new(css.GetStyleSheetTextReturns)
case CommandCSSTrackComputedStyleUpdates:
return emptyVal, nil
case CommandCSSTakeComputedStyleUpdates:
v = new(css.TakeComputedStyleUpdatesReturns)
case CommandCSSSetEffectivePropertyValueForNode:
return emptyVal, nil
@@ -890,6 +965,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandCSSSetMediaText:
v = new(css.SetMediaTextReturns)
case CommandCSSSetContainerQueryText:
v = new(css.SetContainerQueryTextReturns)
case CommandCSSSetRuleSelector:
v = new(css.SetRuleSelectorReturns)
@@ -908,6 +986,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandCSSTakeCoverageDelta:
v = new(css.TakeCoverageDeltaReturns)
case CommandCSSSetLocalFontsEnabled:
return emptyVal, nil
case EventCSSFontsUpdated:
v = new(css.EventFontsUpdated)
@@ -995,8 +1076,8 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandDOMGetDocument:
v = new(dom.GetDocumentReturns)
case CommandDOMGetFlattenedDocument:
v = new(dom.GetFlattenedDocumentReturns)
case CommandDOMGetNodesForSubtreeByStyle:
v = new(dom.GetNodesForSubtreeByStyleReturns)
case CommandDOMGetNodeForLocation:
v = new(dom.GetNodeForLocationReturns)
@@ -1142,6 +1223,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandDOMDebuggerRemoveXHRBreakpoint:
return emptyVal, nil
case CommandDOMDebuggerSetBreakOnCSPViolation:
return emptyVal, nil
case CommandDOMDebuggerSetDOMBreakpoint:
return emptyVal, nil
@@ -1220,9 +1304,6 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandDebuggerEvaluateOnCallFrame:
v = new(debugger.EvaluateOnCallFrameReturns)
case CommandDebuggerExecuteWasmEvaluator:
v = new(debugger.ExecuteWasmEvaluatorReturns)
case CommandDebuggerGetPossibleBreakpoints:
v = new(debugger.GetPossibleBreakpointsReturns)
@@ -1238,9 +1319,6 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandDebuggerRemoveBreakpoint:
return emptyVal, nil
case CommandDebuggerRestartFrame:
v = new(debugger.RestartFrameReturns)
case CommandDebuggerResume:
return emptyVal, nil
@@ -1358,6 +1436,12 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandEmulationSetGeolocationOverride:
return emptyVal, nil
case CommandEmulationSetIdleOverride:
return emptyVal, nil
case CommandEmulationClearIdleOverride:
return emptyVal, nil
case CommandEmulationSetPageScaleFactor:
return emptyVal, nil
@@ -1376,6 +1460,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandEmulationSetTimezoneOverride:
return emptyVal, nil
case CommandEmulationSetDisabledImageTypes:
return emptyVal, nil
case CommandEmulationSetUserAgentOverride:
return emptyVal, nil
@@ -1508,6 +1595,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandIndexedDBRequestDatabaseNames:
v = new(indexeddb.RequestDatabaseNamesReturns)
case CommandInputDispatchDragEvent:
return emptyVal, nil
case CommandInputDispatchKeyEvent:
return emptyVal, nil
@@ -1526,6 +1616,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandInputSetIgnoreInputEvents:
return emptyVal, nil
case CommandInputSetInterceptDrags:
return emptyVal, nil
case CommandInputSynthesizePinchGesture:
return emptyVal, nil
@@ -1535,6 +1628,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandInputSynthesizeTapGesture:
return emptyVal, nil
case EventInputDragIntercepted:
v = new(input.EventDragIntercepted)
case CommandInspectorDisable:
return emptyVal, nil
@@ -1652,6 +1748,12 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandMemoryGetSamplingProfile:
v = new(memory.GetSamplingProfileReturns)
case CommandNetworkSetAcceptedEncodings:
return emptyVal, nil
case CommandNetworkClearAcceptedEncodingsOverride:
return emptyVal, nil
case CommandNetworkClearBrowserCache:
return emptyVal, nil
@@ -1707,17 +1809,23 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
return emptyVal, nil
case CommandNetworkSetCookie:
v = new(network.SetCookieReturns)
return emptyVal, nil
case CommandNetworkSetCookies:
return emptyVal, nil
case CommandNetworkSetDataSizeLimitsForTest:
return emptyVal, nil
case CommandNetworkSetExtraHTTPHeaders:
return emptyVal, nil
case CommandNetworkSetAttachDebugStack:
return emptyVal, nil
case CommandNetworkGetSecurityIsolationStatus:
v = new(network.GetSecurityIsolationStatusReturns)
case CommandNetworkLoadNetworkResource:
v = new(network.LoadNetworkResourceReturns)
case EventNetworkDataReceived:
v = new(network.EventDataReceived)
@@ -1766,12 +1874,36 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case EventNetworkWebSocketWillSendHandshakeRequest:
v = new(network.EventWebSocketWillSendHandshakeRequest)
case EventNetworkWebTransportCreated:
v = new(network.EventWebTransportCreated)
case EventNetworkWebTransportConnectionEstablished:
v = new(network.EventWebTransportConnectionEstablished)
case EventNetworkWebTransportClosed:
v = new(network.EventWebTransportClosed)
case EventNetworkRequestWillBeSentExtraInfo:
v = new(network.EventRequestWillBeSentExtraInfo)
case EventNetworkResponseReceivedExtraInfo:
v = new(network.EventResponseReceivedExtraInfo)
case EventNetworkTrustTokenOperationDone:
v = new(network.EventTrustTokenOperationDone)
case EventNetworkSubresourceWebBundleMetadataReceived:
v = new(network.EventSubresourceWebBundleMetadataReceived)
case EventNetworkSubresourceWebBundleMetadataError:
v = new(network.EventSubresourceWebBundleMetadataError)
case EventNetworkSubresourceWebBundleInnerResponseParsed:
v = new(network.EventSubresourceWebBundleInnerResponseParsed)
case EventNetworkSubresourceWebBundleInnerResponseError:
v = new(network.EventSubresourceWebBundleInnerResponseError)
case CommandOverlayDisable:
return emptyVal, nil
@@ -1781,6 +1913,12 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandOverlayGetHighlightObjectForTest:
v = new(overlay.GetHighlightObjectForTestReturns)
case CommandOverlayGetGridHighlightObjectsForTest:
v = new(overlay.GetGridHighlightObjectsForTestReturns)
case CommandOverlayGetSourceOrderHighlightObjectForTest:
v = new(overlay.GetSourceOrderHighlightObjectForTestReturns)
case CommandOverlayHideHighlight:
return emptyVal, nil
@@ -1796,6 +1934,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandOverlayHighlightRect:
return emptyVal, nil
case CommandOverlayHighlightSourceOrder:
return emptyVal, nil
case CommandOverlaySetInspectMode:
return emptyVal, nil
@@ -1811,6 +1952,15 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandOverlaySetShowFPSCounter:
return emptyVal, nil
case CommandOverlaySetShowGridOverlays:
return emptyVal, nil
case CommandOverlaySetShowFlexOverlays:
return emptyVal, nil
case CommandOverlaySetShowScrollSnapOverlays:
return emptyVal, nil
case CommandOverlaySetShowPaintRects:
return emptyVal, nil
@@ -1823,6 +1973,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandOverlaySetShowHitTestBorders:
return emptyVal, nil
case CommandOverlaySetShowWebVitals:
return emptyVal, nil
case CommandOverlaySetShowViewportSizeOnResize:
return emptyVal, nil
@@ -1919,6 +2072,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandPageSetBypassCSP:
return emptyVal, nil
case CommandPageGetPermissionsPolicyState:
v = new(page.GetPermissionsPolicyStateReturns)
case CommandPageSetFontFamilies:
return emptyVal, nil
@@ -1928,6 +2084,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandPageSetDocumentContent:
return emptyVal, nil
case CommandPageSetDownloadBehavior:
return emptyVal, nil
case CommandPageSetLifecycleEventsEnabled:
return emptyVal, nil
@@ -1952,6 +2111,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandPageSetProduceCompilationCache:
return emptyVal, nil
case CommandPageProduceCompilationCache:
return emptyVal, nil
case CommandPageAddCompilationCache:
return emptyVal, nil
@@ -1982,6 +2144,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case EventPageFrameNavigated:
v = new(page.EventFrameNavigated)
case EventPageDocumentOpened:
v = new(page.EventDocumentOpened)
case EventPageFrameResized:
v = new(page.EventFrameResized)
@@ -1994,12 +2159,6 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case EventPageFrameStoppedLoading:
v = new(page.EventFrameStoppedLoading)
case EventPageDownloadWillBegin:
v = new(page.EventDownloadWillBegin)
case EventPageDownloadProgress:
v = new(page.EventDownloadProgress)
case EventPageInterstitialHidden:
v = new(page.EventInterstitialHidden)
@@ -2015,6 +2174,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case EventPageLifecycleEvent:
v = new(page.EventLifecycleEvent)
case EventPageBackForwardCacheNotUsed:
v = new(page.EventBackForwardCacheNotUsed)
case EventPageLoadEventFired:
v = new(page.EventLoadEventFired)
@@ -2045,6 +2207,12 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case EventPerformanceMetrics:
v = new(performance.EventMetrics)
case CommandPerformanceTimelineEnable:
return emptyVal, nil
case EventPerformanceTimelineTimelineEventAdded:
v = new(performancetimeline.EventTimelineEventAdded)
case CommandProfilerDisable:
return emptyVal, nil
@@ -2081,6 +2249,15 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandProfilerTakeTypeProfile:
v = new(profiler.TakeTypeProfileReturns)
case CommandProfilerEnableCounters:
return emptyVal, nil
case CommandProfilerDisableCounters:
return emptyVal, nil
case CommandProfilerGetCounters:
v = new(profiler.GetCountersReturns)
case CommandProfilerEnableRuntimeCallStats:
return emptyVal, nil
@@ -2264,6 +2441,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandStorageGetUsageAndQuota:
v = new(storage.GetUsageAndQuotaReturns)
case CommandStorageOverrideQuotaForOrigin:
return emptyVal, nil
case CommandStorageTrackCacheStorageForOrigin:
return emptyVal, nil
@@ -2276,6 +2456,12 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandStorageUntrackIndexedDBForOrigin:
return emptyVal, nil
case CommandStorageGetTrustTokens:
v = new(storage.GetTrustTokensReturns)
case CommandStorageClearTrustTokens:
v = new(storage.ClearTrustTokensReturns)
case EventStorageCacheStorageContentUpdated:
v = new(storage.EventCacheStorageContentUpdated)
@@ -2304,7 +2490,7 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
v = new(target.AttachToBrowserTargetReturns)
case CommandTargetCloseTarget:
v = new(target.CloseTargetReturns)
return emptyVal, nil
case CommandTargetExposeDevToolsProtocol:
return emptyVal, nil
@@ -2471,6 +2657,9 @@ func UnmarshalMessage(msg *Message) (interface{}, error) {
case CommandWebAuthnSetUserVerified:
return emptyVal, nil
case CommandWebAuthnSetAutomaticPresenceSimulation:
return emptyVal, nil
default:
return nil, cdp.ErrUnknownCommandOrEvent(msg.Method)
}

View File

@@ -483,6 +483,73 @@ func (p *GetStyleSheetTextParams) Do(ctx context.Context) (text string, err erro
return res.Text, nil
}
// TrackComputedStyleUpdatesParams starts tracking the given computed styles
// for updates. The specified array of properties replaces the one previously
// specified. Pass empty array to disable tracking. Use takeComputedStyleUpdates
// to retrieve the list of nodes that had properties modified. The changes to
// computed style properties are only tracked for nodes pushed to the front-end
// by the DOM agent. If no changes to the tracked properties occur after the
// node has been pushed to the front-end, no updates will be issued for the
// node.
type TrackComputedStyleUpdatesParams struct {
PropertiesToTrack []*ComputedStyleProperty `json:"propertiesToTrack"`
}
// TrackComputedStyleUpdates starts tracking the given computed styles for
// updates. The specified array of properties replaces the one previously
// specified. Pass empty array to disable tracking. Use takeComputedStyleUpdates
// to retrieve the list of nodes that had properties modified. The changes to
// computed style properties are only tracked for nodes pushed to the front-end
// by the DOM agent. If no changes to the tracked properties occur after the
// node has been pushed to the front-end, no updates will be issued for the
// node.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-trackComputedStyleUpdates
//
// parameters:
// propertiesToTrack
func TrackComputedStyleUpdates(propertiesToTrack []*ComputedStyleProperty) *TrackComputedStyleUpdatesParams {
return &TrackComputedStyleUpdatesParams{
PropertiesToTrack: propertiesToTrack,
}
}
// Do executes CSS.trackComputedStyleUpdates against the provided context.
func (p *TrackComputedStyleUpdatesParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandTrackComputedStyleUpdates, p, nil)
}
// TakeComputedStyleUpdatesParams polls the next batch of computed style
// updates.
type TakeComputedStyleUpdatesParams struct{}
// TakeComputedStyleUpdates polls the next batch of computed style updates.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-takeComputedStyleUpdates
func TakeComputedStyleUpdates() *TakeComputedStyleUpdatesParams {
return &TakeComputedStyleUpdatesParams{}
}
// TakeComputedStyleUpdatesReturns return values.
type TakeComputedStyleUpdatesReturns struct {
NodeIds []cdp.NodeID `json:"nodeIds,omitempty"` // The list of node Ids that have their tracked computed styles updated
}
// Do executes CSS.takeComputedStyleUpdates against the provided context.
//
// returns:
// nodeIds - The list of node Ids that have their tracked computed styles updated
func (p *TakeComputedStyleUpdatesParams) Do(ctx context.Context) (nodeIds []cdp.NodeID, err error) {
// execute
var res TakeComputedStyleUpdatesReturns
err = cdp.Execute(ctx, CommandTakeComputedStyleUpdates, nil, &res)
if err != nil {
return nil, err
}
return res.NodeIds, nil
}
// SetEffectivePropertyValueForNodeParams find a rule with the given active
// property for the given node and set the new value for this property.
type SetEffectivePropertyValueForNodeParams struct {
@@ -599,6 +666,49 @@ func (p *SetMediaTextParams) Do(ctx context.Context) (media *Media, err error) {
return res.Media, nil
}
// SetContainerQueryTextParams modifies the expression of a container query.
type SetContainerQueryTextParams struct {
StyleSheetID StyleSheetID `json:"styleSheetId"`
Range *SourceRange `json:"range"`
Text string `json:"text"`
}
// SetContainerQueryText modifies the expression of a container query.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setContainerQueryText
//
// parameters:
// styleSheetID
// range
// text
func SetContainerQueryText(styleSheetID StyleSheetID, rangeVal *SourceRange, text string) *SetContainerQueryTextParams {
return &SetContainerQueryTextParams{
StyleSheetID: styleSheetID,
Range: rangeVal,
Text: text,
}
}
// SetContainerQueryTextReturns return values.
type SetContainerQueryTextReturns struct {
ContainerQuery *ContainerQuery `json:"containerQuery,omitempty"` // The resulting CSS container query rule after modification.
}
// Do executes CSS.setContainerQueryText against the provided context.
//
// returns:
// containerQuery - The resulting CSS container query rule after modification.
func (p *SetContainerQueryTextParams) Do(ctx context.Context) (containerQuery *ContainerQuery, err error) {
// execute
var res SetContainerQueryTextReturns
err = cdp.Execute(ctx, CommandSetContainerQueryText, p, &res)
if err != nil {
return nil, err
}
return res.ContainerQuery, nil
}
// SetRuleSelectorParams modifies the rule selector.
type SetRuleSelectorParams struct {
StyleSheetID StyleSheetID `json:"styleSheetId"`
@@ -804,6 +914,30 @@ func (p *TakeCoverageDeltaParams) Do(ctx context.Context) (coverage []*RuleUsage
return res.Coverage, res.Timestamp, nil
}
// SetLocalFontsEnabledParams enables/disables rendering of local CSS fonts
// (enabled by default).
type SetLocalFontsEnabledParams struct {
Enabled bool `json:"enabled"` // Whether rendering of local fonts is enabled.
}
// SetLocalFontsEnabled enables/disables rendering of local CSS fonts
// (enabled by default).
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#method-setLocalFontsEnabled
//
// parameters:
// enabled - Whether rendering of local fonts is enabled.
func SetLocalFontsEnabled(enabled bool) *SetLocalFontsEnabledParams {
return &SetLocalFontsEnabledParams{
Enabled: enabled,
}
}
// Do executes CSS.setLocalFontsEnabled against the provided context.
func (p *SetLocalFontsEnabledParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetLocalFontsEnabled, p, nil)
}
// Command names.
const (
CommandAddRule = "CSS.addRule"
@@ -819,13 +953,17 @@ const (
CommandGetMediaQueries = "CSS.getMediaQueries"
CommandGetPlatformFontsForNode = "CSS.getPlatformFontsForNode"
CommandGetStyleSheetText = "CSS.getStyleSheetText"
CommandTrackComputedStyleUpdates = "CSS.trackComputedStyleUpdates"
CommandTakeComputedStyleUpdates = "CSS.takeComputedStyleUpdates"
CommandSetEffectivePropertyValueForNode = "CSS.setEffectivePropertyValueForNode"
CommandSetKeyframeKey = "CSS.setKeyframeKey"
CommandSetMediaText = "CSS.setMediaText"
CommandSetContainerQueryText = "CSS.setContainerQueryText"
CommandSetRuleSelector = "CSS.setRuleSelector"
CommandSetStyleSheetText = "CSS.setStyleSheetText"
CommandSetStyleTexts = "CSS.setStyleTexts"
CommandStartRuleUsageTracking = "CSS.startRuleUsageTracking"
CommandStopRuleUsageTracking = "CSS.stopRuleUsageTracking"
CommandTakeCoverageDelta = "CSS.takeCoverageDelta"
CommandSetLocalFontsEnabled = "CSS.setLocalFontsEnabled"
)

File diff suppressed because it is too large Load Diff

View File

@@ -119,32 +119,35 @@ type SelectorList struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-CSSStyleSheetHeader
type StyleSheetHeader struct {
StyleSheetID StyleSheetID `json:"styleSheetId"` // The stylesheet identifier.
FrameID cdp.FrameID `json:"frameId"` // Owner frame identifier.
SourceURL string `json:"sourceURL"` // Stylesheet resource URL.
SourceMapURL string `json:"sourceMapURL,omitempty"` // URL of source map associated with the stylesheet (if any).
Origin StyleSheetOrigin `json:"origin"` // Stylesheet origin.
Title string `json:"title"` // Stylesheet title.
OwnerNode cdp.BackendNodeID `json:"ownerNode,omitempty"` // The backend id for the owner node of the stylesheet.
Disabled bool `json:"disabled"` // Denotes whether the stylesheet is disabled.
HasSourceURL bool `json:"hasSourceURL,omitempty"` // Whether the sourceURL field value comes from the sourceURL comment.
IsInline bool `json:"isInline"` // Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags.
StartLine float64 `json:"startLine"` // Line offset of the stylesheet within the resource (zero based).
StartColumn float64 `json:"startColumn"` // Column offset of the stylesheet within the resource (zero based).
Length float64 `json:"length"` // Size of the content (in characters).
EndLine float64 `json:"endLine"` // Line offset of the end of the stylesheet within the resource (zero based).
EndColumn float64 `json:"endColumn"` // Column offset of the end of the stylesheet within the resource (zero based).
StyleSheetID StyleSheetID `json:"styleSheetId"` // The stylesheet identifier.
FrameID cdp.FrameID `json:"frameId"` // Owner frame identifier.
SourceURL string `json:"sourceURL"` // Stylesheet resource URL.
SourceMapURL string `json:"sourceMapURL,omitempty"` // URL of source map associated with the stylesheet (if any).
Origin StyleSheetOrigin `json:"origin"` // Stylesheet origin.
Title string `json:"title"` // Stylesheet title.
OwnerNode cdp.BackendNodeID `json:"ownerNode,omitempty"` // The backend id for the owner node of the stylesheet.
Disabled bool `json:"disabled"` // Denotes whether the stylesheet is disabled.
HasSourceURL bool `json:"hasSourceURL,omitempty"` // Whether the sourceURL field value comes from the sourceURL comment.
IsInline bool `json:"isInline"` // Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags.
IsMutable bool `json:"isMutable"` // Whether this stylesheet is mutable. Inline stylesheets become mutable after they have been modified via CSSOM API. <link> element's stylesheets become mutable only if DevTools modifies them. Constructed stylesheets (new CSSStyleSheet()) are mutable immediately after creation.
IsConstructed bool `json:"isConstructed"` // Whether this stylesheet is a constructed stylesheet (created using new CSSStyleSheet()).
StartLine float64 `json:"startLine"` // Line offset of the stylesheet within the resource (zero based).
StartColumn float64 `json:"startColumn"` // Column offset of the stylesheet within the resource (zero based).
Length float64 `json:"length"` // Size of the content (in characters).
EndLine float64 `json:"endLine"` // Line offset of the end of the stylesheet within the resource (zero based).
EndColumn float64 `json:"endColumn"` // Column offset of the end of the stylesheet within the resource (zero based).
}
// Rule CSS rule representation.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-CSSRule
type Rule struct {
StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
SelectorList *SelectorList `json:"selectorList"` // Rule selector data.
Origin StyleSheetOrigin `json:"origin"` // Parent stylesheet's origin.
Style *Style `json:"style"` // Associated style declaration.
Media []*Media `json:"media,omitempty"` // Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards.
StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
SelectorList *SelectorList `json:"selectorList"` // Rule selector data.
Origin StyleSheetOrigin `json:"origin"` // Parent stylesheet's origin.
Style *Style `json:"style"` // Associated style declaration.
Media []*Media `json:"media,omitempty"` // Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards.
ContainerQueries []*ContainerQuery `json:"containerQueries,omitempty"` // Container query list array (for rules involving container queries). The array enumerates container queries starting with the innermost one, going outwards.
}
// RuleUsage CSS coverage information.
@@ -240,6 +243,15 @@ type MediaQueryExpression struct {
ComputedLength float64 `json:"computedLength,omitempty"` // Computed length of media query expression (if applicable).
}
// ContainerQuery CSS container query rule descriptor.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-CSSContainerQuery
type ContainerQuery struct {
Text string `json:"text"` // Container query text.
Range *SourceRange `json:"range,omitempty"` // The associated rule header range in the enclosing stylesheet (if available).
StyleSheetID StyleSheetID `json:"styleSheetId,omitempty"` // Identifier of the stylesheet containing this object (if exists).
}
// PlatformFontUsage information about amount of glyphs that were rendered
// with given font.
//
@@ -250,19 +262,33 @@ type PlatformFontUsage struct {
GlyphCount float64 `json:"glyphCount"` // Amount of glyphs that were rendered with this font.
}
// FontVariationAxis information about font variation axes for variable
// fonts.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-FontVariationAxis
type FontVariationAxis struct {
Tag string `json:"tag"` // The font-variation-setting tag (a.k.a. "axis tag").
Name string `json:"name"` // Human-readable variation name in the default language (normally, "en").
MinValue float64 `json:"minValue"` // The minimum value (inclusive) the font supports for this tag.
MaxValue float64 `json:"maxValue"` // The maximum value (inclusive) the font supports for this tag.
DefaultValue float64 `json:"defaultValue"` // The default value.
}
// FontFace properties of a web font:
// https://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions.
// https://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions and
// additional information such as platformFontFamily and fontVariationAxes.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#type-FontFace
type FontFace struct {
FontFamily string `json:"fontFamily"` // The font-family.
FontStyle string `json:"fontStyle"` // The font-style.
FontVariant string `json:"fontVariant"` // The font-variant.
FontWeight string `json:"fontWeight"` // The font-weight.
FontStretch string `json:"fontStretch"` // The font-stretch.
UnicodeRange string `json:"unicodeRange"` // The unicode-range.
Src string `json:"src"` // The src.
PlatformFontFamily string `json:"platformFontFamily"` // The resolved platform font family
FontFamily string `json:"fontFamily"` // The font-family.
FontStyle string `json:"fontStyle"` // The font-style.
FontVariant string `json:"fontVariant"` // The font-variant.
FontWeight string `json:"fontWeight"` // The font-weight.
FontStretch string `json:"fontStretch"` // The font-stretch.
UnicodeRange string `json:"unicodeRange"` // The unicode-range.
Src string `json:"src"` // The src.
PlatformFontFamily string `json:"platformFontFamily"` // The resolved platform font family
FontVariationAxes []*FontVariationAxis `json:"fontVariationAxes,omitempty"` // Available variation settings (a.k.a. "axes").
}
// KeyframesRule CSS keyframes rule representation.

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDatabase(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -125,7 +125,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDatabase1(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -191,7 +191,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDatabase2(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -350,7 +350,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDatabase3(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -423,7 +423,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDatabase4(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -501,7 +501,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDatabase5(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -574,7 +574,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDatabase6(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -633,7 +633,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDatabase7(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -692,7 +692,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDatabase8(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -204,57 +204,6 @@ func (p *EvaluateOnCallFrameParams) Do(ctx context.Context) (result *runtime.Rem
return res.Result, res.ExceptionDetails, nil
}
// ExecuteWasmEvaluatorParams execute a Wasm Evaluator module on a given call
// frame.
type ExecuteWasmEvaluatorParams struct {
CallFrameID CallFrameID `json:"callFrameId"` // WebAssembly call frame identifier to evaluate on.
Evaluator string `json:"evaluator"` // Code of the evaluator module.
Timeout runtime.TimeDelta `json:"timeout,omitempty"` // Terminate execution after timing out (number of milliseconds).
}
// ExecuteWasmEvaluator execute a Wasm Evaluator module on a given call
// frame.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-executeWasmEvaluator
//
// parameters:
// callFrameID - WebAssembly call frame identifier to evaluate on.
// evaluator - Code of the evaluator module.
func ExecuteWasmEvaluator(callFrameID CallFrameID, evaluator string) *ExecuteWasmEvaluatorParams {
return &ExecuteWasmEvaluatorParams{
CallFrameID: callFrameID,
Evaluator: evaluator,
}
}
// WithTimeout terminate execution after timing out (number of milliseconds).
func (p ExecuteWasmEvaluatorParams) WithTimeout(timeout runtime.TimeDelta) *ExecuteWasmEvaluatorParams {
p.Timeout = timeout
return &p
}
// ExecuteWasmEvaluatorReturns return values.
type ExecuteWasmEvaluatorReturns struct {
Result *runtime.RemoteObject `json:"result,omitempty"` // Object wrapper for the evaluation result.
ExceptionDetails *runtime.ExceptionDetails `json:"exceptionDetails,omitempty"` // Exception details.
}
// Do executes Debugger.executeWasmEvaluator against the provided context.
//
// returns:
// result - Object wrapper for the evaluation result.
// exceptionDetails - Exception details.
func (p *ExecuteWasmEvaluatorParams) Do(ctx context.Context) (result *runtime.RemoteObject, exceptionDetails *runtime.ExceptionDetails, err error) {
// execute
var res ExecuteWasmEvaluatorReturns
err = cdp.Execute(ctx, CommandExecuteWasmEvaluator, p, &res)
if err != nil {
return nil, nil, err
}
return res.Result, res.ExceptionDetails, nil
}
// GetPossibleBreakpointsParams returns possible locations for breakpoint.
// scriptId in start and end range locations should be the same.
type GetPossibleBreakpointsParams struct {
@@ -429,47 +378,6 @@ func (p *RemoveBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandRemoveBreakpoint, p, nil)
}
// RestartFrameParams restarts particular call frame from the beginning.
type RestartFrameParams struct {
CallFrameID CallFrameID `json:"callFrameId"` // Call frame identifier to evaluate on.
}
// RestartFrame restarts particular call frame from the beginning.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-restartFrame
//
// parameters:
// callFrameID - Call frame identifier to evaluate on.
func RestartFrame(callFrameID CallFrameID) *RestartFrameParams {
return &RestartFrameParams{
CallFrameID: callFrameID,
}
}
// RestartFrameReturns return values.
type RestartFrameReturns struct {
CallFrames []*CallFrame `json:"callFrames,omitempty"` // New stack trace.
AsyncStackTrace *runtime.StackTrace `json:"asyncStackTrace,omitempty"` // Async stack trace, if any.
AsyncStackTraceID *runtime.StackTraceID `json:"asyncStackTraceId,omitempty"` // Async stack trace, if any.
}
// Do executes Debugger.restartFrame against the provided context.
//
// returns:
// callFrames - New stack trace.
// asyncStackTrace - Async stack trace, if any.
// asyncStackTraceID - Async stack trace, if any.
func (p *RestartFrameParams) Do(ctx context.Context) (callFrames []*CallFrame, asyncStackTrace *runtime.StackTrace, asyncStackTraceID *runtime.StackTraceID, err error) {
// execute
var res RestartFrameReturns
err = cdp.Execute(ctx, CommandRestartFrame, p, &res)
if err != nil {
return nil, nil, nil, err
}
return res.CallFrames, res.AsyncStackTrace, res.AsyncStackTraceID, nil
}
// ResumeParams resumes JavaScript execution.
type ResumeParams struct {
TerminateOnResume bool `json:"terminateOnResume,omitempty"` // Set to true to terminate execution upon resuming execution. In contrast to Runtime.terminateExecution, this will allows to execute further JavaScript (i.e. via evaluation) until execution of the paused code is actually resumed, at which point termination is triggered. If execution is currently not paused, this parameter has no effect.
@@ -1045,7 +953,8 @@ func (p *SetVariableValueParams) Do(ctx context.Context) (err error) {
// StepIntoParams steps into the function call.
type StepIntoParams struct {
BreakOnAsyncCall bool `json:"breakOnAsyncCall,omitempty"` // Debugger will pause on the execution of the first async task which was scheduled before next pause.
BreakOnAsyncCall bool `json:"breakOnAsyncCall,omitempty"` // Debugger will pause on the execution of the first async task which was scheduled before next pause.
SkipList []*LocationRange `json:"skipList,omitempty"` // The skipList specifies location ranges that should be skipped on step into.
}
// StepInto steps into the function call.
@@ -1064,6 +973,13 @@ func (p StepIntoParams) WithBreakOnAsyncCall(breakOnAsyncCall bool) *StepIntoPar
return &p
}
// WithSkipList the skipList specifies location ranges that should be skipped
// on step into.
func (p StepIntoParams) WithSkipList(skipList []*LocationRange) *StepIntoParams {
p.SkipList = skipList
return &p
}
// Do executes Debugger.stepInto against the provided context.
func (p *StepIntoParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStepInto, p, nil)
@@ -1085,18 +1001,29 @@ func (p *StepOutParams) Do(ctx context.Context) (err error) {
}
// StepOverParams steps over the statement.
type StepOverParams struct{}
type StepOverParams struct {
SkipList []*LocationRange `json:"skipList,omitempty"` // The skipList specifies location ranges that should be skipped on step over.
}
// StepOver steps over the statement.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-stepOver
//
// parameters:
func StepOver() *StepOverParams {
return &StepOverParams{}
}
// WithSkipList the skipList specifies location ranges that should be skipped
// on step over.
func (p StepOverParams) WithSkipList(skipList []*LocationRange) *StepOverParams {
p.SkipList = skipList
return &p
}
// Do executes Debugger.stepOver against the provided context.
func (p *StepOverParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStepOver, nil, nil)
return cdp.Execute(ctx, CommandStepOver, p, nil)
}
// Command names.
@@ -1105,13 +1032,11 @@ const (
CommandDisable = "Debugger.disable"
CommandEnable = "Debugger.enable"
CommandEvaluateOnCallFrame = "Debugger.evaluateOnCallFrame"
CommandExecuteWasmEvaluator = "Debugger.executeWasmEvaluator"
CommandGetPossibleBreakpoints = "Debugger.getPossibleBreakpoints"
CommandGetScriptSource = "Debugger.getScriptSource"
CommandGetStackTrace = "Debugger.getStackTrace"
CommandPause = "Debugger.pause"
CommandRemoveBreakpoint = "Debugger.removeBreakpoint"
CommandRestartFrame = "Debugger.restartFrame"
CommandResume = "Debugger.resume"
CommandSearchInContent = "Debugger.searchInContent"
CommandSetAsyncCallStackDepth = "Debugger.setAsyncCallStackDepth"

File diff suppressed because it is too large Load Diff

View File

@@ -55,6 +55,7 @@ type EventScriptFailedToParse struct {
StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` // JavaScript top stack frame of where the script parsed event was triggered if available.
CodeOffset int64 `json:"codeOffset,omitempty"` // If the scriptLanguage is WebAssembly, the code section offset in the module.
ScriptLanguage ScriptLanguage `json:"scriptLanguage,omitempty"` // The language of the script.
EmbedderName string `json:"embedderName,omitempty"` // The name the embedder supplied for this script.
}
// EventScriptParsed fired when virtual machine parses script. This event is
@@ -80,4 +81,5 @@ type EventScriptParsed struct {
CodeOffset int64 `json:"codeOffset,omitempty"` // If the scriptLanguage is WebAssembly, the code section offset in the module.
ScriptLanguage ScriptLanguage `json:"scriptLanguage,omitempty"` // The language of the script.
DebugSymbols *DebugSymbols `json:"debugSymbols,omitempty"` // If the scriptLanguage is WebASsembly, the source of debug symbols for the module.
EmbedderName string `json:"embedderName,omitempty"` // The name the embedder supplied for this script.
}

View File

@@ -48,6 +48,15 @@ type ScriptPosition struct {
ColumnNumber int64 `json:"columnNumber"`
}
// LocationRange location range within one script.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-LocationRange
type LocationRange struct {
ScriptID runtime.ScriptID `json:"scriptId"`
Start *ScriptPosition `json:"start"`
End *ScriptPosition `json:"end"`
}
// CallFrame JavaScript call frame. Array of call frames form the call stack.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-CallFrame
@@ -322,6 +331,7 @@ func (t PausedReason) String() string {
const (
PausedReasonAmbiguous PausedReason = "ambiguous"
PausedReasonAssert PausedReason = "assert"
PausedReasonCSPViolation PausedReason = "CSPViolation"
PausedReasonDebugCommand PausedReason = "debugCommand"
PausedReasonDOM PausedReason = "DOM"
PausedReasonEventListener PausedReason = "EventListener"
@@ -350,6 +360,8 @@ func (t *PausedReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = PausedReasonAmbiguous
case PausedReasonAssert:
*t = PausedReasonAssert
case PausedReasonCSPViolation:
*t = PausedReasonCSPViolation
case PausedReasonDebugCommand:
*t = PausedReasonDebugCommand
case PausedReasonDOM:

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceorientation(in *jlexer.
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -108,7 +108,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceorientation1(in *jlexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -531,56 +531,54 @@ func (p *GetDocumentParams) Do(ctx context.Context) (root *cdp.Node, err error)
return res.Root, nil
}
// GetFlattenedDocumentParams returns the root DOM node (and optionally the
// subtree) to the caller.
type GetFlattenedDocumentParams struct {
Depth int64 `json:"depth,omitempty"` // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
Pierce bool `json:"pierce,omitempty"` // Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
// GetNodesForSubtreeByStyleParams finds nodes with a given computed style in
// a subtree.
type GetNodesForSubtreeByStyleParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Node ID pointing to the root of a subtree.
ComputedStyles []*CSSComputedStyleProperty `json:"computedStyles"` // The style to filter nodes by (includes nodes if any of properties matches).
Pierce bool `json:"pierce,omitempty"` // Whether or not iframes and shadow roots in the same target should be traversed when returning the results (default is false).
}
// GetFlattenedDocument returns the root DOM node (and optionally the
// subtree) to the caller.
// GetNodesForSubtreeByStyle finds nodes with a given computed style in a
// subtree.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getFlattenedDocument
// See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#method-getNodesForSubtreeByStyle
//
// parameters:
func GetFlattenedDocument() *GetFlattenedDocumentParams {
return &GetFlattenedDocumentParams{}
// nodeID - Node ID pointing to the root of a subtree.
// computedStyles - The style to filter nodes by (includes nodes if any of properties matches).
func GetNodesForSubtreeByStyle(nodeID cdp.NodeID, computedStyles []*CSSComputedStyleProperty) *GetNodesForSubtreeByStyleParams {
return &GetNodesForSubtreeByStyleParams{
NodeID: nodeID,
ComputedStyles: computedStyles,
}
}
// WithDepth the maximum depth at which children should be retrieved,
// defaults to 1. Use -1 for the entire subtree or provide an integer larger
// than 0.
func (p GetFlattenedDocumentParams) WithDepth(depth int64) *GetFlattenedDocumentParams {
p.Depth = depth
return &p
}
// WithPierce whether or not iframes and shadow roots should be traversed
// when returning the subtree (default is false).
func (p GetFlattenedDocumentParams) WithPierce(pierce bool) *GetFlattenedDocumentParams {
// WithPierce whether or not iframes and shadow roots in the same target
// should be traversed when returning the results (default is false).
func (p GetNodesForSubtreeByStyleParams) WithPierce(pierce bool) *GetNodesForSubtreeByStyleParams {
p.Pierce = pierce
return &p
}
// GetFlattenedDocumentReturns return values.
type GetFlattenedDocumentReturns struct {
Nodes []*cdp.Node `json:"nodes,omitempty"` // Resulting node.
// GetNodesForSubtreeByStyleReturns return values.
type GetNodesForSubtreeByStyleReturns struct {
NodeIds []cdp.NodeID `json:"nodeIds,omitempty"` // Resulting nodes.
}
// Do executes DOM.getFlattenedDocument against the provided context.
// Do executes DOM.getNodesForSubtreeByStyle against the provided context.
//
// returns:
// nodes - Resulting node.
func (p *GetFlattenedDocumentParams) Do(ctx context.Context) (nodes []*cdp.Node, err error) {
// nodeIds - Resulting nodes.
func (p *GetNodesForSubtreeByStyleParams) Do(ctx context.Context) (nodeIds []cdp.NodeID, err error) {
// execute
var res GetFlattenedDocumentReturns
err = cdp.Execute(ctx, CommandGetFlattenedDocument, p, &res)
var res GetNodesForSubtreeByStyleReturns
err = cdp.Execute(ctx, CommandGetNodesForSubtreeByStyle, p, &res)
if err != nil {
return nil, err
}
return res.Nodes, nil
return res.NodeIds, nil
}
// GetNodeForLocationParams returns node id at given location. Depending on
@@ -1663,7 +1661,7 @@ const (
CommandGetBoxModel = "DOM.getBoxModel"
CommandGetContentQuads = "DOM.getContentQuads"
CommandGetDocument = "DOM.getDocument"
CommandGetFlattenedDocument = "DOM.getFlattenedDocument"
CommandGetNodesForSubtreeByStyle = "DOM.getNodesForSubtreeByStyle"
CommandGetNodeForLocation = "DOM.getNodeForLocation"
CommandGetOuterHTML = "DOM.getOuterHTML"
CommandGetRelayoutBoundary = "DOM.getRelayoutBoundary"

File diff suppressed because it is too large Load Diff

View File

@@ -43,3 +43,11 @@ type Rect struct {
Width float64 `json:"width"` // Rectangle width
Height float64 `json:"height"` // Rectangle height
}
// CSSComputedStyleProperty [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/DOM#type-CSSComputedStyleProperty
type CSSComputedStyleProperty struct {
Name string `json:"name"` // Computed style property name.
Value string `json:"value"` // Computed style property value.
}

View File

@@ -175,6 +175,28 @@ func (p *RemoveXHRBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandRemoveXHRBreakpoint, p, nil)
}
// SetBreakOnCSPViolationParams sets breakpoint on particular CSP violations.
type SetBreakOnCSPViolationParams struct {
ViolationTypes []CSPViolationType `json:"violationTypes"` // CSP Violations to stop upon.
}
// SetBreakOnCSPViolation sets breakpoint on particular CSP violations.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger#method-setBreakOnCSPViolation
//
// parameters:
// violationTypes - CSP Violations to stop upon.
func SetBreakOnCSPViolation(violationTypes []CSPViolationType) *SetBreakOnCSPViolationParams {
return &SetBreakOnCSPViolationParams{
ViolationTypes: violationTypes,
}
}
// Do executes DOMDebugger.setBreakOnCSPViolation against the provided context.
func (p *SetBreakOnCSPViolationParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetBreakOnCSPViolation, p, nil)
}
// SetDOMBreakpointParams sets breakpoint on particular operation with DOM.
type SetDOMBreakpointParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Identifier of the node to set breakpoint on.
@@ -282,6 +304,7 @@ const (
CommandRemoveEventListenerBreakpoint = "DOMDebugger.removeEventListenerBreakpoint"
CommandRemoveInstrumentationBreakpoint = "DOMDebugger.removeInstrumentationBreakpoint"
CommandRemoveXHRBreakpoint = "DOMDebugger.removeXHRBreakpoint"
CommandSetBreakOnCSPViolation = "DOMDebugger.setBreakOnCSPViolation"
CommandSetDOMBreakpoint = "DOMDebugger.setDOMBreakpoint"
CommandSetEventListenerBreakpoint = "DOMDebugger.setEventListenerBreakpoint"
CommandSetInstrumentationBreakpoint = "DOMDebugger.setInstrumentationBreakpoint"

View File

@@ -29,7 +29,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -95,7 +95,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger1(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -161,7 +161,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger2(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -234,7 +234,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger3(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -296,7 +296,7 @@ func (v *SetDOMBreakpointParams) UnmarshalJSON(data []byte) error {
func (v *SetDOMBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger3(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(in *jlexer.Lexer, out *RemoveXHRBreakpointParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(in *jlexer.Lexer, out *SetBreakOnCSPViolationParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -307,7 +307,105 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(in *jlexer.Lexer
}
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 "violationTypes":
if in.IsNull() {
in.Skip()
out.ViolationTypes = nil
} else {
in.Delim('[')
if out.ViolationTypes == nil {
if !in.IsDelim(']') {
out.ViolationTypes = make([]CSPViolationType, 0, 4)
} else {
out.ViolationTypes = []CSPViolationType{}
}
} else {
out.ViolationTypes = (out.ViolationTypes)[:0]
}
for !in.IsDelim(']') {
var v1 CSPViolationType
(v1).UnmarshalEasyJSON(in)
out.ViolationTypes = append(out.ViolationTypes, v1)
in.WantComma()
}
in.Delim(']')
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(out *jwriter.Writer, in SetBreakOnCSPViolationParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"violationTypes\":"
out.RawString(prefix[1:])
if in.ViolationTypes == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v2, v3 := range in.ViolationTypes {
if v2 > 0 {
out.RawByte(',')
}
(v3).MarshalEasyJSON(out)
}
out.RawByte(']')
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v SetBreakOnCSPViolationParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetBreakOnCSPViolationParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *SetBreakOnCSPViolationParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetBreakOnCSPViolationParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(in *jlexer.Lexer, out *RemoveXHRBreakpointParams) {
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()
@@ -327,7 +425,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(out *jwriter.Writer, in RemoveXHRBreakpointParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(out *jwriter.Writer, in RemoveXHRBreakpointParams) {
out.RawByte('{')
first := true
_ = first
@@ -342,27 +440,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v RemoveXHRBreakpointParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RemoveXHRBreakpointParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger4(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RemoveXHRBreakpointParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RemoveXHRBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger4(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(in *jlexer.Lexer, out *RemoveInstrumentationBreakpointParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(in *jlexer.Lexer, out *RemoveInstrumentationBreakpointParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -373,7 +471,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -393,7 +491,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(out *jwriter.Writer, in RemoveInstrumentationBreakpointParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(out *jwriter.Writer, in RemoveInstrumentationBreakpointParams) {
out.RawByte('{')
first := true
_ = first
@@ -408,27 +506,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v RemoveInstrumentationBreakpointParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RemoveInstrumentationBreakpointParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger5(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RemoveInstrumentationBreakpointParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RemoveInstrumentationBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger5(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(in *jlexer.Lexer, out *RemoveEventListenerBreakpointParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(in *jlexer.Lexer, out *RemoveEventListenerBreakpointParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -439,7 +537,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -461,7 +559,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(out *jwriter.Writer, in RemoveEventListenerBreakpointParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(out *jwriter.Writer, in RemoveEventListenerBreakpointParams) {
out.RawByte('{')
first := true
_ = first
@@ -481,27 +579,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v RemoveEventListenerBreakpointParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RemoveEventListenerBreakpointParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger6(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RemoveEventListenerBreakpointParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RemoveEventListenerBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger6(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(in *jlexer.Lexer, out *RemoveDOMBreakpointParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(in *jlexer.Lexer, out *RemoveDOMBreakpointParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -512,7 +610,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -534,7 +632,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(out *jwriter.Writer, in RemoveDOMBreakpointParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(out *jwriter.Writer, in RemoveDOMBreakpointParams) {
out.RawByte('{')
first := true
_ = first
@@ -554,27 +652,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v RemoveDOMBreakpointParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v RemoveDOMBreakpointParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger7(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *RemoveDOMBreakpointParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *RemoveDOMBreakpointParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger7(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(in *jlexer.Lexer, out *GetEventListenersReturns) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(in *jlexer.Lexer, out *GetEventListenersReturns) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -585,7 +683,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -609,17 +707,17 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(in *jlexer.Lexer
out.Listeners = (out.Listeners)[:0]
}
for !in.IsDelim(']') {
var v1 *EventListener
var v4 *EventListener
if in.IsNull() {
in.Skip()
v1 = nil
v4 = nil
} else {
if v1 == nil {
v1 = new(EventListener)
if v4 == nil {
v4 = new(EventListener)
}
(*v1).UnmarshalEasyJSON(in)
(*v4).UnmarshalEasyJSON(in)
}
out.Listeners = append(out.Listeners, v1)
out.Listeners = append(out.Listeners, v4)
in.WantComma()
}
in.Delim(']')
@@ -634,7 +732,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(out *jwriter.Writer, in GetEventListenersReturns) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(out *jwriter.Writer, in GetEventListenersReturns) {
out.RawByte('{')
first := true
_ = first
@@ -644,14 +742,14 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(out *jwriter.Wri
out.RawString(prefix[1:])
{
out.RawByte('[')
for v2, v3 := range in.Listeners {
if v2 > 0 {
for v5, v6 := range in.Listeners {
if v5 > 0 {
out.RawByte(',')
}
if v3 == nil {
if v6 == nil {
out.RawString("null")
} else {
(*v3).MarshalEasyJSON(out)
(*v6).MarshalEasyJSON(out)
}
}
out.RawByte(']')
@@ -663,27 +761,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v GetEventListenersReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetEventListenersReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger8(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetEventListenersReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetEventListenersReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger8(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(in *jlexer.Lexer, out *GetEventListenersParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger10(in *jlexer.Lexer, out *GetEventListenersParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -694,7 +792,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -718,7 +816,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(in *jlexer.Lexer
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(out *jwriter.Writer, in GetEventListenersParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger10(out *jwriter.Writer, in GetEventListenersParams) {
out.RawByte('{')
first := true
_ = first
@@ -743,27 +841,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(out *jwriter.Wri
// MarshalJSON supports json.Marshaler interface
func (v GetEventListenersParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger10(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetEventListenersParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger9(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger10(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetEventListenersParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger10(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetEventListenersParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger9(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger10(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger10(in *jlexer.Lexer, out *EventListener) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger11(in *jlexer.Lexer, out *EventListener) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -774,7 +872,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger10(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -828,7 +926,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger10(in *jlexer.Lexe
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger10(out *jwriter.Writer, in EventListener) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger11(out *jwriter.Writer, in EventListener) {
out.RawByte('{')
first := true
_ = first
@@ -888,23 +986,23 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger10(out *jwriter.Wr
// MarshalJSON supports json.Marshaler interface
func (v EventListener) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger10(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger11(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventListener) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger10(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomdebugger11(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EventListener) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger10(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger11(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventListener) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger10(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomdebugger11(l, v)
}

View File

@@ -59,6 +59,50 @@ func (t *DOMBreakpointType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CSPViolationType cSP Violation type.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger#type-CSPViolationType
type CSPViolationType string
// String returns the CSPViolationType as string value.
func (t CSPViolationType) String() string {
return string(t)
}
// CSPViolationType values.
const (
CSPViolationTypeTrustedtypeSinkViolation CSPViolationType = "trustedtype-sink-violation"
CSPViolationTypeTrustedtypePolicyViolation CSPViolationType = "trustedtype-policy-violation"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CSPViolationType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CSPViolationType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CSPViolationType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CSPViolationType(in.String()) {
case CSPViolationTypeTrustedtypeSinkViolation:
*t = CSPViolationTypeTrustedtypeSinkViolation
case CSPViolationTypeTrustedtypePolicyViolation:
*t = CSPViolationTypeTrustedtypePolicyViolation
default:
in.AddError(errors.New("unknown CSPViolationType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CSPViolationType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// EventListener object event listener.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger#type-EventListener

View File

@@ -51,9 +51,11 @@ func (p *EnableParams) Do(ctx context.Context) (err error) {
// style information for the nodes. Shadow DOM in the returned DOM tree is
// flattened.
type CaptureSnapshotParams struct {
ComputedStyles []string `json:"computedStyles"` // Whitelist of computed styles to return.
IncludePaintOrder bool `json:"includePaintOrder,omitempty"` // Whether to include layout object paint orders into the snapshot.
IncludeDOMRects bool `json:"includeDOMRects,omitempty"` // Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot
ComputedStyles []string `json:"computedStyles"` // Whitelist of computed styles to return.
IncludePaintOrder bool `json:"includePaintOrder,omitempty"` // Whether to include layout object paint orders into the snapshot.
IncludeDOMRects bool `json:"includeDOMRects,omitempty"` // Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot
IncludeBlendedBackgroundColors bool `json:"includeBlendedBackgroundColors,omitempty"` // Whether to include blended background colors in the snapshot (default: false). Blended background color is achieved by blending background colors of all elements that overlap with the current element.
IncludeTextColorOpacities bool `json:"includeTextColorOpacities,omitempty"` // Whether to include text color opacity in the snapshot (default: false). An element might have the opacity property set that affects the text color of the element. The final text color opacity is computed based on the opacity of all overlapping elements.
}
// CaptureSnapshot returns a document snapshot, including the full DOM tree
@@ -86,6 +88,24 @@ func (p CaptureSnapshotParams) WithIncludeDOMRects(includeDOMRects bool) *Captur
return &p
}
// WithIncludeBlendedBackgroundColors whether to include blended background
// colors in the snapshot (default: false). Blended background color is achieved
// by blending background colors of all elements that overlap with the current
// element.
func (p CaptureSnapshotParams) WithIncludeBlendedBackgroundColors(includeBlendedBackgroundColors bool) *CaptureSnapshotParams {
p.IncludeBlendedBackgroundColors = includeBlendedBackgroundColors
return &p
}
// WithIncludeTextColorOpacities whether to include text color opacity in the
// snapshot (default: false). An element might have the opacity property set
// that affects the text color of the element. The final text color opacity is
// computed based on the opacity of all overlapping elements.
func (p CaptureSnapshotParams) WithIncludeTextColorOpacities(includeTextColorOpacities bool) *CaptureSnapshotParams {
p.IncludeTextColorOpacities = includeTextColorOpacities
return &p
}
// CaptureSnapshotReturns return values.
type CaptureSnapshotReturns struct {
Documents []*DocumentSnapshot `json:"documents,omitempty"` // The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.

View File

@@ -31,7 +31,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -278,7 +278,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot1(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -415,7 +415,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot2(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -552,7 +552,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot3(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -650,7 +650,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot4(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1169,7 +1169,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot5(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1242,7 +1242,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot6(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1549,6 +1549,52 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot6(in *jlexer.Lexer
}
in.Delim(']')
}
case "blendedBackgroundColors":
if in.IsNull() {
in.Skip()
out.BlendedBackgroundColors = nil
} else {
in.Delim('[')
if out.BlendedBackgroundColors == nil {
if !in.IsDelim(']') {
out.BlendedBackgroundColors = make([]StringIndex, 0, 8)
} else {
out.BlendedBackgroundColors = []StringIndex{}
}
} else {
out.BlendedBackgroundColors = (out.BlendedBackgroundColors)[:0]
}
for !in.IsDelim(']') {
var v65 StringIndex
v65 = StringIndex(in.Int64())
out.BlendedBackgroundColors = append(out.BlendedBackgroundColors, v65)
in.WantComma()
}
in.Delim(']')
}
case "textColorOpacities":
if in.IsNull() {
in.Skip()
out.TextColorOpacities = nil
} else {
in.Delim('[')
if out.TextColorOpacities == nil {
if !in.IsDelim(']') {
out.TextColorOpacities = make([]float64, 0, 8)
} else {
out.TextColorOpacities = []float64{}
}
} else {
out.TextColorOpacities = (out.TextColorOpacities)[:0]
}
for !in.IsDelim(']') {
var v66 float64
v66 = float64(in.Float64())
out.TextColorOpacities = append(out.TextColorOpacities, v66)
in.WantComma()
}
in.Delim(']')
}
default:
in.SkipRecursive()
}
@@ -1570,11 +1616,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot6(out *jwriter.Wri
out.RawString("null")
} else {
out.RawByte('[')
for v65, v66 := range in.NodeIndex {
if v65 > 0 {
for v67, v68 := range in.NodeIndex {
if v67 > 0 {
out.RawByte(',')
}
out.Int64(int64(v66))
out.Int64(int64(v68))
}
out.RawByte(']')
}
@@ -1586,19 +1632,19 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot6(out *jwriter.Wri
out.RawString("null")
} else {
out.RawByte('[')
for v67, v68 := range in.Styles {
if v67 > 0 {
for v69, v70 := range in.Styles {
if v69 > 0 {
out.RawByte(',')
}
if v68 == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
if v70 == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v69, v70 := range v68 {
if v69 > 0 {
for v71, v72 := range v70 {
if v71 > 0 {
out.RawByte(',')
}
out.Int64(int64(v70))
out.Int64(int64(v72))
}
out.RawByte(']')
}
@@ -1613,19 +1659,19 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot6(out *jwriter.Wri
out.RawString("null")
} else {
out.RawByte('[')
for v71, v72 := range in.Bounds {
if v71 > 0 {
for v73, v74 := range in.Bounds {
if v73 > 0 {
out.RawByte(',')
}
if v72 == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
if v74 == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v73, v74 := range v72 {
if v73 > 0 {
for v75, v76 := range v74 {
if v75 > 0 {
out.RawByte(',')
}
out.Float64(float64(v74))
out.Float64(float64(v76))
}
out.RawByte(']')
}
@@ -1640,11 +1686,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot6(out *jwriter.Wri
out.RawString("null")
} else {
out.RawByte('[')
for v75, v76 := range in.Text {
if v75 > 0 {
for v77, v78 := range in.Text {
if v77 > 0 {
out.RawByte(',')
}
out.Int64(int64(v76))
out.Int64(int64(v78))
}
out.RawByte(']')
}
@@ -1663,11 +1709,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot6(out *jwriter.Wri
out.RawString(prefix)
{
out.RawByte('[')
for v77, v78 := range in.PaintOrders {
if v77 > 0 {
for v79, v80 := range in.PaintOrders {
if v79 > 0 {
out.RawByte(',')
}
out.Int64(int64(v78))
out.Int64(int64(v80))
}
out.RawByte(']')
}
@@ -1677,19 +1723,19 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot6(out *jwriter.Wri
out.RawString(prefix)
{
out.RawByte('[')
for v79, v80 := range in.OffsetRects {
if v79 > 0 {
for v81, v82 := range in.OffsetRects {
if v81 > 0 {
out.RawByte(',')
}
if v80 == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
if v82 == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v81, v82 := range v80 {
if v81 > 0 {
for v83, v84 := range v82 {
if v83 > 0 {
out.RawByte(',')
}
out.Float64(float64(v82))
out.Float64(float64(v84))
}
out.RawByte(']')
}
@@ -1702,19 +1748,19 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot6(out *jwriter.Wri
out.RawString(prefix)
{
out.RawByte('[')
for v83, v84 := range in.ScrollRects {
if v83 > 0 {
for v85, v86 := range in.ScrollRects {
if v85 > 0 {
out.RawByte(',')
}
if v84 == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
if v86 == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v85, v86 := range v84 {
if v85 > 0 {
for v87, v88 := range v86 {
if v87 > 0 {
out.RawByte(',')
}
out.Float64(float64(v86))
out.Float64(float64(v88))
}
out.RawByte(']')
}
@@ -1727,19 +1773,19 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot6(out *jwriter.Wri
out.RawString(prefix)
{
out.RawByte('[')
for v87, v88 := range in.ClientRects {
if v87 > 0 {
for v89, v90 := range in.ClientRects {
if v89 > 0 {
out.RawByte(',')
}
if v88 == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
if v90 == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v89, v90 := range v88 {
if v89 > 0 {
for v91, v92 := range v90 {
if v91 > 0 {
out.RawByte(',')
}
out.Float64(float64(v90))
out.Float64(float64(v92))
}
out.RawByte(']')
}
@@ -1747,6 +1793,34 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot6(out *jwriter.Wri
out.RawByte(']')
}
}
if len(in.BlendedBackgroundColors) != 0 {
const prefix string = ",\"blendedBackgroundColors\":"
out.RawString(prefix)
{
out.RawByte('[')
for v93, v94 := range in.BlendedBackgroundColors {
if v93 > 0 {
out.RawByte(',')
}
out.Int64(int64(v94))
}
out.RawByte(']')
}
}
if len(in.TextColorOpacities) != 0 {
const prefix string = ",\"textColorOpacities\":"
out.RawString(prefix)
{
out.RawByte('[')
for v95, v96 := range in.TextColorOpacities {
if v95 > 0 {
out.RawByte(',')
}
out.Float64(float64(v96))
}
out.RawByte(']')
}
}
out.RawByte('}')
}
@@ -1784,7 +1858,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot7(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1822,17 +1896,17 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot7(in *jlexer.Lexer
out.InlineTextNodes = (out.InlineTextNodes)[:0]
}
for !in.IsDelim(']') {
var v91 *InlineTextBox
var v97 *InlineTextBox
if in.IsNull() {
in.Skip()
v91 = nil
v97 = nil
} else {
if v91 == nil {
v91 = new(InlineTextBox)
if v97 == nil {
v97 = new(InlineTextBox)
}
(*v91).UnmarshalEasyJSON(in)
(*v97).UnmarshalEasyJSON(in)
}
out.InlineTextNodes = append(out.InlineTextNodes, v91)
out.InlineTextNodes = append(out.InlineTextNodes, v97)
in.WantComma()
}
in.Delim(']')
@@ -1881,14 +1955,14 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot7(out *jwriter.Wri
out.RawString(prefix)
{
out.RawByte('[')
for v92, v93 := range in.InlineTextNodes {
if v92 > 0 {
for v98, v99 := range in.InlineTextNodes {
if v98 > 0 {
out.RawByte(',')
}
if v93 == nil {
if v99 == nil {
out.RawString("null")
} else {
(*v93).MarshalEasyJSON(out)
(*v99).MarshalEasyJSON(out)
}
}
out.RawByte(']')
@@ -1946,7 +2020,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot8(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2038,7 +2112,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot9(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2097,7 +2171,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot10(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2297,7 +2371,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot11(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2356,7 +2430,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot12(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2396,9 +2470,9 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot12(in *jlexer.Lexe
out.ChildNodeIndexes = (out.ChildNodeIndexes)[:0]
}
for !in.IsDelim(']') {
var v94 int64
v94 = int64(in.Int64())
out.ChildNodeIndexes = append(out.ChildNodeIndexes, v94)
var v100 int64
v100 = int64(in.Int64())
out.ChildNodeIndexes = append(out.ChildNodeIndexes, v100)
in.WantComma()
}
in.Delim(']')
@@ -2419,17 +2493,17 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot12(in *jlexer.Lexe
out.Attributes = (out.Attributes)[:0]
}
for !in.IsDelim(']') {
var v95 *NameValue
var v101 *NameValue
if in.IsNull() {
in.Skip()
v95 = nil
v101 = nil
} else {
if v95 == nil {
v95 = new(NameValue)
if v101 == nil {
v101 = new(NameValue)
}
(*v95).UnmarshalEasyJSON(in)
(*v101).UnmarshalEasyJSON(in)
}
out.Attributes = append(out.Attributes, v95)
out.Attributes = append(out.Attributes, v101)
in.WantComma()
}
in.Delim(']')
@@ -2450,9 +2524,9 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot12(in *jlexer.Lexe
out.PseudoElementIndexes = (out.PseudoElementIndexes)[:0]
}
for !in.IsDelim(']') {
var v96 int64
v96 = int64(in.Int64())
out.PseudoElementIndexes = append(out.PseudoElementIndexes, v96)
var v102 int64
v102 = int64(in.Int64())
out.PseudoElementIndexes = append(out.PseudoElementIndexes, v102)
in.WantComma()
}
in.Delim(']')
@@ -2497,17 +2571,17 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot12(in *jlexer.Lexe
out.EventListeners = (out.EventListeners)[:0]
}
for !in.IsDelim(']') {
var v97 *domdebugger.EventListener
var v103 *domdebugger.EventListener
if in.IsNull() {
in.Skip()
v97 = nil
v103 = nil
} else {
if v97 == nil {
v97 = new(domdebugger.EventListener)
if v103 == nil {
v103 = new(domdebugger.EventListener)
}
(*v97).UnmarshalEasyJSON(in)
(*v103).UnmarshalEasyJSON(in)
}
out.EventListeners = append(out.EventListeners, v97)
out.EventListeners = append(out.EventListeners, v103)
in.WantComma()
}
in.Delim(']')
@@ -2579,11 +2653,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot12(out *jwriter.Wr
out.RawString(prefix)
{
out.RawByte('[')
for v98, v99 := range in.ChildNodeIndexes {
if v98 > 0 {
for v104, v105 := range in.ChildNodeIndexes {
if v104 > 0 {
out.RawByte(',')
}
out.Int64(int64(v99))
out.Int64(int64(v105))
}
out.RawByte(']')
}
@@ -2593,14 +2667,14 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot12(out *jwriter.Wr
out.RawString(prefix)
{
out.RawByte('[')
for v100, v101 := range in.Attributes {
if v100 > 0 {
for v106, v107 := range in.Attributes {
if v106 > 0 {
out.RawByte(',')
}
if v101 == nil {
if v107 == nil {
out.RawString("null")
} else {
(*v101).MarshalEasyJSON(out)
(*v107).MarshalEasyJSON(out)
}
}
out.RawByte(']')
@@ -2611,11 +2685,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot12(out *jwriter.Wr
out.RawString(prefix)
{
out.RawByte('[')
for v102, v103 := range in.PseudoElementIndexes {
if v102 > 0 {
for v108, v109 := range in.PseudoElementIndexes {
if v108 > 0 {
out.RawByte(',')
}
out.Int64(int64(v103))
out.Int64(int64(v109))
}
out.RawByte(']')
}
@@ -2685,14 +2759,14 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot12(out *jwriter.Wr
out.RawString(prefix)
{
out.RawByte('[')
for v104, v105 := range in.EventListeners {
if v104 > 0 {
for v110, v111 := range in.EventListeners {
if v110 > 0 {
out.RawByte(',')
}
if v105 == nil {
if v111 == nil {
out.RawString("null")
} else {
(*v105).MarshalEasyJSON(out)
(*v111).MarshalEasyJSON(out)
}
}
out.RawByte(']')
@@ -2755,7 +2829,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot13(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2779,17 +2853,17 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot13(in *jlexer.Lexe
out.Properties = (out.Properties)[:0]
}
for !in.IsDelim(']') {
var v106 *NameValue
var v112 *NameValue
if in.IsNull() {
in.Skip()
v106 = nil
v112 = nil
} else {
if v106 == nil {
v106 = new(NameValue)
if v112 == nil {
v112 = new(NameValue)
}
(*v106).UnmarshalEasyJSON(in)
(*v112).UnmarshalEasyJSON(in)
}
out.Properties = append(out.Properties, v106)
out.Properties = append(out.Properties, v112)
in.WantComma()
}
in.Delim(']')
@@ -2815,14 +2889,14 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot13(out *jwriter.Wr
out.RawString("null")
} else {
out.RawByte('[')
for v107, v108 := range in.Properties {
if v107 > 0 {
for v113, v114 := range in.Properties {
if v113 > 0 {
out.RawByte(',')
}
if v108 == nil {
if v114 == nil {
out.RawString("null")
} else {
(*v108).MarshalEasyJSON(out)
(*v114).MarshalEasyJSON(out)
}
}
out.RawByte(']')
@@ -2865,7 +2939,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot14(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2889,17 +2963,17 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot14(in *jlexer.Lexe
out.Documents = (out.Documents)[:0]
}
for !in.IsDelim(']') {
var v109 *DocumentSnapshot
var v115 *DocumentSnapshot
if in.IsNull() {
in.Skip()
v109 = nil
v115 = nil
} else {
if v109 == nil {
v109 = new(DocumentSnapshot)
if v115 == nil {
v115 = new(DocumentSnapshot)
}
(*v109).UnmarshalEasyJSON(in)
(*v115).UnmarshalEasyJSON(in)
}
out.Documents = append(out.Documents, v109)
out.Documents = append(out.Documents, v115)
in.WantComma()
}
in.Delim(']')
@@ -2920,9 +2994,9 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot14(in *jlexer.Lexe
out.Strings = (out.Strings)[:0]
}
for !in.IsDelim(']') {
var v110 string
v110 = string(in.String())
out.Strings = append(out.Strings, v110)
var v116 string
v116 = string(in.String())
out.Strings = append(out.Strings, v116)
in.WantComma()
}
in.Delim(']')
@@ -2947,14 +3021,14 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot14(out *jwriter.Wr
out.RawString(prefix[1:])
{
out.RawByte('[')
for v111, v112 := range in.Documents {
if v111 > 0 {
for v117, v118 := range in.Documents {
if v117 > 0 {
out.RawByte(',')
}
if v112 == nil {
if v118 == nil {
out.RawString("null")
} else {
(*v112).MarshalEasyJSON(out)
(*v118).MarshalEasyJSON(out)
}
}
out.RawByte(']')
@@ -2970,11 +3044,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot14(out *jwriter.Wr
}
{
out.RawByte('[')
for v113, v114 := range in.Strings {
if v113 > 0 {
for v119, v120 := range in.Strings {
if v119 > 0 {
out.RawByte(',')
}
out.String(string(v114))
out.String(string(v120))
}
out.RawByte(']')
}
@@ -3016,7 +3090,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot15(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -3040,9 +3114,9 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot15(in *jlexer.Lexe
out.ComputedStyles = (out.ComputedStyles)[:0]
}
for !in.IsDelim(']') {
var v115 string
v115 = string(in.String())
out.ComputedStyles = append(out.ComputedStyles, v115)
var v121 string
v121 = string(in.String())
out.ComputedStyles = append(out.ComputedStyles, v121)
in.WantComma()
}
in.Delim(']')
@@ -3051,6 +3125,10 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomsnapshot15(in *jlexer.Lexe
out.IncludePaintOrder = bool(in.Bool())
case "includeDOMRects":
out.IncludeDOMRects = bool(in.Bool())
case "includeBlendedBackgroundColors":
out.IncludeBlendedBackgroundColors = bool(in.Bool())
case "includeTextColorOpacities":
out.IncludeTextColorOpacities = bool(in.Bool())
default:
in.SkipRecursive()
}
@@ -3072,11 +3150,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot15(out *jwriter.Wr
out.RawString("null")
} else {
out.RawByte('[')
for v116, v117 := range in.ComputedStyles {
if v116 > 0 {
for v122, v123 := range in.ComputedStyles {
if v122 > 0 {
out.RawByte(',')
}
out.String(string(v117))
out.String(string(v123))
}
out.RawByte(']')
}
@@ -3091,6 +3169,16 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDomsnapshot15(out *jwriter.Wr
out.RawString(prefix)
out.Bool(bool(in.IncludeDOMRects))
}
if in.IncludeBlendedBackgroundColors {
const prefix string = ",\"includeBlendedBackgroundColors\":"
out.RawString(prefix)
out.Bool(bool(in.IncludeBlendedBackgroundColors))
}
if in.IncludeTextColorOpacities {
const prefix string = ",\"includeTextColorOpacities\":"
out.RawString(prefix)
out.Bool(bool(in.IncludeTextColorOpacities))
}
out.RawByte('}')
}

View File

@@ -171,15 +171,17 @@ type NodeTreeSnapshot struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot#type-LayoutTreeSnapshot
type LayoutTreeSnapshot struct {
NodeIndex []int64 `json:"nodeIndex"` // Index of the corresponding node in the NodeTreeSnapshot array returned by captureSnapshot.
Styles []ArrayOfStrings `json:"styles"` // Array of indexes specifying computed style strings, filtered according to the computedStyles parameter passed to captureSnapshot.
Bounds []Rectangle `json:"bounds"` // The absolute position bounding box.
Text []StringIndex `json:"text"` // Contents of the LayoutText, if any.
StackingContexts *RareBooleanData `json:"stackingContexts"` // Stacking context information.
PaintOrders []int64 `json:"paintOrders,omitempty"` // Global paint order index, which is determined by the stacking order of the nodes. Nodes that are painted together will have the same index. Only provided if includePaintOrder in captureSnapshot was true.
OffsetRects []Rectangle `json:"offsetRects,omitempty"` // The offset rect of nodes. Only available when includeDOMRects is set to true
ScrollRects []Rectangle `json:"scrollRects,omitempty"` // The scroll rect of nodes. Only available when includeDOMRects is set to true
ClientRects []Rectangle `json:"clientRects,omitempty"` // The client rect of nodes. Only available when includeDOMRects is set to true
NodeIndex []int64 `json:"nodeIndex"` // Index of the corresponding node in the NodeTreeSnapshot array returned by captureSnapshot.
Styles []ArrayOfStrings `json:"styles"` // Array of indexes specifying computed style strings, filtered according to the computedStyles parameter passed to captureSnapshot.
Bounds []Rectangle `json:"bounds"` // The absolute position bounding box.
Text []StringIndex `json:"text"` // Contents of the LayoutText, if any.
StackingContexts *RareBooleanData `json:"stackingContexts"` // Stacking context information.
PaintOrders []int64 `json:"paintOrders,omitempty"` // Global paint order index, which is determined by the stacking order of the nodes. Nodes that are painted together will have the same index. Only provided if includePaintOrder in captureSnapshot was true.
OffsetRects []Rectangle `json:"offsetRects,omitempty"` // The offset rect of nodes. Only available when includeDOMRects is set to true
ScrollRects []Rectangle `json:"scrollRects,omitempty"` // The scroll rect of nodes. Only available when includeDOMRects is set to true
ClientRects []Rectangle `json:"clientRects,omitempty"` // The client rect of nodes. Only available when includeDOMRects is set to true
BlendedBackgroundColors []StringIndex `json:"blendedBackgroundColors,omitempty"` // The list of background colors that are blended with colors of overlapping elements.
TextColorOpacities []float64 `json:"textColorOpacities,omitempty"` // The list of computed text opacities.
}
// TextBoxSnapshot table of details of the post layout rendered text

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomstorage(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -101,7 +101,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomstorage1(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -193,7 +193,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomstorage2(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -278,7 +278,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomstorage3(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -407,7 +407,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomstorage4(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -485,7 +485,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomstorage5(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -563,7 +563,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomstorage6(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -662,7 +662,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomstorage7(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -747,7 +747,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomstorage8(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -839,7 +839,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomstorage9(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -898,7 +898,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomstorage10(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -957,7 +957,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDomstorage11(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -29,7 +29,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdproto(in *jlexer.Lexer, out *empty
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -88,7 +88,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdproto1(in *jlexer.Lexer, out *Mess
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -223,7 +223,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdproto2(in *jlexer.Lexer, out *Erro
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

File diff suppressed because it is too large Load Diff

View File

@@ -187,6 +187,7 @@ type SetDeviceMetricsOverrideParams struct {
DontSetVisibleSize bool `json:"dontSetVisibleSize,omitempty"` // Do not set visible view size, rely upon explicit setVisibleSize call.
ScreenOrientation *ScreenOrientation `json:"screenOrientation,omitempty"` // Screen orientation override.
Viewport *page.Viewport `json:"viewport,omitempty"` // If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions.
DisplayFeature *DisplayFeature `json:"displayFeature,omitempty"` // If set, the display feature of a multi-segment screen. If not set, multi-segment support is turned-off.
}
// SetDeviceMetricsOverride overrides the values of device screen dimensions
@@ -265,6 +266,13 @@ func (p SetDeviceMetricsOverrideParams) WithViewport(viewport *page.Viewport) *S
return &p
}
// WithDisplayFeature if set, the display feature of a multi-segment screen.
// If not set, multi-segment support is turned-off.
func (p SetDeviceMetricsOverrideParams) WithDisplayFeature(displayFeature *DisplayFeature) *SetDeviceMetricsOverrideParams {
p.DisplayFeature = displayFeature
return &p
}
// Do executes Emulation.setDeviceMetricsOverride against the provided context.
func (p *SetDeviceMetricsOverrideParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDeviceMetricsOverride, p, nil)
@@ -441,6 +449,46 @@ func (p *SetGeolocationOverrideParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetGeolocationOverride, p, nil)
}
// SetIdleOverrideParams overrides the Idle state.
type SetIdleOverrideParams struct {
IsUserActive bool `json:"isUserActive"` // Mock isUserActive
IsScreenUnlocked bool `json:"isScreenUnlocked"` // Mock isScreenUnlocked
}
// SetIdleOverride overrides the Idle state.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setIdleOverride
//
// parameters:
// isUserActive - Mock isUserActive
// isScreenUnlocked - Mock isScreenUnlocked
func SetIdleOverride(isUserActive bool, isScreenUnlocked bool) *SetIdleOverrideParams {
return &SetIdleOverrideParams{
IsUserActive: isUserActive,
IsScreenUnlocked: isScreenUnlocked,
}
}
// Do executes Emulation.setIdleOverride against the provided context.
func (p *SetIdleOverrideParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetIdleOverride, p, nil)
}
// ClearIdleOverrideParams clears Idle state overrides.
type ClearIdleOverrideParams struct{}
// ClearIdleOverride clears Idle state overrides.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-clearIdleOverride
func ClearIdleOverride() *ClearIdleOverrideParams {
return &ClearIdleOverrideParams{}
}
// Do executes Emulation.clearIdleOverride against the provided context.
func (p *ClearIdleOverrideParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandClearIdleOverride, nil, nil)
}
// SetPageScaleFactorParams sets a specified page scale factor.
type SetPageScaleFactorParams struct {
PageScaleFactor float64 `json:"pageScaleFactor"` // Page scale factor.
@@ -643,6 +691,28 @@ func (p *SetTimezoneOverrideParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetTimezoneOverride, p, nil)
}
// SetDisabledImageTypesParams [no description].
type SetDisabledImageTypesParams struct {
ImageTypes []DisabledImageType `json:"imageTypes"` // Image types to disable.
}
// SetDisabledImageTypes [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDisabledImageTypes
//
// parameters:
// imageTypes - Image types to disable.
func SetDisabledImageTypes(imageTypes []DisabledImageType) *SetDisabledImageTypesParams {
return &SetDisabledImageTypesParams{
ImageTypes: imageTypes,
}
}
// Do executes Emulation.setDisabledImageTypes against the provided context.
func (p *SetDisabledImageTypesParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDisabledImageTypes, p, nil)
}
// SetUserAgentOverrideParams allows overriding user agent with the given
// string.
type SetUserAgentOverrideParams struct {
@@ -704,11 +774,14 @@ const (
CommandSetEmulatedMedia = "Emulation.setEmulatedMedia"
CommandSetEmulatedVisionDeficiency = "Emulation.setEmulatedVisionDeficiency"
CommandSetGeolocationOverride = "Emulation.setGeolocationOverride"
CommandSetIdleOverride = "Emulation.setIdleOverride"
CommandClearIdleOverride = "Emulation.clearIdleOverride"
CommandSetPageScaleFactor = "Emulation.setPageScaleFactor"
CommandSetScriptExecutionDisabled = "Emulation.setScriptExecutionDisabled"
CommandSetTouchEmulationEnabled = "Emulation.setTouchEmulationEnabled"
CommandSetVirtualTimePolicy = "Emulation.setVirtualTimePolicy"
CommandSetLocaleOverride = "Emulation.setLocaleOverride"
CommandSetTimezoneOverride = "Emulation.setTimezoneOverride"
CommandSetDisabledImageTypes = "Emulation.setDisabledImageTypes"
CommandSetUserAgentOverride = "Emulation.setUserAgentOverride"
)

View File

@@ -18,6 +18,15 @@ type ScreenOrientation struct {
Angle int64 `json:"angle"` // Orientation angle.
}
// DisplayFeature [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-DisplayFeature
type DisplayFeature struct {
Orientation DisplayFeatureOrientation `json:"orientation"` // Orientation of a display feature in relation to screen
Offset int64 `json:"offset"` // The offset from the screen origin in either the x (for vertical orientation) or y (for horizontal orientation) direction.
MaskLength int64 `json:"maskLength"` // A display feature may mask content such that it is not physically displayed - this length along with the offset describes this area. A display feature that only splits content will have a 0 mask_length.
}
// MediaFeature [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-MediaFeature
@@ -87,12 +96,13 @@ type UserAgentBrandVersion struct {
}
// UserAgentMetadata used to specify User Agent Cient Hints to emulate. See
// https://wicg.github.io/ua-client-hints.
// https://wicg.github.io/ua-client-hints Missing optional values will be filled
// in by the target with what it would normally use.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-UserAgentMetadata
type UserAgentMetadata struct {
Brands []*UserAgentBrandVersion `json:"brands"`
FullVersion string `json:"fullVersion"`
Brands []*UserAgentBrandVersion `json:"brands,omitempty"`
FullVersion string `json:"fullVersion,omitempty"`
Platform string `json:"platform"`
PlatformVersion string `json:"platformVersion"`
Architecture string `json:"architecture"`
@@ -100,6 +110,53 @@ type UserAgentMetadata struct {
Mobile bool `json:"mobile"`
}
// DisabledImageType enum of image types that can be disabled.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-DisabledImageType
type DisabledImageType string
// String returns the DisabledImageType as string value.
func (t DisabledImageType) String() string {
return string(t)
}
// DisabledImageType values.
const (
DisabledImageTypeAvif DisabledImageType = "avif"
DisabledImageTypeJxl DisabledImageType = "jxl"
DisabledImageTypeWebp DisabledImageType = "webp"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t DisabledImageType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t DisabledImageType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *DisabledImageType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch DisabledImageType(in.String()) {
case DisabledImageTypeAvif:
*t = DisabledImageTypeAvif
case DisabledImageTypeJxl:
*t = DisabledImageTypeJxl
case DisabledImageTypeWebp:
*t = DisabledImageTypeWebp
default:
in.AddError(errors.New("unknown DisabledImageType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *DisabledImageType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// OrientationType orientation type.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-ScreenOrientation
@@ -150,6 +207,51 @@ func (t *OrientationType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// DisplayFeatureOrientation orientation of a display feature in relation to
// screen.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-DisplayFeature
type DisplayFeatureOrientation string
// String returns the DisplayFeatureOrientation as string value.
func (t DisplayFeatureOrientation) String() string {
return string(t)
}
// DisplayFeatureOrientation values.
const (
DisplayFeatureOrientationVertical DisplayFeatureOrientation = "vertical"
DisplayFeatureOrientationHorizontal DisplayFeatureOrientation = "horizontal"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t DisplayFeatureOrientation) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t DisplayFeatureOrientation) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *DisplayFeatureOrientation) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch DisplayFeatureOrientation(in.String()) {
case DisplayFeatureOrientationVertical:
*t = DisplayFeatureOrientationVertical
case DisplayFeatureOrientationHorizontal:
*t = DisplayFeatureOrientationHorizontal
default:
in.AddError(errors.New("unknown DisplayFeatureOrientation value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *DisplayFeatureOrientation) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// SetEmitTouchEventsForMouseConfiguration touch/gesture events
// configuration. Default: current platform.
//

View File

@@ -30,7 +30,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch(in *jlexer.Lexer, out *
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -97,7 +97,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch1(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -163,7 +163,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch2(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -254,7 +254,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch3(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -327,7 +327,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch4(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -406,7 +406,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch5(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -472,7 +472,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch6(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -615,7 +615,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch7(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -688,7 +688,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch8(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -857,7 +857,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch9(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -975,7 +975,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch10(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1096,7 +1096,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch11(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1155,7 +1155,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch12(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1240,7 +1240,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch13(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1376,7 +1376,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch14(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1456,7 +1456,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFetch15(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -23,7 +23,7 @@ func (t RequestID) String() string {
// RequestStage stages of the request to handle. Request will intercept
// before the request is sent. Response will intercept after the response is
// received (but before response body is received.
// received (but before response body is received).
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#type-RequestStage
type RequestStage string

View File

@@ -1,8 +1,8 @@
module github.com/chromedp/cdproto
require (
github.com/knq/sysutil v0.0.0-20191005231841-15668db23d08
github.com/mailru/easyjson v0.7.1
github.com/chromedp/sysutil v1.0.0
github.com/mailru/easyjson v0.7.7
)
go 1.14

View File

@@ -1,4 +1,6 @@
github.com/knq/sysutil v0.0.0-20191005231841-15668db23d08 h1:V0an7KRw92wmJysvFvtqtKMAPmvS5O0jtB0nYo6t+gs=
github.com/knq/sysutil v0.0.0-20191005231841-15668db23d08/go.mod h1:dFWs1zEqDjFtnBXsd1vPOZaLsESovai349994nHx3e0=
github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8=
github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic=
github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental(in *jlex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -107,7 +107,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental1(in *jle
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -166,7 +166,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental2(in *jle
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -225,7 +225,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental3(in *jle
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -304,7 +304,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental4(in *jle
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -29,7 +29,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -41,6 +41,8 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler(in *jlexer.Lexer
out.ReportProgress = bool(in.Bool())
case "treatGlobalObjectsAsRoots":
out.TreatGlobalObjectsAsRoots = bool(in.Bool())
case "captureNumericValue":
out.CaptureNumericValue = bool(in.Bool())
default:
in.SkipRecursive()
}
@@ -71,6 +73,16 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeapprofiler(out *jwriter.Wri
}
out.Bool(bool(in.TreatGlobalObjectsAsRoots))
}
if in.CaptureNumericValue {
const prefix string = ",\"captureNumericValue\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.Bool(bool(in.CaptureNumericValue))
}
out.RawByte('}')
}
@@ -108,7 +120,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler1(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -120,6 +132,8 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler1(in *jlexer.Lexe
out.ReportProgress = bool(in.Bool())
case "treatGlobalObjectsAsRoots":
out.TreatGlobalObjectsAsRoots = bool(in.Bool())
case "captureNumericValue":
out.CaptureNumericValue = bool(in.Bool())
default:
in.SkipRecursive()
}
@@ -150,6 +164,16 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeapprofiler1(out *jwriter.Wr
}
out.Bool(bool(in.TreatGlobalObjectsAsRoots))
}
if in.CaptureNumericValue {
const prefix string = ",\"captureNumericValue\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.Bool(bool(in.CaptureNumericValue))
}
out.RawByte('}')
}
@@ -187,7 +211,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler2(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -262,7 +286,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler3(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -321,7 +345,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler4(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -388,7 +412,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler5(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -455,7 +479,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler6(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -535,7 +559,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler7(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -678,7 +702,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler8(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -807,7 +831,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler9(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -882,7 +906,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler10(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -941,7 +965,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler11(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1016,7 +1040,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler12(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1089,7 +1113,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler13(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1156,7 +1180,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler14(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1222,7 +1246,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler15(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1281,7 +1305,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler16(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1361,7 +1385,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler17(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1434,7 +1458,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler18(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1532,7 +1556,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler19(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1598,7 +1622,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler20(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1657,7 +1681,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler21(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1716,7 +1740,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler22(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1775,7 +1799,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeapprofiler23(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -279,6 +279,7 @@ func (p *StopSamplingParams) Do(ctx context.Context) (profile *SamplingHeapProfi
type StopTrackingHeapObjectsParams struct {
ReportProgress bool `json:"reportProgress,omitempty"` // If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
TreatGlobalObjectsAsRoots bool `json:"treatGlobalObjectsAsRoots,omitempty"`
CaptureNumericValue bool `json:"captureNumericValue,omitempty"` // If true, numerical values are included in the snapshot
}
// StopTrackingHeapObjects [no description].
@@ -303,6 +304,13 @@ func (p StopTrackingHeapObjectsParams) WithTreatGlobalObjectsAsRoots(treatGlobal
return &p
}
// WithCaptureNumericValue if true, numerical values are included in the
// snapshot.
func (p StopTrackingHeapObjectsParams) WithCaptureNumericValue(captureNumericValue bool) *StopTrackingHeapObjectsParams {
p.CaptureNumericValue = captureNumericValue
return &p
}
// Do executes HeapProfiler.stopTrackingHeapObjects against the provided context.
func (p *StopTrackingHeapObjectsParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStopTrackingHeapObjects, p, nil)
@@ -312,6 +320,7 @@ func (p *StopTrackingHeapObjectsParams) Do(ctx context.Context) (err error) {
type TakeHeapSnapshotParams struct {
ReportProgress bool `json:"reportProgress,omitempty"` // If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
TreatGlobalObjectsAsRoots bool `json:"treatGlobalObjectsAsRoots,omitempty"` // If true, a raw snapshot without artificial roots will be generated
CaptureNumericValue bool `json:"captureNumericValue,omitempty"` // If true, numerical values are included in the snapshot
}
// TakeHeapSnapshot [no description].
@@ -337,6 +346,13 @@ func (p TakeHeapSnapshotParams) WithTreatGlobalObjectsAsRoots(treatGlobalObjects
return &p
}
// WithCaptureNumericValue if true, numerical values are included in the
// snapshot.
func (p TakeHeapSnapshotParams) WithCaptureNumericValue(captureNumericValue bool) *TakeHeapSnapshotParams {
p.CaptureNumericValue = captureNumericValue
return &p
}
// Do executes HeapProfiler.takeHeapSnapshot against the provided context.
func (p *TakeHeapSnapshotParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandTakeHeapSnapshot, p, nil)

View File

@@ -29,7 +29,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -104,7 +104,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb1(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -177,7 +177,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb2(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -274,7 +274,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb3(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -340,7 +340,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb4(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -461,7 +461,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb5(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -577,7 +577,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb6(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -676,7 +676,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb7(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -819,7 +819,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb8(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -933,7 +933,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb9(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1043,7 +1043,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb10(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1179,7 +1179,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb11(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1258,7 +1258,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb12(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1338,7 +1338,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb13(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1397,7 +1397,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb14(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1456,7 +1456,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb15(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1555,7 +1555,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb16(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1628,7 +1628,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb17(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1752,7 +1752,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb18(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1868,7 +1868,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb19(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

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

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInspector(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -87,7 +87,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInspector1(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -146,7 +146,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInspector2(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -212,7 +212,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInspector3(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -271,7 +271,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoInspector4(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -29,7 +29,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo(in *jlexer.Lexer, out *Res
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -96,7 +96,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo1(in *jlexer.Lexer, out *Re
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -162,7 +162,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo2(in *jlexer.Lexer, out *Re
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -253,7 +253,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo3(in *jlexer.Lexer, out *Re
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -333,7 +333,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoIo4(in *jlexer.Lexer, out *Cl
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -29,7 +29,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -140,7 +140,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree1(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -237,7 +237,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree2(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -303,7 +303,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree3(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -388,7 +388,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree4(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -455,7 +455,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree5(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -542,7 +542,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree6(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -608,7 +608,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree7(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -737,7 +737,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree8(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -832,7 +832,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree9(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -912,7 +912,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree10(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -979,7 +979,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree11(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1045,7 +1045,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree12(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1112,7 +1112,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree13(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1222,7 +1222,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree14(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1473,7 +1473,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree15(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1582,7 +1582,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree16(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1667,7 +1667,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree17(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1726,7 +1726,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree18(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1785,7 +1785,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree19(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1882,7 +1882,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLayertree20(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -30,7 +30,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLog(in *jlexer.Lexer, out *Vi
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -103,7 +103,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLog1(in *jlexer.Lexer, out *S
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -162,7 +162,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLog2(in *jlexer.Lexer, out *S
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -272,7 +272,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLog3(in *jlexer.Lexer, out *E
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -350,7 +350,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLog4(in *jlexer.Lexer, out *E
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -541,7 +541,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLog5(in *jlexer.Lexer, out *E
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -600,7 +600,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLog6(in *jlexer.Lexer, out *D
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -659,7 +659,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoLog7(in *jlexer.Lexer, out *C
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMedia(in *jlexer.Lexer, out *
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -101,7 +101,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMedia1(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -174,7 +174,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMedia2(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -247,7 +247,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMedia3(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -320,7 +320,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMedia4(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -418,7 +418,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMedia5(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -535,7 +535,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMedia6(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -652,7 +652,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMedia7(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -769,7 +769,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMedia8(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -886,7 +886,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMedia9(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -945,7 +945,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMedia10(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -87,7 +87,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory1(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -166,7 +166,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory2(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -232,7 +232,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory3(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -298,7 +298,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory4(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -410,7 +410,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory5(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -571,7 +571,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory6(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -630,7 +630,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory7(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -717,7 +717,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory8(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -792,7 +792,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory9(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -851,7 +851,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory10(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -942,7 +942,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory11(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1001,7 +1001,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory12(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1076,7 +1076,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory13(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1135,7 +1135,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory14(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1210,7 +1210,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory15(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1269,7 +1269,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoMemory16(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

File diff suppressed because it is too large Load Diff

View File

@@ -32,12 +32,13 @@ type EventEventSourceMessageReceived struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-loadingFailed
type EventLoadingFailed struct {
RequestID RequestID `json:"requestId"` // Request identifier.
Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp.
Type ResourceType `json:"type"` // Resource type.
ErrorText string `json:"errorText"` // User friendly error message.
Canceled bool `json:"canceled,omitempty"` // True if loading was canceled.
BlockedReason BlockedReason `json:"blockedReason,omitempty"` // The reason why loading was blocked, if any.
RequestID RequestID `json:"requestId"` // Request identifier.
Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp.
Type ResourceType `json:"type"` // Resource type.
ErrorText string `json:"errorText"` // User friendly error message.
Canceled bool `json:"canceled,omitempty"` // True if loading was canceled.
BlockedReason BlockedReason `json:"blockedReason,omitempty"` // The reason why loading was blocked, if any.
CorsErrorStatus *CorsErrorStatus `json:"corsErrorStatus,omitempty"` // The reason why loading was blocked by CORS, if any.
}
// EventLoadingFinished fired when HTTP request has finished loading.
@@ -170,6 +171,33 @@ type EventWebSocketWillSendHandshakeRequest struct {
Request *WebSocketRequest `json:"request"` // WebSocket request data.
}
// EventWebTransportCreated fired upon WebTransport creation.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-webTransportCreated
type EventWebTransportCreated struct {
TransportID RequestID `json:"transportId"` // WebTransport identifier.
URL string `json:"url"` // WebTransport request URL.
Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp.
Initiator *Initiator `json:"initiator,omitempty"` // Request initiator.
}
// EventWebTransportConnectionEstablished fired when WebTransport handshake
// is finished.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-webTransportConnectionEstablished
type EventWebTransportConnectionEstablished struct {
TransportID RequestID `json:"transportId"` // WebTransport identifier.
Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp.
}
// EventWebTransportClosed fired when WebTransport is disposed.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-webTransportClosed
type EventWebTransportClosed struct {
TransportID RequestID `json:"transportId"` // WebTransport identifier.
Timestamp *cdp.MonotonicTime `json:"timestamp"` // Timestamp.
}
// EventRequestWillBeSentExtraInfo fired when additional information about a
// requestWillBeSent event is available from the network stack. Not every
// requestWillBeSent event will have an additional requestWillBeSentExtraInfo
@@ -178,9 +206,10 @@ type EventWebSocketWillSendHandshakeRequest struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-requestWillBeSentExtraInfo
type EventRequestWillBeSentExtraInfo struct {
RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to an existing requestWillBeSent event.
AssociatedCookies []*BlockedCookieWithReason `json:"associatedCookies"` // A list of cookies potentially associated to the requested URL. This includes both cookies sent with the request and the ones not sent; the latter are distinguished by having blockedReason field set.
Headers Headers `json:"headers"` // Raw request headers as they will be sent over the wire.
RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to an existing requestWillBeSent event.
AssociatedCookies []*BlockedCookieWithReason `json:"associatedCookies"` // A list of cookies potentially associated to the requested URL. This includes both cookies sent with the request and the ones not sent; the latter are distinguished by having blockedReason field set.
Headers Headers `json:"headers"` // Raw request headers as they will be sent over the wire.
ClientSecurityState *ClientSecurityState `json:"clientSecurityState,omitempty"` // The client security state set for the request.
}
// EventResponseReceivedExtraInfo fired when additional information about a
@@ -191,8 +220,65 @@ type EventRequestWillBeSentExtraInfo struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-responseReceivedExtraInfo
type EventResponseReceivedExtraInfo struct {
RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to another responseReceived event.
BlockedCookies []*BlockedSetCookieWithReason `json:"blockedCookies"` // A list of cookies which were not stored from the response along with the corresponding reasons for blocking. The cookies here may not be valid due to syntax errors, which are represented by the invalid cookie line string instead of a proper cookie.
Headers Headers `json:"headers"` // Raw response headers as they were received over the wire.
HeadersText string `json:"headersText,omitempty"` // Raw response header text as it was received over the wire. The raw text may not always be available, such as in the case of HTTP/2 or QUIC.
RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to another responseReceived event.
BlockedCookies []*BlockedSetCookieWithReason `json:"blockedCookies"` // A list of cookies which were not stored from the response along with the corresponding reasons for blocking. The cookies here may not be valid due to syntax errors, which are represented by the invalid cookie line string instead of a proper cookie.
Headers Headers `json:"headers"` // Raw response headers as they were received over the wire.
ResourceIPAddressSpace IPAddressSpace `json:"resourceIPAddressSpace"` // The IP address space of the resource. The address space can only be determined once the transport established the connection, so we can't send it in requestWillBeSentExtraInfo.
HeadersText string `json:"headersText,omitempty"` // Raw response header text as it was received over the wire. The raw text may not always be available, such as in the case of HTTP/2 or QUIC.
}
// EventTrustTokenOperationDone fired exactly once for each Trust Token
// operation. Depending on the type of the operation and whether the operation
// succeeded or failed, the event is fired before the corresponding request was
// sent or after the response was received.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-trustTokenOperationDone
type EventTrustTokenOperationDone struct {
Status TrustTokenOperationDoneStatus `json:"status"` // Detailed success or error status of the operation. 'AlreadyExists' also signifies a successful operation, as the result of the operation already exists und thus, the operation was abort preemptively (e.g. a cache hit).
Type TrustTokenOperationType `json:"type"`
RequestID RequestID `json:"requestId"`
TopLevelOrigin string `json:"topLevelOrigin,omitempty"` // Top level origin. The context in which the operation was attempted.
IssuerOrigin string `json:"issuerOrigin,omitempty"` // Origin of the issuer in case of a "Issuance" or "Redemption" operation.
IssuedTokenCount int64 `json:"issuedTokenCount,omitempty"` // The number of obtained Trust Tokens on a successful "Issuance" operation.
}
// EventSubresourceWebBundleMetadataReceived fired once when parsing the .wbn
// file has succeeded. The event contains the information about the web bundle
// contents.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-subresourceWebBundleMetadataReceived
type EventSubresourceWebBundleMetadataReceived struct {
RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to another event.
Urls []string `json:"urls"` // A list of URLs of resources in the subresource Web Bundle.
}
// EventSubresourceWebBundleMetadataError fired once when parsing the .wbn
// file has failed.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-subresourceWebBundleMetadataError
type EventSubresourceWebBundleMetadataError struct {
RequestID RequestID `json:"requestId"` // Request identifier. Used to match this information to another event.
ErrorMessage string `json:"errorMessage"` // Error message
}
// EventSubresourceWebBundleInnerResponseParsed fired when handling requests
// for resources within a .wbn file. Note: this will only be fired for resources
// that are requested by the webpage.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-subresourceWebBundleInnerResponseParsed
type EventSubresourceWebBundleInnerResponseParsed struct {
InnerRequestID RequestID `json:"innerRequestId"` // Request identifier of the subresource request
InnerRequestURL string `json:"innerRequestURL"` // URL of the subresource resource.
BundleRequestID RequestID `json:"bundleRequestId,omitempty"` // Bundle request identifier. Used to match this information to another event. This made be absent in case when the instrumentation was enabled only after webbundle was parsed.
}
// EventSubresourceWebBundleInnerResponseError fired when request for
// resources within a .wbn file failed.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-subresourceWebBundleInnerResponseError
type EventSubresourceWebBundleInnerResponseError struct {
InnerRequestID RequestID `json:"innerRequestId"` // Request identifier of the subresource request
InnerRequestURL string `json:"innerRequestURL"` // URL of the subresource resource.
ErrorMessage string `json:"errorMessage"` // Error message
BundleRequestID RequestID `json:"bundleRequestId,omitempty"` // Bundle request identifier. Used to match this information to another event. This made be absent in case when the instrumentation was enabled only after webbundle was parsed.
}

View File

@@ -19,6 +19,47 @@ import (
"github.com/chromedp/cdproto/io"
)
// SetAcceptedEncodingsParams sets a list of content encodings that will be
// accepted. Empty list means no encoding is accepted.
type SetAcceptedEncodingsParams struct {
Encodings []ContentEncoding `json:"encodings"` // List of accepted content encodings.
}
// SetAcceptedEncodings sets a list of content encodings that will be
// accepted. Empty list means no encoding is accepted.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setAcceptedEncodings
//
// parameters:
// encodings - List of accepted content encodings.
func SetAcceptedEncodings(encodings []ContentEncoding) *SetAcceptedEncodingsParams {
return &SetAcceptedEncodingsParams{
Encodings: encodings,
}
}
// Do executes Network.setAcceptedEncodings against the provided context.
func (p *SetAcceptedEncodingsParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetAcceptedEncodings, p, nil)
}
// ClearAcceptedEncodingsOverrideParams clears accepted encodings set by
// setAcceptedEncodings.
type ClearAcceptedEncodingsOverrideParams struct{}
// ClearAcceptedEncodingsOverride clears accepted encodings set by
// setAcceptedEncodings.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-clearAcceptedEncodingsOverride
func ClearAcceptedEncodingsOverride() *ClearAcceptedEncodingsOverrideParams {
return &ClearAcceptedEncodingsOverrideParams{}
}
// Do executes Network.clearAcceptedEncodingsOverride against the provided context.
func (p *ClearAcceptedEncodingsOverrideParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandClearAcceptedEncodingsOverride, nil, nil)
}
// ClearBrowserCacheParams clears browser cache.
type ClearBrowserCacheParams struct{}
@@ -267,7 +308,7 @@ func (p *GetCertificateParams) Do(ctx context.Context) (tableNames []string, err
// Depending on the backend support, will return detailed cookie information in
// the cookies field.
type GetCookiesParams struct {
Urls []string `json:"urls,omitempty"` // The list of URLs for which applicable cookies will be fetched
Urls []string `json:"urls,omitempty"` // The list of URLs for which applicable cookies will be fetched. If not specified, it's assumed to be set to the list containing the URLs of the page and all of its subframes.
}
// GetCookies returns all browser cookies for the current URL. Depending on
@@ -281,7 +322,9 @@ func GetCookies() *GetCookiesParams {
return &GetCookiesParams{}
}
// WithUrls the list of URLs for which applicable cookies will be fetched.
// WithUrls the list of URLs for which applicable cookies will be fetched. If
// not specified, it's assumed to be set to the list containing the URLs of the
// page and all of its subframes.
func (p GetCookiesParams) WithUrls(urls []string) *GetCookiesParams {
p.Urls = urls
return &p
@@ -644,16 +687,19 @@ func (p *SetCacheDisabledParams) Do(ctx context.Context) (err error) {
// SetCookieParams sets a cookie with the given cookie data; may overwrite
// equivalent cookies if they exist.
type SetCookieParams struct {
Name string `json:"name"` // Cookie name.
Value string `json:"value"` // Cookie value.
URL string `json:"url,omitempty"` // The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie.
Domain string `json:"domain,omitempty"` // Cookie domain.
Path string `json:"path,omitempty"` // Cookie path.
Secure bool `json:"secure,omitempty"` // True if cookie is secure.
HTTPOnly bool `json:"httpOnly,omitempty"` // True if cookie is http-only.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Cookie SameSite type.
Expires *cdp.TimeSinceEpoch `json:"expires,omitempty"` // Cookie expiration date, session cookie if not set
Priority CookiePriority `json:"priority,omitempty"` // Cookie Priority type.
Name string `json:"name"` // Cookie name.
Value string `json:"value"` // Cookie value.
URL string `json:"url,omitempty"` // The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, source port, and source scheme values of the created cookie.
Domain string `json:"domain,omitempty"` // Cookie domain.
Path string `json:"path,omitempty"` // Cookie path.
Secure bool `json:"secure,omitempty"` // True if cookie is secure.
HTTPOnly bool `json:"httpOnly,omitempty"` // True if cookie is http-only.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Cookie SameSite type.
Expires *cdp.TimeSinceEpoch `json:"expires,omitempty"` // Cookie expiration date, session cookie if not set
Priority CookiePriority `json:"priority,omitempty"` // Cookie Priority type.
SameParty bool `json:"sameParty,omitempty"` // True if cookie is SameParty.
SourceScheme CookieSourceScheme `json:"sourceScheme,omitempty"` // Cookie source scheme type.
SourcePort int64 `json:"sourcePort,omitempty"` // Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
}
// SetCookie sets a cookie with the given cookie data; may overwrite
@@ -672,7 +718,8 @@ func SetCookie(name string, value string) *SetCookieParams {
}
// WithURL the request-URI to associate with the setting of the cookie. This
// value can affect the default domain and path values of the created cookie.
// value can affect the default domain, path, source port, and source scheme
// values of the created cookie.
func (p SetCookieParams) WithURL(url string) *SetCookieParams {
p.URL = url
return &p
@@ -720,24 +767,30 @@ func (p SetCookieParams) WithPriority(priority CookiePriority) *SetCookieParams
return &p
}
// SetCookieReturns return values.
type SetCookieReturns struct {
Success bool `json:"success,omitempty"` // True if successfully set cookie.
// WithSameParty true if cookie is SameParty.
func (p SetCookieParams) WithSameParty(sameParty bool) *SetCookieParams {
p.SameParty = sameParty
return &p
}
// WithSourceScheme cookie source scheme type.
func (p SetCookieParams) WithSourceScheme(sourceScheme CookieSourceScheme) *SetCookieParams {
p.SourceScheme = sourceScheme
return &p
}
// WithSourcePort cookie source port. Valid values are {-1, [1, 65535]}, -1
// indicates an unspecified port. An unspecified port value allows protocol
// clients to emulate legacy cookie scope for the port. This is a temporary
// ability and it will be removed in the future.
func (p SetCookieParams) WithSourcePort(sourcePort int64) *SetCookieParams {
p.SourcePort = sourcePort
return &p
}
// Do executes Network.setCookie against the provided context.
//
// returns:
// success - True if successfully set cookie.
func (p *SetCookieParams) Do(ctx context.Context) (success bool, err error) {
// execute
var res SetCookieReturns
err = cdp.Execute(ctx, CommandSetCookie, p, &res)
if err != nil {
return false, err
}
return res.Success, nil
func (p *SetCookieParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetCookie, p, nil)
}
// SetCookiesParams sets given cookies.
@@ -762,31 +815,6 @@ func (p *SetCookiesParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetCookies, p, nil)
}
// SetDataSizeLimitsForTestParams for testing.
type SetDataSizeLimitsForTestParams struct {
MaxTotalSize int64 `json:"maxTotalSize"` // Maximum total buffer size.
MaxResourceSize int64 `json:"maxResourceSize"` // Maximum per-resource size.
}
// SetDataSizeLimitsForTest for testing.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setDataSizeLimitsForTest
//
// parameters:
// maxTotalSize - Maximum total buffer size.
// maxResourceSize - Maximum per-resource size.
func SetDataSizeLimitsForTest(maxTotalSize int64, maxResourceSize int64) *SetDataSizeLimitsForTestParams {
return &SetDataSizeLimitsForTestParams{
MaxTotalSize: maxTotalSize,
MaxResourceSize: maxResourceSize,
}
}
// Do executes Network.setDataSizeLimitsForTest against the provided context.
func (p *SetDataSizeLimitsForTestParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDataSizeLimitsForTest, p, nil)
}
// SetExtraHTTPHeadersParams specifies whether to always send extra HTTP
// headers with the requests from this page.
type SetExtraHTTPHeadersParams struct {
@@ -811,8 +839,120 @@ func (p *SetExtraHTTPHeadersParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetExtraHTTPHeaders, p, nil)
}
// SetAttachDebugStackParams specifies whether to attach a page script stack
// id in requests.
type SetAttachDebugStackParams struct {
Enabled bool `json:"enabled"` // Whether to attach a page script stack for debugging purpose.
}
// SetAttachDebugStack specifies whether to attach a page script stack id in
// requests.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setAttachDebugStack
//
// parameters:
// enabled - Whether to attach a page script stack for debugging purpose.
func SetAttachDebugStack(enabled bool) *SetAttachDebugStackParams {
return &SetAttachDebugStackParams{
Enabled: enabled,
}
}
// Do executes Network.setAttachDebugStack against the provided context.
func (p *SetAttachDebugStackParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetAttachDebugStack, p, nil)
}
// GetSecurityIsolationStatusParams returns information about the COEP/COOP
// isolation status.
type GetSecurityIsolationStatusParams struct {
FrameID cdp.FrameID `json:"frameId,omitempty"` // If no frameId is provided, the status of the target is provided.
}
// GetSecurityIsolationStatus returns information about the COEP/COOP
// isolation status.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getSecurityIsolationStatus
//
// parameters:
func GetSecurityIsolationStatus() *GetSecurityIsolationStatusParams {
return &GetSecurityIsolationStatusParams{}
}
// WithFrameID if no frameId is provided, the status of the target is
// provided.
func (p GetSecurityIsolationStatusParams) WithFrameID(frameID cdp.FrameID) *GetSecurityIsolationStatusParams {
p.FrameID = frameID
return &p
}
// GetSecurityIsolationStatusReturns return values.
type GetSecurityIsolationStatusReturns struct {
Status *SecurityIsolationStatus `json:"status,omitempty"`
}
// Do executes Network.getSecurityIsolationStatus against the provided context.
//
// returns:
// status
func (p *GetSecurityIsolationStatusParams) Do(ctx context.Context) (status *SecurityIsolationStatus, err error) {
// execute
var res GetSecurityIsolationStatusReturns
err = cdp.Execute(ctx, CommandGetSecurityIsolationStatus, p, &res)
if err != nil {
return nil, err
}
return res.Status, nil
}
// LoadNetworkResourceParams fetches the resource and returns the content.
type LoadNetworkResourceParams struct {
FrameID cdp.FrameID `json:"frameId"` // Frame id to get the resource for.
URL string `json:"url"` // URL of the resource to get content for.
Options *LoadNetworkResourceOptions `json:"options"` // Options for the request.
}
// LoadNetworkResource fetches the resource and returns the content.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-loadNetworkResource
//
// parameters:
// frameID - Frame id to get the resource for.
// url - URL of the resource to get content for.
// options - Options for the request.
func LoadNetworkResource(frameID cdp.FrameID, url string, options *LoadNetworkResourceOptions) *LoadNetworkResourceParams {
return &LoadNetworkResourceParams{
FrameID: frameID,
URL: url,
Options: options,
}
}
// LoadNetworkResourceReturns return values.
type LoadNetworkResourceReturns struct {
Resource *LoadNetworkResourcePageResult `json:"resource,omitempty"`
}
// Do executes Network.loadNetworkResource against the provided context.
//
// returns:
// resource
func (p *LoadNetworkResourceParams) Do(ctx context.Context) (resource *LoadNetworkResourcePageResult, err error) {
// execute
var res LoadNetworkResourceReturns
err = cdp.Execute(ctx, CommandLoadNetworkResource, p, &res)
if err != nil {
return nil, err
}
return res.Resource, nil
}
// Command names.
const (
CommandSetAcceptedEncodings = "Network.setAcceptedEncodings"
CommandClearAcceptedEncodingsOverride = "Network.clearAcceptedEncodingsOverride"
CommandClearBrowserCache = "Network.clearBrowserCache"
CommandClearBrowserCookies = "Network.clearBrowserCookies"
CommandDeleteCookies = "Network.deleteCookies"
@@ -833,6 +973,8 @@ const (
CommandSetCacheDisabled = "Network.setCacheDisabled"
CommandSetCookie = "Network.setCookie"
CommandSetCookies = "Network.setCookies"
CommandSetDataSizeLimitsForTest = "Network.setDataSizeLimitsForTest"
CommandSetExtraHTTPHeaders = "Network.setExtraHTTPHeaders"
CommandSetAttachDebugStack = "Network.setAttachDebugStack"
CommandGetSecurityIsolationStatus = "Network.getSecurityIsolationStatus"
CommandLoadNetworkResource = "Network.loadNetworkResource"
)

View File

@@ -6,6 +6,7 @@ import (
"errors"
"github.com/chromedp/cdproto/cdp"
"github.com/chromedp/cdproto/io"
"github.com/chromedp/cdproto/runtime"
"github.com/chromedp/cdproto/security"
"github.com/mailru/easyjson"
@@ -40,6 +41,7 @@ const (
ResourceTypeSignedExchange ResourceType = "SignedExchange"
ResourceTypePing ResourceType = "Ping"
ResourceTypeCSPViolationReport ResourceType = "CSPViolationReport"
ResourceTypePreflight ResourceType = "Preflight"
ResourceTypeOther ResourceType = "Other"
)
@@ -86,6 +88,8 @@ func (t *ResourceType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = ResourceTypePing
case ResourceTypeCSPViolationReport:
*t = ResourceTypeCSPViolationReport
case ResourceTypePreflight:
*t = ResourceTypePreflight
case ResourceTypeOther:
*t = ResourceTypeOther
@@ -366,6 +370,56 @@ func (t *CookiePriority) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CookieSourceScheme represents the source scheme of the origin that
// originally set the cookie. A value of "Unset" allows protocol clients to
// emulate legacy cookie scope for the scheme. This is a temporary ability and
// it will be removed in the future.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CookieSourceScheme
type CookieSourceScheme string
// String returns the CookieSourceScheme as string value.
func (t CookieSourceScheme) String() string {
return string(t)
}
// CookieSourceScheme values.
const (
CookieSourceSchemeUnset CookieSourceScheme = "Unset"
CookieSourceSchemeNonSecure CookieSourceScheme = "NonSecure"
CookieSourceSchemeSecure CookieSourceScheme = "Secure"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CookieSourceScheme) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CookieSourceScheme) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CookieSourceScheme) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CookieSourceScheme(in.String()) {
case CookieSourceSchemeUnset:
*t = CookieSourceSchemeUnset
case CookieSourceSchemeNonSecure:
*t = CookieSourceSchemeNonSecure
case CookieSourceSchemeSecure:
*t = CookieSourceSchemeSecure
default:
in.AddError(errors.New("unknown CookieSourceScheme value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CookieSourceScheme) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// ResourceTiming timing information for the request.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-ResourceTiming
@@ -443,6 +497,13 @@ func (t *ResourcePriority) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// PostDataEntry post data entry for HTTP request.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-PostDataEntry
type PostDataEntry struct {
Bytes string `json:"bytes,omitempty"`
}
// Request HTTP request data.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Request
@@ -453,10 +514,12 @@ type Request struct {
Headers Headers `json:"headers"` // HTTP request headers.
PostData string `json:"postData,omitempty"` // HTTP POST request data.
HasPostData bool `json:"hasPostData,omitempty"` // True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long.
PostDataEntries []*PostDataEntry `json:"postDataEntries,omitempty"` // Request body elements. This will be converted from base64 to binary
MixedContentType security.MixedContentType `json:"mixedContentType,omitempty"` // The mixed content type of the request.
InitialPriority ResourcePriority `json:"initialPriority"` // Priority of the resource request at the time request is sent.
ReferrerPolicy ReferrerPolicy `json:"referrerPolicy"` // The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/
IsLinkPreload bool `json:"isLinkPreload,omitempty"` // Whether is loaded via link preload.
TrustTokenParams *TrustTokenParams `json:"trustTokenParams,omitempty"` // Set for requests when the TrustToken API is used. Contains the parameters passed by the developer (e.g. via "fetch") as understood by the backend.
}
// SignedCertificateTimestamp details of a signed certificate timestamp
@@ -560,7 +623,6 @@ const (
BlockedReasonInspector BlockedReason = "inspector"
BlockedReasonSubresourceFilter BlockedReason = "subresource-filter"
BlockedReasonContentType BlockedReason = "content-type"
BlockedReasonCollapsedByClient BlockedReason = "collapsed-by-client"
BlockedReasonCoepFrameResourceNeedsCoepHeader BlockedReason = "coep-frame-resource-needs-coep-header"
BlockedReasonCoopSandboxedIframeCannotNavigateToCoopPage BlockedReason = "coop-sandboxed-iframe-cannot-navigate-to-coop-page"
BlockedReasonCorpNotSameOrigin BlockedReason = "corp-not-same-origin"
@@ -595,8 +657,6 @@ func (t *BlockedReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = BlockedReasonSubresourceFilter
case BlockedReasonContentType:
*t = BlockedReasonContentType
case BlockedReasonCollapsedByClient:
*t = BlockedReasonCollapsedByClient
case BlockedReasonCoepFrameResourceNeedsCoepHeader:
*t = BlockedReasonCoepFrameResourceNeedsCoepHeader
case BlockedReasonCoopSandboxedIframeCannotNavigateToCoopPage:
@@ -618,6 +678,130 @@ func (t *BlockedReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CorsError the reason why request was blocked.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CorsError
type CorsError string
// String returns the CorsError as string value.
func (t CorsError) String() string {
return string(t)
}
// CorsError values.
const (
CorsErrorDisallowedByMode CorsError = "DisallowedByMode"
CorsErrorInvalidResponse CorsError = "InvalidResponse"
CorsErrorWildcardOriginNotAllowed CorsError = "WildcardOriginNotAllowed"
CorsErrorMissingAllowOriginHeader CorsError = "MissingAllowOriginHeader"
CorsErrorMultipleAllowOriginValues CorsError = "MultipleAllowOriginValues"
CorsErrorInvalidAllowOriginValue CorsError = "InvalidAllowOriginValue"
CorsErrorAllowOriginMismatch CorsError = "AllowOriginMismatch"
CorsErrorInvalidAllowCredentials CorsError = "InvalidAllowCredentials"
CorsErrorCorsDisabledScheme CorsError = "CorsDisabledScheme"
CorsErrorPreflightInvalidStatus CorsError = "PreflightInvalidStatus"
CorsErrorPreflightDisallowedRedirect CorsError = "PreflightDisallowedRedirect"
CorsErrorPreflightWildcardOriginNotAllowed CorsError = "PreflightWildcardOriginNotAllowed"
CorsErrorPreflightMissingAllowOriginHeader CorsError = "PreflightMissingAllowOriginHeader"
CorsErrorPreflightMultipleAllowOriginValues CorsError = "PreflightMultipleAllowOriginValues"
CorsErrorPreflightInvalidAllowOriginValue CorsError = "PreflightInvalidAllowOriginValue"
CorsErrorPreflightAllowOriginMismatch CorsError = "PreflightAllowOriginMismatch"
CorsErrorPreflightInvalidAllowCredentials CorsError = "PreflightInvalidAllowCredentials"
CorsErrorPreflightMissingAllowExternal CorsError = "PreflightMissingAllowExternal"
CorsErrorPreflightInvalidAllowExternal CorsError = "PreflightInvalidAllowExternal"
CorsErrorInvalidAllowMethodsPreflightResponse CorsError = "InvalidAllowMethodsPreflightResponse"
CorsErrorInvalidAllowHeadersPreflightResponse CorsError = "InvalidAllowHeadersPreflightResponse"
CorsErrorMethodDisallowedByPreflightResponse CorsError = "MethodDisallowedByPreflightResponse"
CorsErrorHeaderDisallowedByPreflightResponse CorsError = "HeaderDisallowedByPreflightResponse"
CorsErrorRedirectContainsCredentials CorsError = "RedirectContainsCredentials"
CorsErrorInsecurePrivateNetwork CorsError = "InsecurePrivateNetwork"
CorsErrorNoCorsRedirectModeNotFollow CorsError = "NoCorsRedirectModeNotFollow"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CorsError) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CorsError) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CorsError) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CorsError(in.String()) {
case CorsErrorDisallowedByMode:
*t = CorsErrorDisallowedByMode
case CorsErrorInvalidResponse:
*t = CorsErrorInvalidResponse
case CorsErrorWildcardOriginNotAllowed:
*t = CorsErrorWildcardOriginNotAllowed
case CorsErrorMissingAllowOriginHeader:
*t = CorsErrorMissingAllowOriginHeader
case CorsErrorMultipleAllowOriginValues:
*t = CorsErrorMultipleAllowOriginValues
case CorsErrorInvalidAllowOriginValue:
*t = CorsErrorInvalidAllowOriginValue
case CorsErrorAllowOriginMismatch:
*t = CorsErrorAllowOriginMismatch
case CorsErrorInvalidAllowCredentials:
*t = CorsErrorInvalidAllowCredentials
case CorsErrorCorsDisabledScheme:
*t = CorsErrorCorsDisabledScheme
case CorsErrorPreflightInvalidStatus:
*t = CorsErrorPreflightInvalidStatus
case CorsErrorPreflightDisallowedRedirect:
*t = CorsErrorPreflightDisallowedRedirect
case CorsErrorPreflightWildcardOriginNotAllowed:
*t = CorsErrorPreflightWildcardOriginNotAllowed
case CorsErrorPreflightMissingAllowOriginHeader:
*t = CorsErrorPreflightMissingAllowOriginHeader
case CorsErrorPreflightMultipleAllowOriginValues:
*t = CorsErrorPreflightMultipleAllowOriginValues
case CorsErrorPreflightInvalidAllowOriginValue:
*t = CorsErrorPreflightInvalidAllowOriginValue
case CorsErrorPreflightAllowOriginMismatch:
*t = CorsErrorPreflightAllowOriginMismatch
case CorsErrorPreflightInvalidAllowCredentials:
*t = CorsErrorPreflightInvalidAllowCredentials
case CorsErrorPreflightMissingAllowExternal:
*t = CorsErrorPreflightMissingAllowExternal
case CorsErrorPreflightInvalidAllowExternal:
*t = CorsErrorPreflightInvalidAllowExternal
case CorsErrorInvalidAllowMethodsPreflightResponse:
*t = CorsErrorInvalidAllowMethodsPreflightResponse
case CorsErrorInvalidAllowHeadersPreflightResponse:
*t = CorsErrorInvalidAllowHeadersPreflightResponse
case CorsErrorMethodDisallowedByPreflightResponse:
*t = CorsErrorMethodDisallowedByPreflightResponse
case CorsErrorHeaderDisallowedByPreflightResponse:
*t = CorsErrorHeaderDisallowedByPreflightResponse
case CorsErrorRedirectContainsCredentials:
*t = CorsErrorRedirectContainsCredentials
case CorsErrorInsecurePrivateNetwork:
*t = CorsErrorInsecurePrivateNetwork
case CorsErrorNoCorsRedirectModeNotFollow:
*t = CorsErrorNoCorsRedirectModeNotFollow
default:
in.AddError(errors.New("unknown CorsError value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CorsError) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CorsErrorStatus [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CorsErrorStatus
type CorsErrorStatus struct {
CorsError CorsError `json:"corsError"`
FailedParameter string `json:"failedParameter"`
}
// ServiceWorkerResponseSource source of serviceworker response.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-ServiceWorkerResponseSource
@@ -668,6 +852,64 @@ func (t *ServiceWorkerResponseSource) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// TrustTokenParams determines what type of Trust Token operation is executed
// and depending on the type, some additional parameters. The values are
// specified in third_party/blink/renderer/core/fetch/trust_token.idl.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-TrustTokenParams
type TrustTokenParams struct {
Type TrustTokenOperationType `json:"type"`
RefreshPolicy TrustTokenParamsRefreshPolicy `json:"refreshPolicy"` // Only set for "token-redemption" type and determine whether to request a fresh SRR or use a still valid cached SRR.
Issuers []string `json:"issuers,omitempty"` // Origins of issuers from whom to request tokens or redemption records.
}
// TrustTokenOperationType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-TrustTokenOperationType
type TrustTokenOperationType string
// String returns the TrustTokenOperationType as string value.
func (t TrustTokenOperationType) String() string {
return string(t)
}
// TrustTokenOperationType values.
const (
TrustTokenOperationTypeIssuance TrustTokenOperationType = "Issuance"
TrustTokenOperationTypeRedemption TrustTokenOperationType = "Redemption"
TrustTokenOperationTypeSigning TrustTokenOperationType = "Signing"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t TrustTokenOperationType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t TrustTokenOperationType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *TrustTokenOperationType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch TrustTokenOperationType(in.String()) {
case TrustTokenOperationTypeIssuance:
*t = TrustTokenOperationTypeIssuance
case TrustTokenOperationTypeRedemption:
*t = TrustTokenOperationTypeRedemption
case TrustTokenOperationTypeSigning:
*t = TrustTokenOperationTypeSigning
default:
in.AddError(errors.New("unknown TrustTokenOperationType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *TrustTokenOperationType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// Response HTTP response data.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Response
@@ -740,27 +982,32 @@ type CachedResource struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Initiator
type Initiator struct {
Type InitiatorType `json:"type"` // Type of this initiator.
Stack *runtime.StackTrace `json:"stack,omitempty"` // Initiator JavaScript stack trace, set for Script only.
URL string `json:"url,omitempty"` // Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.
LineNumber float64 `json:"lineNumber,omitempty"` // Initiator line number, set for Parser type or for Script type (when script is importing module) (0-based).
Type InitiatorType `json:"type"` // Type of this initiator.
Stack *runtime.StackTrace `json:"stack,omitempty"` // Initiator JavaScript stack trace, set for Script only.
URL string `json:"url,omitempty"` // Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.
LineNumber float64 `json:"lineNumber,omitempty"` // Initiator line number, set for Parser type or for Script type (when script is importing module) (0-based).
ColumnNumber float64 `json:"columnNumber,omitempty"` // Initiator column number, set for Parser type or for Script type (when script is importing module) (0-based).
RequestID RequestID `json:"requestId,omitempty"` // Set if another request triggered this request (e.g. preflight).
}
// Cookie cookie object.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Cookie
type Cookie struct {
Name string `json:"name"` // Cookie name.
Value string `json:"value"` // Cookie value.
Domain string `json:"domain"` // Cookie domain.
Path string `json:"path"` // Cookie path.
Expires float64 `json:"expires"` // Cookie expiration date as the number of seconds since the UNIX epoch.
Size int64 `json:"size"` // Cookie size.
HTTPOnly bool `json:"httpOnly"` // True if cookie is http-only.
Secure bool `json:"secure"` // True if cookie is secure.
Session bool `json:"session"` // True in case of session cookie.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Cookie SameSite type.
Priority CookiePriority `json:"priority"` // Cookie Priority
Name string `json:"name"` // Cookie name.
Value string `json:"value"` // Cookie value.
Domain string `json:"domain"` // Cookie domain.
Path string `json:"path"` // Cookie path.
Expires float64 `json:"expires"` // Cookie expiration date as the number of seconds since the UNIX epoch.
Size int64 `json:"size"` // Cookie size.
HTTPOnly bool `json:"httpOnly"` // True if cookie is http-only.
Secure bool `json:"secure"` // True if cookie is secure.
Session bool `json:"session"` // True in case of session cookie.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Cookie SameSite type.
Priority CookiePriority `json:"priority"` // Cookie Priority
SameParty bool `json:"sameParty"` // True if cookie is SameParty.
SourceScheme CookieSourceScheme `json:"sourceScheme"` // Cookie source scheme type.
SourcePort int64 `json:"sourcePort"` // Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
}
// SetCookieBlockedReason types of reasons why a cookie may not be stored
@@ -776,18 +1023,23 @@ func (t SetCookieBlockedReason) String() string {
// SetCookieBlockedReason values.
const (
SetCookieBlockedReasonSecureOnly SetCookieBlockedReason = "SecureOnly"
SetCookieBlockedReasonSameSiteStrict SetCookieBlockedReason = "SameSiteStrict"
SetCookieBlockedReasonSameSiteLax SetCookieBlockedReason = "SameSiteLax"
SetCookieBlockedReasonSameSiteUnspecifiedTreatedAsLax SetCookieBlockedReason = "SameSiteUnspecifiedTreatedAsLax"
SetCookieBlockedReasonSameSiteNoneInsecure SetCookieBlockedReason = "SameSiteNoneInsecure"
SetCookieBlockedReasonUserPreferences SetCookieBlockedReason = "UserPreferences"
SetCookieBlockedReasonSyntaxError SetCookieBlockedReason = "SyntaxError"
SetCookieBlockedReasonSchemeNotSupported SetCookieBlockedReason = "SchemeNotSupported"
SetCookieBlockedReasonOverwriteSecure SetCookieBlockedReason = "OverwriteSecure"
SetCookieBlockedReasonInvalidDomain SetCookieBlockedReason = "InvalidDomain"
SetCookieBlockedReasonInvalidPrefix SetCookieBlockedReason = "InvalidPrefix"
SetCookieBlockedReasonUnknownError SetCookieBlockedReason = "UnknownError"
SetCookieBlockedReasonSecureOnly SetCookieBlockedReason = "SecureOnly"
SetCookieBlockedReasonSameSiteStrict SetCookieBlockedReason = "SameSiteStrict"
SetCookieBlockedReasonSameSiteLax SetCookieBlockedReason = "SameSiteLax"
SetCookieBlockedReasonSameSiteUnspecifiedTreatedAsLax SetCookieBlockedReason = "SameSiteUnspecifiedTreatedAsLax"
SetCookieBlockedReasonSameSiteNoneInsecure SetCookieBlockedReason = "SameSiteNoneInsecure"
SetCookieBlockedReasonUserPreferences SetCookieBlockedReason = "UserPreferences"
SetCookieBlockedReasonSyntaxError SetCookieBlockedReason = "SyntaxError"
SetCookieBlockedReasonSchemeNotSupported SetCookieBlockedReason = "SchemeNotSupported"
SetCookieBlockedReasonOverwriteSecure SetCookieBlockedReason = "OverwriteSecure"
SetCookieBlockedReasonInvalidDomain SetCookieBlockedReason = "InvalidDomain"
SetCookieBlockedReasonInvalidPrefix SetCookieBlockedReason = "InvalidPrefix"
SetCookieBlockedReasonUnknownError SetCookieBlockedReason = "UnknownError"
SetCookieBlockedReasonSchemefulSameSiteStrict SetCookieBlockedReason = "SchemefulSameSiteStrict"
SetCookieBlockedReasonSchemefulSameSiteLax SetCookieBlockedReason = "SchemefulSameSiteLax"
SetCookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax SetCookieBlockedReason = "SchemefulSameSiteUnspecifiedTreatedAsLax"
SetCookieBlockedReasonSamePartyFromCrossPartyContext SetCookieBlockedReason = "SamePartyFromCrossPartyContext"
SetCookieBlockedReasonSamePartyConflictsWithOtherAttributes SetCookieBlockedReason = "SamePartyConflictsWithOtherAttributes"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -827,6 +1079,16 @@ func (t *SetCookieBlockedReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = SetCookieBlockedReasonInvalidPrefix
case SetCookieBlockedReasonUnknownError:
*t = SetCookieBlockedReasonUnknownError
case SetCookieBlockedReasonSchemefulSameSiteStrict:
*t = SetCookieBlockedReasonSchemefulSameSiteStrict
case SetCookieBlockedReasonSchemefulSameSiteLax:
*t = SetCookieBlockedReasonSchemefulSameSiteLax
case SetCookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax:
*t = SetCookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax
case SetCookieBlockedReasonSamePartyFromCrossPartyContext:
*t = SetCookieBlockedReasonSamePartyFromCrossPartyContext
case SetCookieBlockedReasonSamePartyConflictsWithOtherAttributes:
*t = SetCookieBlockedReasonSamePartyConflictsWithOtherAttributes
default:
in.AddError(errors.New("unknown SetCookieBlockedReason value"))
@@ -851,15 +1113,19 @@ func (t CookieBlockedReason) String() string {
// CookieBlockedReason values.
const (
CookieBlockedReasonSecureOnly CookieBlockedReason = "SecureOnly"
CookieBlockedReasonNotOnPath CookieBlockedReason = "NotOnPath"
CookieBlockedReasonDomainMismatch CookieBlockedReason = "DomainMismatch"
CookieBlockedReasonSameSiteStrict CookieBlockedReason = "SameSiteStrict"
CookieBlockedReasonSameSiteLax CookieBlockedReason = "SameSiteLax"
CookieBlockedReasonSameSiteUnspecifiedTreatedAsLax CookieBlockedReason = "SameSiteUnspecifiedTreatedAsLax"
CookieBlockedReasonSameSiteNoneInsecure CookieBlockedReason = "SameSiteNoneInsecure"
CookieBlockedReasonUserPreferences CookieBlockedReason = "UserPreferences"
CookieBlockedReasonUnknownError CookieBlockedReason = "UnknownError"
CookieBlockedReasonSecureOnly CookieBlockedReason = "SecureOnly"
CookieBlockedReasonNotOnPath CookieBlockedReason = "NotOnPath"
CookieBlockedReasonDomainMismatch CookieBlockedReason = "DomainMismatch"
CookieBlockedReasonSameSiteStrict CookieBlockedReason = "SameSiteStrict"
CookieBlockedReasonSameSiteLax CookieBlockedReason = "SameSiteLax"
CookieBlockedReasonSameSiteUnspecifiedTreatedAsLax CookieBlockedReason = "SameSiteUnspecifiedTreatedAsLax"
CookieBlockedReasonSameSiteNoneInsecure CookieBlockedReason = "SameSiteNoneInsecure"
CookieBlockedReasonUserPreferences CookieBlockedReason = "UserPreferences"
CookieBlockedReasonUnknownError CookieBlockedReason = "UnknownError"
CookieBlockedReasonSchemefulSameSiteStrict CookieBlockedReason = "SchemefulSameSiteStrict"
CookieBlockedReasonSchemefulSameSiteLax CookieBlockedReason = "SchemefulSameSiteLax"
CookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax CookieBlockedReason = "SchemefulSameSiteUnspecifiedTreatedAsLax"
CookieBlockedReasonSamePartyFromCrossPartyContext CookieBlockedReason = "SamePartyFromCrossPartyContext"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -893,6 +1159,14 @@ func (t *CookieBlockedReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CookieBlockedReasonUserPreferences
case CookieBlockedReasonUnknownError:
*t = CookieBlockedReasonUnknownError
case CookieBlockedReasonSchemefulSameSiteStrict:
*t = CookieBlockedReasonSchemefulSameSiteStrict
case CookieBlockedReasonSchemefulSameSiteLax:
*t = CookieBlockedReasonSchemefulSameSiteLax
case CookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax:
*t = CookieBlockedReasonSchemefulSameSiteUnspecifiedTreatedAsLax
case CookieBlockedReasonSamePartyFromCrossPartyContext:
*t = CookieBlockedReasonSamePartyFromCrossPartyContext
default:
in.AddError(errors.New("unknown CookieBlockedReason value"))
@@ -927,16 +1201,19 @@ type BlockedCookieWithReason struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CookieParam
type CookieParam struct {
Name string `json:"name"` // Cookie name.
Value string `json:"value"` // Cookie value.
URL string `json:"url,omitempty"` // The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie.
Domain string `json:"domain,omitempty"` // Cookie domain.
Path string `json:"path,omitempty"` // Cookie path.
Secure bool `json:"secure,omitempty"` // True if cookie is secure.
HTTPOnly bool `json:"httpOnly,omitempty"` // True if cookie is http-only.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Cookie SameSite type.
Expires *cdp.TimeSinceEpoch `json:"expires,omitempty"` // Cookie expiration date, session cookie if not set
Priority CookiePriority `json:"priority,omitempty"` // Cookie Priority.
Name string `json:"name"` // Cookie name.
Value string `json:"value"` // Cookie value.
URL string `json:"url,omitempty"` // The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, source port, and source scheme values of the created cookie.
Domain string `json:"domain,omitempty"` // Cookie domain.
Path string `json:"path,omitempty"` // Cookie path.
Secure bool `json:"secure,omitempty"` // True if cookie is secure.
HTTPOnly bool `json:"httpOnly,omitempty"` // True if cookie is http-only.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Cookie SameSite type.
Expires *cdp.TimeSinceEpoch `json:"expires,omitempty"` // Cookie expiration date, session cookie if not set
Priority CookiePriority `json:"priority,omitempty"` // Cookie Priority.
SameParty bool `json:"sameParty,omitempty"` // True if cookie is SameParty.
SourceScheme CookieSourceScheme `json:"sourceScheme,omitempty"` // Cookie source scheme type.
SourcePort int64 `json:"sourcePort,omitempty"` // Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
}
// AuthChallenge authorization challenge for HTTP status code 401 or 407.
@@ -1116,6 +1393,306 @@ type SignedExchangeInfo struct {
Errors []*SignedExchangeError `json:"errors,omitempty"` // Errors occurred while handling the signed exchagne.
}
// ContentEncoding list of content encodings supported by the backend.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-ContentEncoding
type ContentEncoding string
// String returns the ContentEncoding as string value.
func (t ContentEncoding) String() string {
return string(t)
}
// ContentEncoding values.
const (
ContentEncodingDeflate ContentEncoding = "deflate"
ContentEncodingGzip ContentEncoding = "gzip"
ContentEncodingBr ContentEncoding = "br"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t ContentEncoding) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t ContentEncoding) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *ContentEncoding) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch ContentEncoding(in.String()) {
case ContentEncodingDeflate:
*t = ContentEncodingDeflate
case ContentEncodingGzip:
*t = ContentEncodingGzip
case ContentEncodingBr:
*t = ContentEncodingBr
default:
in.AddError(errors.New("unknown ContentEncoding value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *ContentEncoding) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// PrivateNetworkRequestPolicy [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-PrivateNetworkRequestPolicy
type PrivateNetworkRequestPolicy string
// String returns the PrivateNetworkRequestPolicy as string value.
func (t PrivateNetworkRequestPolicy) String() string {
return string(t)
}
// PrivateNetworkRequestPolicy values.
const (
PrivateNetworkRequestPolicyAllow PrivateNetworkRequestPolicy = "Allow"
PrivateNetworkRequestPolicyBlockFromInsecureToMorePrivate PrivateNetworkRequestPolicy = "BlockFromInsecureToMorePrivate"
PrivateNetworkRequestPolicyWarnFromInsecureToMorePrivate PrivateNetworkRequestPolicy = "WarnFromInsecureToMorePrivate"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t PrivateNetworkRequestPolicy) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t PrivateNetworkRequestPolicy) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *PrivateNetworkRequestPolicy) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch PrivateNetworkRequestPolicy(in.String()) {
case PrivateNetworkRequestPolicyAllow:
*t = PrivateNetworkRequestPolicyAllow
case PrivateNetworkRequestPolicyBlockFromInsecureToMorePrivate:
*t = PrivateNetworkRequestPolicyBlockFromInsecureToMorePrivate
case PrivateNetworkRequestPolicyWarnFromInsecureToMorePrivate:
*t = PrivateNetworkRequestPolicyWarnFromInsecureToMorePrivate
default:
in.AddError(errors.New("unknown PrivateNetworkRequestPolicy value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *PrivateNetworkRequestPolicy) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// IPAddressSpace [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-IPAddressSpace
type IPAddressSpace string
// String returns the IPAddressSpace as string value.
func (t IPAddressSpace) String() string {
return string(t)
}
// IPAddressSpace values.
const (
IPAddressSpaceLocal IPAddressSpace = "Local"
IPAddressSpacePrivate IPAddressSpace = "Private"
IPAddressSpacePublic IPAddressSpace = "Public"
IPAddressSpaceUnknown IPAddressSpace = "Unknown"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t IPAddressSpace) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t IPAddressSpace) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *IPAddressSpace) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch IPAddressSpace(in.String()) {
case IPAddressSpaceLocal:
*t = IPAddressSpaceLocal
case IPAddressSpacePrivate:
*t = IPAddressSpacePrivate
case IPAddressSpacePublic:
*t = IPAddressSpacePublic
case IPAddressSpaceUnknown:
*t = IPAddressSpaceUnknown
default:
in.AddError(errors.New("unknown IPAddressSpace value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *IPAddressSpace) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// ClientSecurityState [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-ClientSecurityState
type ClientSecurityState struct {
InitiatorIsSecureContext bool `json:"initiatorIsSecureContext"`
InitiatorIPAddressSpace IPAddressSpace `json:"initiatorIPAddressSpace"`
PrivateNetworkRequestPolicy PrivateNetworkRequestPolicy `json:"privateNetworkRequestPolicy"`
}
// CrossOriginOpenerPolicyValue [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CrossOriginOpenerPolicyValue
type CrossOriginOpenerPolicyValue string
// String returns the CrossOriginOpenerPolicyValue as string value.
func (t CrossOriginOpenerPolicyValue) String() string {
return string(t)
}
// CrossOriginOpenerPolicyValue values.
const (
CrossOriginOpenerPolicyValueSameOrigin CrossOriginOpenerPolicyValue = "SameOrigin"
CrossOriginOpenerPolicyValueSameOriginAllowPopups CrossOriginOpenerPolicyValue = "SameOriginAllowPopups"
CrossOriginOpenerPolicyValueUnsafeNone CrossOriginOpenerPolicyValue = "UnsafeNone"
CrossOriginOpenerPolicyValueSameOriginPlusCoep CrossOriginOpenerPolicyValue = "SameOriginPlusCoep"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CrossOriginOpenerPolicyValue) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CrossOriginOpenerPolicyValue) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CrossOriginOpenerPolicyValue) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CrossOriginOpenerPolicyValue(in.String()) {
case CrossOriginOpenerPolicyValueSameOrigin:
*t = CrossOriginOpenerPolicyValueSameOrigin
case CrossOriginOpenerPolicyValueSameOriginAllowPopups:
*t = CrossOriginOpenerPolicyValueSameOriginAllowPopups
case CrossOriginOpenerPolicyValueUnsafeNone:
*t = CrossOriginOpenerPolicyValueUnsafeNone
case CrossOriginOpenerPolicyValueSameOriginPlusCoep:
*t = CrossOriginOpenerPolicyValueSameOriginPlusCoep
default:
in.AddError(errors.New("unknown CrossOriginOpenerPolicyValue value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CrossOriginOpenerPolicyValue) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CrossOriginOpenerPolicyStatus [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CrossOriginOpenerPolicyStatus
type CrossOriginOpenerPolicyStatus struct {
Value CrossOriginOpenerPolicyValue `json:"value"`
ReportOnlyValue CrossOriginOpenerPolicyValue `json:"reportOnlyValue"`
ReportingEndpoint string `json:"reportingEndpoint,omitempty"`
ReportOnlyReportingEndpoint string `json:"reportOnlyReportingEndpoint,omitempty"`
}
// CrossOriginEmbedderPolicyValue [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CrossOriginEmbedderPolicyValue
type CrossOriginEmbedderPolicyValue string
// String returns the CrossOriginEmbedderPolicyValue as string value.
func (t CrossOriginEmbedderPolicyValue) String() string {
return string(t)
}
// CrossOriginEmbedderPolicyValue values.
const (
CrossOriginEmbedderPolicyValueNone CrossOriginEmbedderPolicyValue = "None"
CrossOriginEmbedderPolicyValueCredentialless CrossOriginEmbedderPolicyValue = "Credentialless"
CrossOriginEmbedderPolicyValueRequireCorp CrossOriginEmbedderPolicyValue = "RequireCorp"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t CrossOriginEmbedderPolicyValue) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t CrossOriginEmbedderPolicyValue) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *CrossOriginEmbedderPolicyValue) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch CrossOriginEmbedderPolicyValue(in.String()) {
case CrossOriginEmbedderPolicyValueNone:
*t = CrossOriginEmbedderPolicyValueNone
case CrossOriginEmbedderPolicyValueCredentialless:
*t = CrossOriginEmbedderPolicyValueCredentialless
case CrossOriginEmbedderPolicyValueRequireCorp:
*t = CrossOriginEmbedderPolicyValueRequireCorp
default:
in.AddError(errors.New("unknown CrossOriginEmbedderPolicyValue value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *CrossOriginEmbedderPolicyValue) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CrossOriginEmbedderPolicyStatus [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-CrossOriginEmbedderPolicyStatus
type CrossOriginEmbedderPolicyStatus struct {
Value CrossOriginEmbedderPolicyValue `json:"value"`
ReportOnlyValue CrossOriginEmbedderPolicyValue `json:"reportOnlyValue"`
ReportingEndpoint string `json:"reportingEndpoint,omitempty"`
ReportOnlyReportingEndpoint string `json:"reportOnlyReportingEndpoint,omitempty"`
}
// SecurityIsolationStatus [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-SecurityIsolationStatus
type SecurityIsolationStatus struct {
Coop *CrossOriginOpenerPolicyStatus `json:"coop,omitempty"`
Coep *CrossOriginEmbedderPolicyStatus `json:"coep,omitempty"`
}
// LoadNetworkResourcePageResult an object providing the result of a network
// resource load.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-LoadNetworkResourcePageResult
type LoadNetworkResourcePageResult struct {
Success bool `json:"success"`
NetError float64 `json:"netError,omitempty"` // Optional values used for error reporting.
NetErrorName string `json:"netErrorName,omitempty"`
HTTPStatusCode float64 `json:"httpStatusCode,omitempty"`
Stream io.StreamHandle `json:"stream,omitempty"` // If successful, one of the following two fields holds the result.
Headers Headers `json:"headers,omitempty"` // Response headers.
}
// LoadNetworkResourceOptions an options object that may be extended later to
// better support CORS, CORB and streaming.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-LoadNetworkResourceOptions
type LoadNetworkResourceOptions struct {
DisableCache bool `json:"disableCache"`
IncludeCredentials bool `json:"includeCredentials"`
}
// ReferrerPolicy the referrer policy of the request, as defined in
// https://www.w3.org/TR/referrer-policy/.
//
@@ -1179,6 +1756,51 @@ func (t *ReferrerPolicy) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// TrustTokenParamsRefreshPolicy only set for "token-redemption" type and
// determine whether to request a fresh SRR or use a still valid cached SRR.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-TrustTokenParams
type TrustTokenParamsRefreshPolicy string
// String returns the TrustTokenParamsRefreshPolicy as string value.
func (t TrustTokenParamsRefreshPolicy) String() string {
return string(t)
}
// TrustTokenParamsRefreshPolicy values.
const (
TrustTokenParamsRefreshPolicyUseCached TrustTokenParamsRefreshPolicy = "UseCached"
TrustTokenParamsRefreshPolicyRefresh TrustTokenParamsRefreshPolicy = "Refresh"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t TrustTokenParamsRefreshPolicy) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t TrustTokenParamsRefreshPolicy) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *TrustTokenParamsRefreshPolicy) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch TrustTokenParamsRefreshPolicy(in.String()) {
case TrustTokenParamsRefreshPolicyUseCached:
*t = TrustTokenParamsRefreshPolicyUseCached
case TrustTokenParamsRefreshPolicyRefresh:
*t = TrustTokenParamsRefreshPolicyRefresh
default:
in.AddError(errors.New("unknown TrustTokenParamsRefreshPolicy value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *TrustTokenParamsRefreshPolicy) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// InitiatorType type of this initiator.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Initiator
@@ -1195,6 +1817,7 @@ const (
InitiatorTypeScript InitiatorType = "script"
InitiatorTypePreload InitiatorType = "preload"
InitiatorTypeSignedExchange InitiatorType = "SignedExchange"
InitiatorTypePreflight InitiatorType = "preflight"
InitiatorTypeOther InitiatorType = "other"
)
@@ -1219,6 +1842,8 @@ func (t *InitiatorType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = InitiatorTypePreload
case InitiatorTypeSignedExchange:
*t = InitiatorTypeSignedExchange
case InitiatorTypePreflight:
*t = InitiatorTypePreflight
case InitiatorTypeOther:
*t = InitiatorTypeOther
@@ -1325,3 +1950,74 @@ func (t *AuthChallengeResponseResponse) UnmarshalEasyJSON(in *jlexer.Lexer) {
func (t *AuthChallengeResponseResponse) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// TrustTokenOperationDoneStatus detailed success or error status of the
// operation. 'AlreadyExists' also signifies a successful operation, as the
// result of the operation already exists und thus, the operation was abort
// preemptively (e.g. a cache hit).
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Network#event-trustTokenOperationDone
type TrustTokenOperationDoneStatus string
// String returns the TrustTokenOperationDoneStatus as string value.
func (t TrustTokenOperationDoneStatus) String() string {
return string(t)
}
// TrustTokenOperationDoneStatus values.
const (
TrustTokenOperationDoneStatusOk TrustTokenOperationDoneStatus = "Ok"
TrustTokenOperationDoneStatusInvalidArgument TrustTokenOperationDoneStatus = "InvalidArgument"
TrustTokenOperationDoneStatusFailedPrecondition TrustTokenOperationDoneStatus = "FailedPrecondition"
TrustTokenOperationDoneStatusResourceExhausted TrustTokenOperationDoneStatus = "ResourceExhausted"
TrustTokenOperationDoneStatusAlreadyExists TrustTokenOperationDoneStatus = "AlreadyExists"
TrustTokenOperationDoneStatusUnavailable TrustTokenOperationDoneStatus = "Unavailable"
TrustTokenOperationDoneStatusBadResponse TrustTokenOperationDoneStatus = "BadResponse"
TrustTokenOperationDoneStatusInternalError TrustTokenOperationDoneStatus = "InternalError"
TrustTokenOperationDoneStatusUnknownError TrustTokenOperationDoneStatus = "UnknownError"
TrustTokenOperationDoneStatusFulfilledLocally TrustTokenOperationDoneStatus = "FulfilledLocally"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t TrustTokenOperationDoneStatus) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t TrustTokenOperationDoneStatus) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *TrustTokenOperationDoneStatus) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch TrustTokenOperationDoneStatus(in.String()) {
case TrustTokenOperationDoneStatusOk:
*t = TrustTokenOperationDoneStatusOk
case TrustTokenOperationDoneStatusInvalidArgument:
*t = TrustTokenOperationDoneStatusInvalidArgument
case TrustTokenOperationDoneStatusFailedPrecondition:
*t = TrustTokenOperationDoneStatusFailedPrecondition
case TrustTokenOperationDoneStatusResourceExhausted:
*t = TrustTokenOperationDoneStatusResourceExhausted
case TrustTokenOperationDoneStatusAlreadyExists:
*t = TrustTokenOperationDoneStatusAlreadyExists
case TrustTokenOperationDoneStatusUnavailable:
*t = TrustTokenOperationDoneStatusUnavailable
case TrustTokenOperationDoneStatusBadResponse:
*t = TrustTokenOperationDoneStatusBadResponse
case TrustTokenOperationDoneStatusInternalError:
*t = TrustTokenOperationDoneStatusInternalError
case TrustTokenOperationDoneStatusUnknownError:
*t = TrustTokenOperationDoneStatusUnknownError
case TrustTokenOperationDoneStatusFulfilledLocally:
*t = TrustTokenOperationDoneStatusFulfilledLocally
default:
in.AddError(errors.New("unknown TrustTokenOperationDoneStatus value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *TrustTokenOperationDoneStatus) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}

File diff suppressed because it is too large Load Diff

View File

@@ -50,10 +50,11 @@ func (p *EnableParams) Do(ctx context.Context) (err error) {
// GetHighlightObjectForTestParams for testing.
type GetHighlightObjectForTestParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to get highlight object for.
IncludeDistance bool `json:"includeDistance,omitempty"` // Whether to include distance info.
IncludeStyle bool `json:"includeStyle,omitempty"` // Whether to include style info.
ColorFormat ColorFormat `json:"colorFormat,omitempty"` // The color format to get config with (default: hex)
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to get highlight object for.
IncludeDistance bool `json:"includeDistance,omitempty"` // Whether to include distance info.
IncludeStyle bool `json:"includeStyle,omitempty"` // Whether to include style info.
ColorFormat ColorFormat `json:"colorFormat,omitempty"` // The color format to get config with (default: hex).
ShowAccessibilityInfo bool `json:"showAccessibilityInfo,omitempty"` // Whether to show accessibility info (default: true).
}
// GetHighlightObjectForTest for testing.
@@ -86,6 +87,13 @@ func (p GetHighlightObjectForTestParams) WithColorFormat(colorFormat ColorFormat
return &p
}
// WithShowAccessibilityInfo whether to show accessibility info (default:
// true).
func (p GetHighlightObjectForTestParams) WithShowAccessibilityInfo(showAccessibilityInfo bool) *GetHighlightObjectForTestParams {
p.ShowAccessibilityInfo = showAccessibilityInfo
return &p
}
// GetHighlightObjectForTestReturns return values.
type GetHighlightObjectForTestReturns struct {
Highlight easyjson.RawMessage `json:"highlight,omitempty"`
@@ -106,6 +114,81 @@ func (p *GetHighlightObjectForTestParams) Do(ctx context.Context) (highlight eas
return res.Highlight, nil
}
// GetGridHighlightObjectsForTestParams for Persistent Grid testing.
type GetGridHighlightObjectsForTestParams struct {
NodeIds []cdp.NodeID `json:"nodeIds"` // Ids of the node to get highlight object for.
}
// GetGridHighlightObjectsForTest for Persistent Grid testing.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-getGridHighlightObjectsForTest
//
// parameters:
// nodeIds - Ids of the node to get highlight object for.
func GetGridHighlightObjectsForTest(nodeIds []cdp.NodeID) *GetGridHighlightObjectsForTestParams {
return &GetGridHighlightObjectsForTestParams{
NodeIds: nodeIds,
}
}
// GetGridHighlightObjectsForTestReturns return values.
type GetGridHighlightObjectsForTestReturns struct {
Highlights easyjson.RawMessage `json:"highlights,omitempty"`
}
// Do executes Overlay.getGridHighlightObjectsForTest against the provided context.
//
// returns:
// highlights - Grid Highlight data for the node ids provided.
func (p *GetGridHighlightObjectsForTestParams) Do(ctx context.Context) (highlights easyjson.RawMessage, err error) {
// execute
var res GetGridHighlightObjectsForTestReturns
err = cdp.Execute(ctx, CommandGetGridHighlightObjectsForTest, p, &res)
if err != nil {
return nil, err
}
return res.Highlights, nil
}
// GetSourceOrderHighlightObjectForTestParams for Source Order Viewer
// testing.
type GetSourceOrderHighlightObjectForTestParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to highlight.
}
// GetSourceOrderHighlightObjectForTest for Source Order Viewer testing.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-getSourceOrderHighlightObjectForTest
//
// parameters:
// nodeID - Id of the node to highlight.
func GetSourceOrderHighlightObjectForTest(nodeID cdp.NodeID) *GetSourceOrderHighlightObjectForTestParams {
return &GetSourceOrderHighlightObjectForTestParams{
NodeID: nodeID,
}
}
// GetSourceOrderHighlightObjectForTestReturns return values.
type GetSourceOrderHighlightObjectForTestReturns struct {
Highlight easyjson.RawMessage `json:"highlight,omitempty"`
}
// Do executes Overlay.getSourceOrderHighlightObjectForTest against the provided context.
//
// returns:
// highlight - Source order highlight data for the node id provided.
func (p *GetSourceOrderHighlightObjectForTestParams) Do(ctx context.Context) (highlight easyjson.RawMessage, err error) {
// execute
var res GetSourceOrderHighlightObjectForTestReturns
err = cdp.Execute(ctx, CommandGetSourceOrderHighlightObjectForTest, p, &res)
if err != nil {
return nil, err
}
return res.Highlight, nil
}
// HideHighlightParams hides any highlight.
type HideHighlightParams struct{}
@@ -296,6 +379,53 @@ func (p *HighlightRectParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandHighlightRect, p, nil)
}
// HighlightSourceOrderParams highlights the source order of the children of
// the DOM node with given id or with the given JavaScript object wrapper.
// Either nodeId or objectId must be specified.
type HighlightSourceOrderParams struct {
SourceOrderConfig *SourceOrderConfig `json:"sourceOrderConfig"` // A descriptor for the appearance of the overlay drawing.
NodeID cdp.NodeID `json:"nodeId,omitempty"` // Identifier of the node to highlight.
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Identifier of the backend node to highlight.
ObjectID runtime.RemoteObjectID `json:"objectId,omitempty"` // JavaScript object id of the node to be highlighted.
}
// HighlightSourceOrder highlights the source order of the children of the
// DOM node with given id or with the given JavaScript object wrapper. Either
// nodeId or objectId must be specified.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-highlightSourceOrder
//
// parameters:
// sourceOrderConfig - A descriptor for the appearance of the overlay drawing.
func HighlightSourceOrder(sourceOrderConfig *SourceOrderConfig) *HighlightSourceOrderParams {
return &HighlightSourceOrderParams{
SourceOrderConfig: sourceOrderConfig,
}
}
// WithNodeID identifier of the node to highlight.
func (p HighlightSourceOrderParams) WithNodeID(nodeID cdp.NodeID) *HighlightSourceOrderParams {
p.NodeID = nodeID
return &p
}
// WithBackendNodeID identifier of the backend node to highlight.
func (p HighlightSourceOrderParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *HighlightSourceOrderParams {
p.BackendNodeID = backendNodeID
return &p
}
// WithObjectID JavaScript object id of the node to be highlighted.
func (p HighlightSourceOrderParams) WithObjectID(objectID runtime.RemoteObjectID) *HighlightSourceOrderParams {
p.ObjectID = objectID
return &p
}
// Do executes Overlay.highlightSourceOrder against the provided context.
func (p *HighlightSourceOrderParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandHighlightSourceOrder, p, nil)
}
// SetInspectModeParams enters the 'inspect' mode. In this mode, elements
// that user is hovering over are highlighted. Backend then generates
// 'inspectNodeRequested' event upon element selection.
@@ -425,6 +555,73 @@ func (p *SetShowFPSCounterParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetShowFPSCounter, p, nil)
}
// SetShowGridOverlaysParams highlight multiple elements with the CSS Grid
// overlay.
type SetShowGridOverlaysParams struct {
GridNodeHighlightConfigs []*GridNodeHighlightConfig `json:"gridNodeHighlightConfigs"` // An array of node identifiers and descriptors for the highlight appearance.
}
// SetShowGridOverlays highlight multiple elements with the CSS Grid overlay.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setShowGridOverlays
//
// parameters:
// gridNodeHighlightConfigs - An array of node identifiers and descriptors for the highlight appearance.
func SetShowGridOverlays(gridNodeHighlightConfigs []*GridNodeHighlightConfig) *SetShowGridOverlaysParams {
return &SetShowGridOverlaysParams{
GridNodeHighlightConfigs: gridNodeHighlightConfigs,
}
}
// Do executes Overlay.setShowGridOverlays against the provided context.
func (p *SetShowGridOverlaysParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetShowGridOverlays, p, nil)
}
// SetShowFlexOverlaysParams [no description].
type SetShowFlexOverlaysParams struct {
FlexNodeHighlightConfigs []*FlexNodeHighlightConfig `json:"flexNodeHighlightConfigs"` // An array of node identifiers and descriptors for the highlight appearance.
}
// SetShowFlexOverlays [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setShowFlexOverlays
//
// parameters:
// flexNodeHighlightConfigs - An array of node identifiers and descriptors for the highlight appearance.
func SetShowFlexOverlays(flexNodeHighlightConfigs []*FlexNodeHighlightConfig) *SetShowFlexOverlaysParams {
return &SetShowFlexOverlaysParams{
FlexNodeHighlightConfigs: flexNodeHighlightConfigs,
}
}
// Do executes Overlay.setShowFlexOverlays against the provided context.
func (p *SetShowFlexOverlaysParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetShowFlexOverlays, p, nil)
}
// SetShowScrollSnapOverlaysParams [no description].
type SetShowScrollSnapOverlaysParams struct {
ScrollSnapHighlightConfigs []*ScrollSnapHighlightConfig `json:"scrollSnapHighlightConfigs"` // An array of node identifiers and descriptors for the highlight appearance.
}
// SetShowScrollSnapOverlays [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setShowScrollSnapOverlays
//
// parameters:
// scrollSnapHighlightConfigs - An array of node identifiers and descriptors for the highlight appearance.
func SetShowScrollSnapOverlays(scrollSnapHighlightConfigs []*ScrollSnapHighlightConfig) *SetShowScrollSnapOverlaysParams {
return &SetShowScrollSnapOverlaysParams{
ScrollSnapHighlightConfigs: scrollSnapHighlightConfigs,
}
}
// Do executes Overlay.setShowScrollSnapOverlays against the provided context.
func (p *SetShowScrollSnapOverlaysParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetShowScrollSnapOverlays, p, nil)
}
// SetShowPaintRectsParams requests that backend shows paint rectangles.
type SetShowPaintRectsParams struct {
Result bool `json:"result"` // True for showing paint rectangles
@@ -519,6 +716,30 @@ func (p *SetShowHitTestBordersParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetShowHitTestBorders, p, nil)
}
// SetShowWebVitalsParams request that backend shows an overlay with web
// vital metrics.
type SetShowWebVitalsParams struct {
Show bool `json:"show"`
}
// SetShowWebVitals request that backend shows an overlay with web vital
// metrics.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setShowWebVitals
//
// parameters:
// show
func SetShowWebVitals(show bool) *SetShowWebVitalsParams {
return &SetShowWebVitalsParams{
Show: show,
}
}
// Do executes Overlay.setShowWebVitals against the provided context.
func (p *SetShowWebVitalsParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetShowWebVitals, p, nil)
}
// SetShowViewportSizeOnResizeParams paints viewport size upon main frame
// resize.
type SetShowViewportSizeOnResizeParams struct {
@@ -569,23 +790,30 @@ func (p *SetShowHingeParams) Do(ctx context.Context) (err error) {
// Command names.
const (
CommandDisable = "Overlay.disable"
CommandEnable = "Overlay.enable"
CommandGetHighlightObjectForTest = "Overlay.getHighlightObjectForTest"
CommandHideHighlight = "Overlay.hideHighlight"
CommandHighlightFrame = "Overlay.highlightFrame"
CommandHighlightNode = "Overlay.highlightNode"
CommandHighlightQuad = "Overlay.highlightQuad"
CommandHighlightRect = "Overlay.highlightRect"
CommandSetInspectMode = "Overlay.setInspectMode"
CommandSetShowAdHighlights = "Overlay.setShowAdHighlights"
CommandSetPausedInDebuggerMessage = "Overlay.setPausedInDebuggerMessage"
CommandSetShowDebugBorders = "Overlay.setShowDebugBorders"
CommandSetShowFPSCounter = "Overlay.setShowFPSCounter"
CommandSetShowPaintRects = "Overlay.setShowPaintRects"
CommandSetShowLayoutShiftRegions = "Overlay.setShowLayoutShiftRegions"
CommandSetShowScrollBottleneckRects = "Overlay.setShowScrollBottleneckRects"
CommandSetShowHitTestBorders = "Overlay.setShowHitTestBorders"
CommandSetShowViewportSizeOnResize = "Overlay.setShowViewportSizeOnResize"
CommandSetShowHinge = "Overlay.setShowHinge"
CommandDisable = "Overlay.disable"
CommandEnable = "Overlay.enable"
CommandGetHighlightObjectForTest = "Overlay.getHighlightObjectForTest"
CommandGetGridHighlightObjectsForTest = "Overlay.getGridHighlightObjectsForTest"
CommandGetSourceOrderHighlightObjectForTest = "Overlay.getSourceOrderHighlightObjectForTest"
CommandHideHighlight = "Overlay.hideHighlight"
CommandHighlightFrame = "Overlay.highlightFrame"
CommandHighlightNode = "Overlay.highlightNode"
CommandHighlightQuad = "Overlay.highlightQuad"
CommandHighlightRect = "Overlay.highlightRect"
CommandHighlightSourceOrder = "Overlay.highlightSourceOrder"
CommandSetInspectMode = "Overlay.setInspectMode"
CommandSetShowAdHighlights = "Overlay.setShowAdHighlights"
CommandSetPausedInDebuggerMessage = "Overlay.setPausedInDebuggerMessage"
CommandSetShowDebugBorders = "Overlay.setShowDebugBorders"
CommandSetShowFPSCounter = "Overlay.setShowFPSCounter"
CommandSetShowGridOverlays = "Overlay.setShowGridOverlays"
CommandSetShowFlexOverlays = "Overlay.setShowFlexOverlays"
CommandSetShowScrollSnapOverlays = "Overlay.setShowScrollSnapOverlays"
CommandSetShowPaintRects = "Overlay.setShowPaintRects"
CommandSetShowLayoutShiftRegions = "Overlay.setShowLayoutShiftRegions"
CommandSetShowScrollBottleneckRects = "Overlay.setShowScrollBottleneckRects"
CommandSetShowHitTestBorders = "Overlay.setShowHitTestBorders"
CommandSetShowWebVitals = "Overlay.setShowWebVitals"
CommandSetShowViewportSizeOnResize = "Overlay.setShowViewportSizeOnResize"
CommandSetShowHinge = "Overlay.setShowHinge"
)

View File

@@ -12,40 +12,150 @@ import (
"github.com/mailru/easyjson/jwriter"
)
// SourceOrderConfig configuration data for drawing the source order of an
// elements children.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-SourceOrderConfig
type SourceOrderConfig struct {
ParentOutlineColor *cdp.RGBA `json:"parentOutlineColor"` // the color to outline the givent element in.
ChildOutlineColor *cdp.RGBA `json:"childOutlineColor"` // the color to outline the child elements in.
}
// GridHighlightConfig configuration data for the highlighting of Grid
// elements.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-GridHighlightConfig
type GridHighlightConfig struct {
ShowGridExtensionLines bool `json:"showGridExtensionLines,omitempty"` // Whether the extension lines from grid cells to the rulers should be shown (default: false).
GridBorderColor *cdp.RGBA `json:"gridBorderColor,omitempty"` // The grid container border highlight color (default: transparent).
CellBorderColor *cdp.RGBA `json:"cellBorderColor,omitempty"` // The cell border color (default: transparent).
GridBorderDash bool `json:"gridBorderDash,omitempty"` // Whether the grid border is dashed (default: false).
CellBorderDash bool `json:"cellBorderDash,omitempty"` // Whether the cell border is dashed (default: false).
RowGapColor *cdp.RGBA `json:"rowGapColor,omitempty"` // The row gap highlight fill color (default: transparent).
RowHatchColor *cdp.RGBA `json:"rowHatchColor,omitempty"` // The row gap hatching fill color (default: transparent).
ColumnGapColor *cdp.RGBA `json:"columnGapColor,omitempty"` // The column gap highlight fill color (default: transparent).
ColumnHatchColor *cdp.RGBA `json:"columnHatchColor,omitempty"` // The column gap hatching fill color (default: transparent).
ShowGridExtensionLines bool `json:"showGridExtensionLines,omitempty"` // Whether the extension lines from grid cells to the rulers should be shown (default: false).
ShowPositiveLineNumbers bool `json:"showPositiveLineNumbers,omitempty"` // Show Positive line number labels (default: false).
ShowNegativeLineNumbers bool `json:"showNegativeLineNumbers,omitempty"` // Show Negative line number labels (default: false).
ShowAreaNames bool `json:"showAreaNames,omitempty"` // Show area name labels (default: false).
ShowLineNames bool `json:"showLineNames,omitempty"` // Show line name labels (default: false).
ShowTrackSizes bool `json:"showTrackSizes,omitempty"` // Show track size labels (default: false).
GridBorderColor *cdp.RGBA `json:"gridBorderColor,omitempty"` // The grid container border highlight color (default: transparent).
RowLineColor *cdp.RGBA `json:"rowLineColor,omitempty"` // The row line color (default: transparent).
ColumnLineColor *cdp.RGBA `json:"columnLineColor,omitempty"` // The column line color (default: transparent).
GridBorderDash bool `json:"gridBorderDash,omitempty"` // Whether the grid border is dashed (default: false).
RowLineDash bool `json:"rowLineDash,omitempty"` // Whether row lines are dashed (default: false).
ColumnLineDash bool `json:"columnLineDash,omitempty"` // Whether column lines are dashed (default: false).
RowGapColor *cdp.RGBA `json:"rowGapColor,omitempty"` // The row gap highlight fill color (default: transparent).
RowHatchColor *cdp.RGBA `json:"rowHatchColor,omitempty"` // The row gap hatching fill color (default: transparent).
ColumnGapColor *cdp.RGBA `json:"columnGapColor,omitempty"` // The column gap highlight fill color (default: transparent).
ColumnHatchColor *cdp.RGBA `json:"columnHatchColor,omitempty"` // The column gap hatching fill color (default: transparent).
AreaBorderColor *cdp.RGBA `json:"areaBorderColor,omitempty"` // The named grid areas border color (Default: transparent).
GridBackgroundColor *cdp.RGBA `json:"gridBackgroundColor,omitempty"` // The grid container background color (Default: transparent).
}
// FlexContainerHighlightConfig configuration data for the highlighting of
// Flex container elements.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-FlexContainerHighlightConfig
type FlexContainerHighlightConfig struct {
ContainerBorder *LineStyle `json:"containerBorder,omitempty"` // The style of the container border
LineSeparator *LineStyle `json:"lineSeparator,omitempty"` // The style of the separator between lines
ItemSeparator *LineStyle `json:"itemSeparator,omitempty"` // The style of the separator between items
MainDistributedSpace *BoxStyle `json:"mainDistributedSpace,omitempty"` // Style of content-distribution space on the main axis (justify-content).
CrossDistributedSpace *BoxStyle `json:"crossDistributedSpace,omitempty"` // Style of content-distribution space on the cross axis (align-content).
RowGapSpace *BoxStyle `json:"rowGapSpace,omitempty"` // Style of empty space caused by row gaps (gap/row-gap).
ColumnGapSpace *BoxStyle `json:"columnGapSpace,omitempty"` // Style of empty space caused by columns gaps (gap/column-gap).
CrossAlignment *LineStyle `json:"crossAlignment,omitempty"` // Style of the self-alignment line (align-items).
}
// FlexItemHighlightConfig configuration data for the highlighting of Flex
// item elements.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-FlexItemHighlightConfig
type FlexItemHighlightConfig struct {
BaseSizeBox *BoxStyle `json:"baseSizeBox,omitempty"` // Style of the box representing the item's base size
BaseSizeBorder *LineStyle `json:"baseSizeBorder,omitempty"` // Style of the border around the box representing the item's base size
FlexibilityArrow *LineStyle `json:"flexibilityArrow,omitempty"` // Style of the arrow representing if the item grew or shrank
}
// LineStyle style information for drawing a line.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-LineStyle
type LineStyle struct {
Color *cdp.RGBA `json:"color,omitempty"` // The color of the line (default: transparent)
Pattern LineStylePattern `json:"pattern,omitempty"` // The line pattern (default: solid)
}
// BoxStyle style information for drawing a box.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-BoxStyle
type BoxStyle struct {
FillColor *cdp.RGBA `json:"fillColor,omitempty"` // The background color for the box (default: transparent)
HatchColor *cdp.RGBA `json:"hatchColor,omitempty"` // The hatching color for the box (default: transparent)
}
// ContrastAlgorithm [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-ContrastAlgorithm
type ContrastAlgorithm string
// String returns the ContrastAlgorithm as string value.
func (t ContrastAlgorithm) String() string {
return string(t)
}
// ContrastAlgorithm values.
const (
ContrastAlgorithmAa ContrastAlgorithm = "aa"
ContrastAlgorithmAaa ContrastAlgorithm = "aaa"
ContrastAlgorithmApca ContrastAlgorithm = "apca"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t ContrastAlgorithm) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t ContrastAlgorithm) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *ContrastAlgorithm) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch ContrastAlgorithm(in.String()) {
case ContrastAlgorithmAa:
*t = ContrastAlgorithmAa
case ContrastAlgorithmAaa:
*t = ContrastAlgorithmAaa
case ContrastAlgorithmApca:
*t = ContrastAlgorithmApca
default:
in.AddError(errors.New("unknown ContrastAlgorithm value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *ContrastAlgorithm) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// HighlightConfig configuration data for the highlighting of page elements.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-HighlightConfig
type HighlightConfig struct {
ShowInfo bool `json:"showInfo,omitempty"` // Whether the node info tooltip should be shown (default: false).
ShowStyles bool `json:"showStyles,omitempty"` // Whether the node styles in the tooltip (default: false).
ShowRulers bool `json:"showRulers,omitempty"` // Whether the rulers should be shown (default: false).
ShowExtensionLines bool `json:"showExtensionLines,omitempty"` // Whether the extension lines from node to the rulers should be shown (default: false).
ContentColor *cdp.RGBA `json:"contentColor,omitempty"` // The content box highlight fill color (default: transparent).
PaddingColor *cdp.RGBA `json:"paddingColor,omitempty"` // The padding highlight fill color (default: transparent).
BorderColor *cdp.RGBA `json:"borderColor,omitempty"` // The border highlight fill color (default: transparent).
MarginColor *cdp.RGBA `json:"marginColor,omitempty"` // The margin highlight fill color (default: transparent).
EventTargetColor *cdp.RGBA `json:"eventTargetColor,omitempty"` // The event target element highlight fill color (default: transparent).
ShapeColor *cdp.RGBA `json:"shapeColor,omitempty"` // The shape outside fill color (default: transparent).
ShapeMarginColor *cdp.RGBA `json:"shapeMarginColor,omitempty"` // The shape margin fill color (default: transparent).
CSSGridColor *cdp.RGBA `json:"cssGridColor,omitempty"` // The grid layout color (default: transparent).
ColorFormat ColorFormat `json:"colorFormat,omitempty"` // The color format used to format color styles (default: hex).
GridHighlightConfig *GridHighlightConfig `json:"gridHighlightConfig,omitempty"` // The grid layout highlight configuration (default: all transparent).
ShowInfo bool `json:"showInfo,omitempty"` // Whether the node info tooltip should be shown (default: false).
ShowStyles bool `json:"showStyles,omitempty"` // Whether the node styles in the tooltip (default: false).
ShowRulers bool `json:"showRulers,omitempty"` // Whether the rulers should be shown (default: false).
ShowAccessibilityInfo bool `json:"showAccessibilityInfo,omitempty"` // Whether the a11y info should be shown (default: true).
ShowExtensionLines bool `json:"showExtensionLines,omitempty"` // Whether the extension lines from node to the rulers should be shown (default: false).
ContentColor *cdp.RGBA `json:"contentColor,omitempty"` // The content box highlight fill color (default: transparent).
PaddingColor *cdp.RGBA `json:"paddingColor,omitempty"` // The padding highlight fill color (default: transparent).
BorderColor *cdp.RGBA `json:"borderColor,omitempty"` // The border highlight fill color (default: transparent).
MarginColor *cdp.RGBA `json:"marginColor,omitempty"` // The margin highlight fill color (default: transparent).
EventTargetColor *cdp.RGBA `json:"eventTargetColor,omitempty"` // The event target element highlight fill color (default: transparent).
ShapeColor *cdp.RGBA `json:"shapeColor,omitempty"` // The shape outside fill color (default: transparent).
ShapeMarginColor *cdp.RGBA `json:"shapeMarginColor,omitempty"` // The shape margin fill color (default: transparent).
CSSGridColor *cdp.RGBA `json:"cssGridColor,omitempty"` // The grid layout color (default: transparent).
ColorFormat ColorFormat `json:"colorFormat,omitempty"` // The color format used to format color styles (default: hex).
GridHighlightConfig *GridHighlightConfig `json:"gridHighlightConfig,omitempty"` // The grid layout highlight configuration (default: all transparent).
FlexContainerHighlightConfig *FlexContainerHighlightConfig `json:"flexContainerHighlightConfig,omitempty"` // The flex container highlight configuration (default: all transparent).
FlexItemHighlightConfig *FlexItemHighlightConfig `json:"flexItemHighlightConfig,omitempty"` // The flex item highlight configuration (default: all transparent).
ContrastAlgorithm ContrastAlgorithm `json:"contrastAlgorithm,omitempty"` // The contrast algorithm to use for the contrast ratio (default: aa).
}
// ColorFormat [no description].
@@ -95,6 +205,40 @@ func (t *ColorFormat) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// GridNodeHighlightConfig configurations for Persistent Grid Highlight.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-GridNodeHighlightConfig
type GridNodeHighlightConfig struct {
GridHighlightConfig *GridHighlightConfig `json:"gridHighlightConfig"` // A descriptor for the highlight appearance.
NodeID cdp.NodeID `json:"nodeId"` // Identifier of the node to highlight.
}
// FlexNodeHighlightConfig [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-FlexNodeHighlightConfig
type FlexNodeHighlightConfig struct {
FlexContainerHighlightConfig *FlexContainerHighlightConfig `json:"flexContainerHighlightConfig"` // A descriptor for the highlight appearance of flex containers.
NodeID cdp.NodeID `json:"nodeId"` // Identifier of the node to highlight.
}
// ScrollSnapContainerHighlightConfig [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-ScrollSnapContainerHighlightConfig
type ScrollSnapContainerHighlightConfig struct {
SnapportBorder *LineStyle `json:"snapportBorder,omitempty"` // The style of the snapport border (default: transparent)
SnapAreaBorder *LineStyle `json:"snapAreaBorder,omitempty"` // The style of the snap area border (default: transparent)
ScrollMarginColor *cdp.RGBA `json:"scrollMarginColor,omitempty"` // The margin highlight fill color (default: transparent).
ScrollPaddingColor *cdp.RGBA `json:"scrollPaddingColor,omitempty"` // The padding highlight fill color (default: transparent).
}
// ScrollSnapHighlightConfig [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-ScrollSnapHighlightConfig
type ScrollSnapHighlightConfig struct {
ScrollSnapContainerHighlightConfig *ScrollSnapContainerHighlightConfig `json:"scrollSnapContainerHighlightConfig"` // A descriptor for the highlight appearance of scroll snap containers.
NodeID cdp.NodeID `json:"nodeId"` // Identifier of the node to highlight.
}
// HingeConfig configuration for dual screen hinge.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-HingeConfig
@@ -156,3 +300,47 @@ func (t *InspectMode) UnmarshalEasyJSON(in *jlexer.Lexer) {
func (t *InspectMode) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// LineStylePattern the line pattern (default: solid).
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#type-LineStyle
type LineStylePattern string
// String returns the LineStylePattern as string value.
func (t LineStylePattern) String() string {
return string(t)
}
// LineStylePattern values.
const (
LineStylePatternDashed LineStylePattern = "dashed"
LineStylePatternDotted LineStylePattern = "dotted"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t LineStylePattern) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t LineStylePattern) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *LineStylePattern) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch LineStylePattern(in.String()) {
case LineStylePatternDashed:
*t = LineStylePatternDashed
case LineStylePatternDotted:
*t = LineStylePatternDotted
default:
in.AddError(errors.New("unknown LineStylePattern value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *LineStylePattern) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}

File diff suppressed because it is too large Load Diff

View File

@@ -37,7 +37,8 @@ type EventFrameAttached struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameDetached
type EventFrameDetached struct {
FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has been detached.
FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has been detached.
Reason FrameDetachedReason `json:"reason"`
}
// EventFrameNavigated fired once navigation of the frame has completed.
@@ -45,6 +46,14 @@ type EventFrameDetached struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameNavigated
type EventFrameNavigated struct {
Frame *cdp.Frame `json:"frame"` // Frame object.
Type NavigationType `json:"type"`
}
// EventDocumentOpened fired when opening document to write to.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-documentOpened
type EventDocumentOpened struct {
Frame *cdp.Frame `json:"frame"` // Frame object.
}
@@ -78,27 +87,6 @@ type EventFrameStoppedLoading struct {
FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has stopped loading.
}
// EventDownloadWillBegin fired when page is about to start a download.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-downloadWillBegin
type EventDownloadWillBegin struct {
FrameID cdp.FrameID `json:"frameId"` // Id of the frame that caused download to begin.
GUID string `json:"guid"` // Global unique identifier of the download.
URL string `json:"url"` // URL of the resource being downloaded.
SuggestedFilename string `json:"suggestedFilename"` // Suggested file name of the resource (the actual name of the file saved on disk may differ).
}
// EventDownloadProgress fired when download makes progress. Last call has
// |done| == true.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-downloadProgress
type EventDownloadProgress struct {
GUID string `json:"guid"` // Global unique identifier of the download.
TotalBytes float64 `json:"totalBytes"` // Total expected bytes to download.
ReceivedBytes float64 `json:"receivedBytes"` // Total bytes received.
State DownloadProgressState `json:"state"` // Download status.
}
// EventInterstitialHidden fired when interstitial page was hidden.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-interstitialHidden
@@ -141,6 +129,19 @@ type EventLifecycleEvent struct {
Timestamp *cdp.MonotonicTime `json:"timestamp"`
}
// EventBackForwardCacheNotUsed fired for failed bfcache history navigations
// if BackForwardCache feature is enabled. Do not assume any ordering with the
// Page.frameNavigated event. This event is fired only for main-frame history
// navigation where the document changes (non-same-document navigations), when
// bfcache navigation fails.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-backForwardCacheNotUsed
type EventBackForwardCacheNotUsed struct {
LoaderID cdp.LoaderID `json:"loaderId"` // The loader id for the associated navgation.
FrameID cdp.FrameID `json:"frameId"` // The frame id of the associated frame.
NotRestoredExplanations []*BackForwardCacheNotRestoredExplanation `json:"notRestoredExplanations"` // Array of reasons why the page could not be cached. This must not be empty.
}
// EventLoadEventFired [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-loadEventFired

View File

@@ -23,8 +23,9 @@ import (
// AddScriptToEvaluateOnNewDocumentParams evaluates given script in every
// frame upon creation (before loading frame's scripts).
type AddScriptToEvaluateOnNewDocumentParams struct {
Source string `json:"source"`
WorldName string `json:"worldName,omitempty"` // If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted.
Source string `json:"source"`
WorldName string `json:"worldName,omitempty"` // If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted.
IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"` // Specifies whether command line API should be available to the script, defaults to false.
}
// AddScriptToEvaluateOnNewDocument evaluates given script in every frame
@@ -48,6 +49,13 @@ func (p AddScriptToEvaluateOnNewDocumentParams) WithWorldName(worldName string)
return &p
}
// WithIncludeCommandLineAPI specifies whether command line API should be
// available to the script, defaults to false.
func (p AddScriptToEvaluateOnNewDocumentParams) WithIncludeCommandLineAPI(includeCommandLineAPI bool) *AddScriptToEvaluateOnNewDocumentParams {
p.IncludeCommandLineAPI = includeCommandLineAPI
return &p
}
// AddScriptToEvaluateOnNewDocumentReturns return values.
type AddScriptToEvaluateOnNewDocumentReturns struct {
Identifier ScriptIdentifier `json:"identifier,omitempty"` // Identifier of the added script.
@@ -85,10 +93,11 @@ func (p *BringToFrontParams) Do(ctx context.Context) (err error) {
// CaptureScreenshotParams capture page screenshot.
type CaptureScreenshotParams struct {
Format CaptureScreenshotFormat `json:"format,omitempty"` // Image compression format (defaults to png).
Quality int64 `json:"quality,omitempty"` // Compression quality from range [0..100] (jpeg only).
Clip *Viewport `json:"clip,omitempty"` // Capture the screenshot of a given region only.
FromSurface bool `json:"fromSurface,omitempty"` // Capture the screenshot from the surface, rather than the view. Defaults to true.
Format CaptureScreenshotFormat `json:"format,omitempty"` // Image compression format (defaults to png).
Quality int64 `json:"quality,omitempty"` // Compression quality from range [0..100] (jpeg only).
Clip *Viewport `json:"clip,omitempty"` // Capture the screenshot of a given region only.
FromSurface bool `json:"fromSurface,omitempty"` // Capture the screenshot from the surface, rather than the view. Defaults to true.
CaptureBeyondViewport bool `json:"captureBeyondViewport,omitempty"` // Capture the screenshot beyond the viewport. Defaults to false.
}
// CaptureScreenshot capture page screenshot.
@@ -125,6 +134,13 @@ func (p CaptureScreenshotParams) WithFromSurface(fromSurface bool) *CaptureScree
return &p
}
// WithCaptureBeyondViewport capture the screenshot beyond the viewport.
// Defaults to false.
func (p CaptureScreenshotParams) WithCaptureBeyondViewport(captureBeyondViewport bool) *CaptureScreenshotParams {
p.CaptureBeyondViewport = captureBeyondViewport
return &p
}
// CaptureScreenshotReturns return values.
type CaptureScreenshotReturns struct {
Data string `json:"data,omitempty"` // Base64-encoded image data.
@@ -423,26 +439,32 @@ func GetLayoutMetrics() *GetLayoutMetricsParams {
// GetLayoutMetricsReturns return values.
type GetLayoutMetricsReturns struct {
LayoutViewport *LayoutViewport `json:"layoutViewport,omitempty"` // Metrics relating to the layout viewport.
VisualViewport *VisualViewport `json:"visualViewport,omitempty"` // Metrics relating to the visual viewport.
ContentSize *dom.Rect `json:"contentSize,omitempty"` // Size of scrollable area.
LayoutViewport *LayoutViewport `json:"layoutViewport"` // Deprecated metrics relating to the layout viewport. Can be in DP or in CSS pixels depending on the enable-use-zoom-for-dsf flag. Use cssLayoutViewport instead.
VisualViewport *VisualViewport `json:"visualViewport"` // Deprecated metrics relating to the visual viewport. Can be in DP or in CSS pixels depending on the enable-use-zoom-for-dsf flag. Use cssVisualViewport instead.
ContentSize *dom.Rect `json:"contentSize"` // Deprecated size of scrollable area. Can be in DP or in CSS pixels depending on the enable-use-zoom-for-dsf flag. Use cssContentSize instead.
CSSLayoutViewport *LayoutViewport `json:"cssLayoutViewport"` // Metrics relating to the layout viewport in CSS pixels.
CSSVisualViewport *VisualViewport `json:"cssVisualViewport"` // Metrics relating to the visual viewport in CSS pixels.
CSSContentSize *dom.Rect `json:"cssContentSize"` // Size of scrollable area in CSS pixels.
}
// Do executes Page.getLayoutMetrics against the provided context.
//
// returns:
// layoutViewport - Metrics relating to the layout viewport.
// visualViewport - Metrics relating to the visual viewport.
// contentSize - Size of scrollable area.
func (p *GetLayoutMetricsParams) Do(ctx context.Context) (layoutViewport *LayoutViewport, visualViewport *VisualViewport, contentSize *dom.Rect, err error) {
// layoutViewport - Deprecated metrics relating to the layout viewport. Can be in DP or in CSS pixels depending on the enable-use-zoom-for-dsf flag. Use cssLayoutViewport instead.
// visualViewport - Deprecated metrics relating to the visual viewport. Can be in DP or in CSS pixels depending on the enable-use-zoom-for-dsf flag. Use cssVisualViewport instead.
// contentSize - Deprecated size of scrollable area. Can be in DP or in CSS pixels depending on the enable-use-zoom-for-dsf flag. Use cssContentSize instead.
// cssLayoutViewport - Metrics relating to the layout viewport in CSS pixels.
// cssVisualViewport - Metrics relating to the visual viewport in CSS pixels.
// cssContentSize - Size of scrollable area in CSS pixels.
func (p *GetLayoutMetricsParams) Do(ctx context.Context) (layoutViewport *LayoutViewport, visualViewport *VisualViewport, contentSize *dom.Rect, cssLayoutViewport *LayoutViewport, cssVisualViewport *VisualViewport, cssContentSize *dom.Rect, err error) {
// execute
var res GetLayoutMetricsReturns
err = cdp.Execute(ctx, CommandGetLayoutMetrics, nil, &res)
if err != nil {
return nil, nil, nil, err
return nil, nil, nil, nil, nil, nil, err
}
return res.LayoutViewport, res.VisualViewport, res.ContentSize, nil
return res.LayoutViewport, res.VisualViewport, res.ContentSize, res.CSSLayoutViewport, res.CSSVisualViewport, res.CSSContentSize, nil
}
// GetNavigationHistoryParams returns navigation history for the current
@@ -1047,6 +1069,44 @@ func (p *SetBypassCSPParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetBypassCSP, p, nil)
}
// GetPermissionsPolicyStateParams get Permissions Policy state on given
// frame.
type GetPermissionsPolicyStateParams struct {
FrameID cdp.FrameID `json:"frameId"`
}
// GetPermissionsPolicyState get Permissions Policy state on given frame.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getPermissionsPolicyState
//
// parameters:
// frameID
func GetPermissionsPolicyState(frameID cdp.FrameID) *GetPermissionsPolicyStateParams {
return &GetPermissionsPolicyStateParams{
FrameID: frameID,
}
}
// GetPermissionsPolicyStateReturns return values.
type GetPermissionsPolicyStateReturns struct {
States []*PermissionsPolicyFeatureState `json:"states,omitempty"`
}
// Do executes Page.getPermissionsPolicyState against the provided context.
//
// returns:
// states
func (p *GetPermissionsPolicyStateParams) Do(ctx context.Context) (states []*PermissionsPolicyFeatureState, err error) {
// execute
var res GetPermissionsPolicyStateReturns
err = cdp.Execute(ctx, CommandGetPermissionsPolicyState, p, &res)
if err != nil {
return nil, err
}
return res.States, nil
}
// SetFontFamiliesParams set generic font families.
type SetFontFamiliesParams struct {
FontFamilies *FontFamilies `json:"fontFamilies"` // Specifies font families to set. If a font family is not specified, it won't be changed.
@@ -1116,6 +1176,36 @@ func (p *SetDocumentContentParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDocumentContent, p, nil)
}
// SetDownloadBehaviorParams set the behavior when downloading a file.
type SetDownloadBehaviorParams struct {
Behavior SetDownloadBehaviorBehavior `json:"behavior"` // Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
DownloadPath string `json:"downloadPath,omitempty"` // The default path to save downloaded files to. This is required if behavior is set to 'allow'
}
// SetDownloadBehavior set the behavior when downloading a file.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setDownloadBehavior
//
// parameters:
// behavior - Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
func SetDownloadBehavior(behavior SetDownloadBehaviorBehavior) *SetDownloadBehaviorParams {
return &SetDownloadBehaviorParams{
Behavior: behavior,
}
}
// WithDownloadPath the default path to save downloaded files to. This is
// required if behavior is set to 'allow'.
func (p SetDownloadBehaviorParams) WithDownloadPath(downloadPath string) *SetDownloadBehaviorParams {
p.DownloadPath = downloadPath
return &p
}
// Do executes Page.setDownloadBehavior against the provided context.
func (p *SetDownloadBehaviorParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDownloadBehavior, p, nil)
}
// SetLifecycleEventsEnabledParams controls whether page will emit lifecycle
// events.
type SetLifecycleEventsEnabledParams struct {
@@ -1283,13 +1373,13 @@ func (p *StopScreencastParams) Do(ctx context.Context) (err error) {
}
// SetProduceCompilationCacheParams forces compilation cache to be generated
// for every subresource script.
// for every subresource script. See also: Page.produceCompilationCache.
type SetProduceCompilationCacheParams struct {
Enabled bool `json:"enabled"`
}
// SetProduceCompilationCache forces compilation cache to be generated for
// every subresource script.
// every subresource script. See also: Page.produceCompilationCache.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setProduceCompilationCache
//
@@ -1306,6 +1396,44 @@ func (p *SetProduceCompilationCacheParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetProduceCompilationCache, p, nil)
}
// ProduceCompilationCacheParams requests backend to produce compilation
// cache for the specified scripts. Unlike setProduceCompilationCache, this
// allows client to only produce cache for specific scripts. scripts are
// appeneded to the list of scripts for which the cache for would produced.
// Disabling compilation cache with setProduceCompilationCache would reset all
// pending cache requests. The list may also be reset during page navigation.
// When script with a matching URL is encountered, the cache is optionally
// produced upon backend discretion, based on internal heuristics. See also:
// Page.compilationCacheProduced.
type ProduceCompilationCacheParams struct {
Scripts []*CompilationCacheParams `json:"scripts"`
}
// ProduceCompilationCache requests backend to produce compilation cache for
// the specified scripts. Unlike setProduceCompilationCache, this allows client
// to only produce cache for specific scripts. scripts are appeneded to the list
// of scripts for which the cache for would produced. Disabling compilation
// cache with setProduceCompilationCache would reset all pending cache requests.
// The list may also be reset during page navigation. When script with a
// matching URL is encountered, the cache is optionally produced upon backend
// discretion, based on internal heuristics. See also:
// Page.compilationCacheProduced.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-produceCompilationCache
//
// parameters:
// scripts
func ProduceCompilationCache(scripts []*CompilationCacheParams) *ProduceCompilationCacheParams {
return &ProduceCompilationCacheParams{
Scripts: scripts,
}
}
// Do executes Page.produceCompilationCache against the provided context.
func (p *ProduceCompilationCacheParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandProduceCompilationCache, p, nil)
}
// AddCompilationCacheParams seeds compilation cache for given url.
// Compilation cache does not survive cross-process navigation.
type AddCompilationCacheParams struct {
@@ -1450,9 +1578,11 @@ const (
CommandSearchInResource = "Page.searchInResource"
CommandSetAdBlockingEnabled = "Page.setAdBlockingEnabled"
CommandSetBypassCSP = "Page.setBypassCSP"
CommandGetPermissionsPolicyState = "Page.getPermissionsPolicyState"
CommandSetFontFamilies = "Page.setFontFamilies"
CommandSetFontSizes = "Page.setFontSizes"
CommandSetDocumentContent = "Page.setDocumentContent"
CommandSetDownloadBehavior = "Page.setDownloadBehavior"
CommandSetLifecycleEventsEnabled = "Page.setLifecycleEventsEnabled"
CommandStartScreencast = "Page.startScreencast"
CommandStopLoading = "Page.stopLoading"
@@ -1461,6 +1591,7 @@ const (
CommandSetWebLifecycleState = "Page.setWebLifecycleState"
CommandStopScreencast = "Page.stopScreencast"
CommandSetProduceCompilationCache = "Page.setProduceCompilationCache"
CommandProduceCompilationCache = "Page.produceCompilationCache"
CommandAddCompilationCache = "Page.addCompilationCache"
CommandClearCompilationCache = "Page.clearCompilationCache"
CommandGenerateTestReport = "Page.generateTestReport"

View File

@@ -12,6 +12,282 @@ import (
"github.com/mailru/easyjson/jwriter"
)
// PermissionsPolicyFeature all Permissions Policy features. This enum should
// match the one defined in
// third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-PermissionsPolicyFeature
type PermissionsPolicyFeature string
// String returns the PermissionsPolicyFeature as string value.
func (t PermissionsPolicyFeature) String() string {
return string(t)
}
// PermissionsPolicyFeature values.
const (
PermissionsPolicyFeatureAccelerometer PermissionsPolicyFeature = "accelerometer"
PermissionsPolicyFeatureAmbientLightSensor PermissionsPolicyFeature = "ambient-light-sensor"
PermissionsPolicyFeatureAttributionReporting PermissionsPolicyFeature = "attribution-reporting"
PermissionsPolicyFeatureAutoplay PermissionsPolicyFeature = "autoplay"
PermissionsPolicyFeatureCamera PermissionsPolicyFeature = "camera"
PermissionsPolicyFeatureChDpr PermissionsPolicyFeature = "ch-dpr"
PermissionsPolicyFeatureChDeviceMemory PermissionsPolicyFeature = "ch-device-memory"
PermissionsPolicyFeatureChDownlink PermissionsPolicyFeature = "ch-downlink"
PermissionsPolicyFeatureChEct PermissionsPolicyFeature = "ch-ect"
PermissionsPolicyFeatureChLang PermissionsPolicyFeature = "ch-lang"
PermissionsPolicyFeatureChPrefersColorScheme PermissionsPolicyFeature = "ch-prefers-color-scheme"
PermissionsPolicyFeatureChRtt PermissionsPolicyFeature = "ch-rtt"
PermissionsPolicyFeatureChUa PermissionsPolicyFeature = "ch-ua"
PermissionsPolicyFeatureChUaArch PermissionsPolicyFeature = "ch-ua-arch"
PermissionsPolicyFeatureChUaBitness PermissionsPolicyFeature = "ch-ua-bitness"
PermissionsPolicyFeatureChUaPlatform PermissionsPolicyFeature = "ch-ua-platform"
PermissionsPolicyFeatureChUaModel PermissionsPolicyFeature = "ch-ua-model"
PermissionsPolicyFeatureChUaMobile PermissionsPolicyFeature = "ch-ua-mobile"
PermissionsPolicyFeatureChUaFullVersion PermissionsPolicyFeature = "ch-ua-full-version"
PermissionsPolicyFeatureChUaPlatformVersion PermissionsPolicyFeature = "ch-ua-platform-version"
PermissionsPolicyFeatureChViewportWidth PermissionsPolicyFeature = "ch-viewport-width"
PermissionsPolicyFeatureChWidth PermissionsPolicyFeature = "ch-width"
PermissionsPolicyFeatureClipboardRead PermissionsPolicyFeature = "clipboard-read"
PermissionsPolicyFeatureClipboardWrite PermissionsPolicyFeature = "clipboard-write"
PermissionsPolicyFeatureCrossOriginIsolated PermissionsPolicyFeature = "cross-origin-isolated"
PermissionsPolicyFeatureDirectSockets PermissionsPolicyFeature = "direct-sockets"
PermissionsPolicyFeatureDisplayCapture PermissionsPolicyFeature = "display-capture"
PermissionsPolicyFeatureDocumentDomain PermissionsPolicyFeature = "document-domain"
PermissionsPolicyFeatureEncryptedMedia PermissionsPolicyFeature = "encrypted-media"
PermissionsPolicyFeatureExecutionWhileOutOfViewport PermissionsPolicyFeature = "execution-while-out-of-viewport"
PermissionsPolicyFeatureExecutionWhileNotRendered PermissionsPolicyFeature = "execution-while-not-rendered"
PermissionsPolicyFeatureFocusWithoutUserActivation PermissionsPolicyFeature = "focus-without-user-activation"
PermissionsPolicyFeatureFullscreen PermissionsPolicyFeature = "fullscreen"
PermissionsPolicyFeatureFrobulate PermissionsPolicyFeature = "frobulate"
PermissionsPolicyFeatureGamepad PermissionsPolicyFeature = "gamepad"
PermissionsPolicyFeatureGeolocation PermissionsPolicyFeature = "geolocation"
PermissionsPolicyFeatureGyroscope PermissionsPolicyFeature = "gyroscope"
PermissionsPolicyFeatureHid PermissionsPolicyFeature = "hid"
PermissionsPolicyFeatureIdleDetection PermissionsPolicyFeature = "idle-detection"
PermissionsPolicyFeatureInterestCohort PermissionsPolicyFeature = "interest-cohort"
PermissionsPolicyFeatureMagnetometer PermissionsPolicyFeature = "magnetometer"
PermissionsPolicyFeatureMicrophone PermissionsPolicyFeature = "microphone"
PermissionsPolicyFeatureMidi PermissionsPolicyFeature = "midi"
PermissionsPolicyFeatureOtpCredentials PermissionsPolicyFeature = "otp-credentials"
PermissionsPolicyFeaturePayment PermissionsPolicyFeature = "payment"
PermissionsPolicyFeaturePictureInPicture PermissionsPolicyFeature = "picture-in-picture"
PermissionsPolicyFeaturePublickeyCredentialsGet PermissionsPolicyFeature = "publickey-credentials-get"
PermissionsPolicyFeatureScreenWakeLock PermissionsPolicyFeature = "screen-wake-lock"
PermissionsPolicyFeatureSerial PermissionsPolicyFeature = "serial"
PermissionsPolicyFeatureSharedAutofill PermissionsPolicyFeature = "shared-autofill"
PermissionsPolicyFeatureStorageAccessAPI PermissionsPolicyFeature = "storage-access-api"
PermissionsPolicyFeatureSyncXhr PermissionsPolicyFeature = "sync-xhr"
PermissionsPolicyFeatureTrustTokenRedemption PermissionsPolicyFeature = "trust-token-redemption"
PermissionsPolicyFeatureUsb PermissionsPolicyFeature = "usb"
PermissionsPolicyFeatureVerticalScroll PermissionsPolicyFeature = "vertical-scroll"
PermissionsPolicyFeatureWebShare PermissionsPolicyFeature = "web-share"
PermissionsPolicyFeatureWindowPlacement PermissionsPolicyFeature = "window-placement"
PermissionsPolicyFeatureXrSpatialTracking PermissionsPolicyFeature = "xr-spatial-tracking"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t PermissionsPolicyFeature) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t PermissionsPolicyFeature) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *PermissionsPolicyFeature) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch PermissionsPolicyFeature(in.String()) {
case PermissionsPolicyFeatureAccelerometer:
*t = PermissionsPolicyFeatureAccelerometer
case PermissionsPolicyFeatureAmbientLightSensor:
*t = PermissionsPolicyFeatureAmbientLightSensor
case PermissionsPolicyFeatureAttributionReporting:
*t = PermissionsPolicyFeatureAttributionReporting
case PermissionsPolicyFeatureAutoplay:
*t = PermissionsPolicyFeatureAutoplay
case PermissionsPolicyFeatureCamera:
*t = PermissionsPolicyFeatureCamera
case PermissionsPolicyFeatureChDpr:
*t = PermissionsPolicyFeatureChDpr
case PermissionsPolicyFeatureChDeviceMemory:
*t = PermissionsPolicyFeatureChDeviceMemory
case PermissionsPolicyFeatureChDownlink:
*t = PermissionsPolicyFeatureChDownlink
case PermissionsPolicyFeatureChEct:
*t = PermissionsPolicyFeatureChEct
case PermissionsPolicyFeatureChLang:
*t = PermissionsPolicyFeatureChLang
case PermissionsPolicyFeatureChPrefersColorScheme:
*t = PermissionsPolicyFeatureChPrefersColorScheme
case PermissionsPolicyFeatureChRtt:
*t = PermissionsPolicyFeatureChRtt
case PermissionsPolicyFeatureChUa:
*t = PermissionsPolicyFeatureChUa
case PermissionsPolicyFeatureChUaArch:
*t = PermissionsPolicyFeatureChUaArch
case PermissionsPolicyFeatureChUaBitness:
*t = PermissionsPolicyFeatureChUaBitness
case PermissionsPolicyFeatureChUaPlatform:
*t = PermissionsPolicyFeatureChUaPlatform
case PermissionsPolicyFeatureChUaModel:
*t = PermissionsPolicyFeatureChUaModel
case PermissionsPolicyFeatureChUaMobile:
*t = PermissionsPolicyFeatureChUaMobile
case PermissionsPolicyFeatureChUaFullVersion:
*t = PermissionsPolicyFeatureChUaFullVersion
case PermissionsPolicyFeatureChUaPlatformVersion:
*t = PermissionsPolicyFeatureChUaPlatformVersion
case PermissionsPolicyFeatureChViewportWidth:
*t = PermissionsPolicyFeatureChViewportWidth
case PermissionsPolicyFeatureChWidth:
*t = PermissionsPolicyFeatureChWidth
case PermissionsPolicyFeatureClipboardRead:
*t = PermissionsPolicyFeatureClipboardRead
case PermissionsPolicyFeatureClipboardWrite:
*t = PermissionsPolicyFeatureClipboardWrite
case PermissionsPolicyFeatureCrossOriginIsolated:
*t = PermissionsPolicyFeatureCrossOriginIsolated
case PermissionsPolicyFeatureDirectSockets:
*t = PermissionsPolicyFeatureDirectSockets
case PermissionsPolicyFeatureDisplayCapture:
*t = PermissionsPolicyFeatureDisplayCapture
case PermissionsPolicyFeatureDocumentDomain:
*t = PermissionsPolicyFeatureDocumentDomain
case PermissionsPolicyFeatureEncryptedMedia:
*t = PermissionsPolicyFeatureEncryptedMedia
case PermissionsPolicyFeatureExecutionWhileOutOfViewport:
*t = PermissionsPolicyFeatureExecutionWhileOutOfViewport
case PermissionsPolicyFeatureExecutionWhileNotRendered:
*t = PermissionsPolicyFeatureExecutionWhileNotRendered
case PermissionsPolicyFeatureFocusWithoutUserActivation:
*t = PermissionsPolicyFeatureFocusWithoutUserActivation
case PermissionsPolicyFeatureFullscreen:
*t = PermissionsPolicyFeatureFullscreen
case PermissionsPolicyFeatureFrobulate:
*t = PermissionsPolicyFeatureFrobulate
case PermissionsPolicyFeatureGamepad:
*t = PermissionsPolicyFeatureGamepad
case PermissionsPolicyFeatureGeolocation:
*t = PermissionsPolicyFeatureGeolocation
case PermissionsPolicyFeatureGyroscope:
*t = PermissionsPolicyFeatureGyroscope
case PermissionsPolicyFeatureHid:
*t = PermissionsPolicyFeatureHid
case PermissionsPolicyFeatureIdleDetection:
*t = PermissionsPolicyFeatureIdleDetection
case PermissionsPolicyFeatureInterestCohort:
*t = PermissionsPolicyFeatureInterestCohort
case PermissionsPolicyFeatureMagnetometer:
*t = PermissionsPolicyFeatureMagnetometer
case PermissionsPolicyFeatureMicrophone:
*t = PermissionsPolicyFeatureMicrophone
case PermissionsPolicyFeatureMidi:
*t = PermissionsPolicyFeatureMidi
case PermissionsPolicyFeatureOtpCredentials:
*t = PermissionsPolicyFeatureOtpCredentials
case PermissionsPolicyFeaturePayment:
*t = PermissionsPolicyFeaturePayment
case PermissionsPolicyFeaturePictureInPicture:
*t = PermissionsPolicyFeaturePictureInPicture
case PermissionsPolicyFeaturePublickeyCredentialsGet:
*t = PermissionsPolicyFeaturePublickeyCredentialsGet
case PermissionsPolicyFeatureScreenWakeLock:
*t = PermissionsPolicyFeatureScreenWakeLock
case PermissionsPolicyFeatureSerial:
*t = PermissionsPolicyFeatureSerial
case PermissionsPolicyFeatureSharedAutofill:
*t = PermissionsPolicyFeatureSharedAutofill
case PermissionsPolicyFeatureStorageAccessAPI:
*t = PermissionsPolicyFeatureStorageAccessAPI
case PermissionsPolicyFeatureSyncXhr:
*t = PermissionsPolicyFeatureSyncXhr
case PermissionsPolicyFeatureTrustTokenRedemption:
*t = PermissionsPolicyFeatureTrustTokenRedemption
case PermissionsPolicyFeatureUsb:
*t = PermissionsPolicyFeatureUsb
case PermissionsPolicyFeatureVerticalScroll:
*t = PermissionsPolicyFeatureVerticalScroll
case PermissionsPolicyFeatureWebShare:
*t = PermissionsPolicyFeatureWebShare
case PermissionsPolicyFeatureWindowPlacement:
*t = PermissionsPolicyFeatureWindowPlacement
case PermissionsPolicyFeatureXrSpatialTracking:
*t = PermissionsPolicyFeatureXrSpatialTracking
default:
in.AddError(errors.New("unknown PermissionsPolicyFeature value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *PermissionsPolicyFeature) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// PermissionsPolicyBlockReason reason for a permissions policy feature to be
// disabled.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-PermissionsPolicyBlockReason
type PermissionsPolicyBlockReason string
// String returns the PermissionsPolicyBlockReason as string value.
func (t PermissionsPolicyBlockReason) String() string {
return string(t)
}
// PermissionsPolicyBlockReason values.
const (
PermissionsPolicyBlockReasonHeader PermissionsPolicyBlockReason = "Header"
PermissionsPolicyBlockReasonIframeAttribute PermissionsPolicyBlockReason = "IframeAttribute"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t PermissionsPolicyBlockReason) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t PermissionsPolicyBlockReason) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *PermissionsPolicyBlockReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch PermissionsPolicyBlockReason(in.String()) {
case PermissionsPolicyBlockReasonHeader:
*t = PermissionsPolicyBlockReasonHeader
case PermissionsPolicyBlockReasonIframeAttribute:
*t = PermissionsPolicyBlockReasonIframeAttribute
default:
in.AddError(errors.New("unknown PermissionsPolicyBlockReason value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *PermissionsPolicyBlockReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// PermissionsPolicyBlockLocator [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-PermissionsPolicyBlockLocator
type PermissionsPolicyBlockLocator struct {
FrameID cdp.FrameID `json:"frameId"`
BlockReason PermissionsPolicyBlockReason `json:"blockReason"`
}
// PermissionsPolicyFeatureState [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-PermissionsPolicyFeatureState
type PermissionsPolicyFeatureState struct {
Feature PermissionsPolicyFeature `json:"feature"`
Allowed bool `json:"allowed"`
Locator *PermissionsPolicyBlockLocator `json:"locator,omitempty"`
}
// FrameResource information about the Resource on the page.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-FrameResource
@@ -467,6 +743,433 @@ func (t *ReferrerPolicy) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CompilationCacheParams per-script compilation cache parameters for
// Page.produceCompilationCache.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-CompilationCacheParams
type CompilationCacheParams struct {
URL string `json:"url"` // The URL of the script to produce a compilation cache entry for.
Eager bool `json:"eager,omitempty"` // A hint to the backend whether eager compilation is recommended. (the actual compilation mode used is upon backend discretion).
}
// NavigationType the type of a frameNavigated event.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-NavigationType
type NavigationType string
// String returns the NavigationType as string value.
func (t NavigationType) String() string {
return string(t)
}
// NavigationType values.
const (
NavigationTypeNavigation NavigationType = "Navigation"
NavigationTypeBackForwardCacheRestore NavigationType = "BackForwardCacheRestore"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t NavigationType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t NavigationType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *NavigationType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch NavigationType(in.String()) {
case NavigationTypeNavigation:
*t = NavigationTypeNavigation
case NavigationTypeBackForwardCacheRestore:
*t = NavigationTypeBackForwardCacheRestore
default:
in.AddError(errors.New("unknown NavigationType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *NavigationType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// BackForwardCacheNotRestoredReason list of not restored reasons for
// back-forward cache.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-BackForwardCacheNotRestoredReason
type BackForwardCacheNotRestoredReason string
// String returns the BackForwardCacheNotRestoredReason as string value.
func (t BackForwardCacheNotRestoredReason) String() string {
return string(t)
}
// BackForwardCacheNotRestoredReason values.
const (
BackForwardCacheNotRestoredReasonNotMainFrame BackForwardCacheNotRestoredReason = "NotMainFrame"
BackForwardCacheNotRestoredReasonBackForwardCacheDisabled BackForwardCacheNotRestoredReason = "BackForwardCacheDisabled"
BackForwardCacheNotRestoredReasonRelatedActiveContentsExist BackForwardCacheNotRestoredReason = "RelatedActiveContentsExist"
BackForwardCacheNotRestoredReasonHTTPSTatusNotOK BackForwardCacheNotRestoredReason = "HTTPStatusNotOK"
BackForwardCacheNotRestoredReasonSchemeNotHTTPOrHTTPS BackForwardCacheNotRestoredReason = "SchemeNotHTTPOrHTTPS"
BackForwardCacheNotRestoredReasonLoading BackForwardCacheNotRestoredReason = "Loading"
BackForwardCacheNotRestoredReasonWasGrantedMediaAccess BackForwardCacheNotRestoredReason = "WasGrantedMediaAccess"
BackForwardCacheNotRestoredReasonDisableForRenderFrameHostCalled BackForwardCacheNotRestoredReason = "DisableForRenderFrameHostCalled"
BackForwardCacheNotRestoredReasonDomainNotAllowed BackForwardCacheNotRestoredReason = "DomainNotAllowed"
BackForwardCacheNotRestoredReasonHTTPMethodNotGET BackForwardCacheNotRestoredReason = "HTTPMethodNotGET"
BackForwardCacheNotRestoredReasonSubframeIsNavigating BackForwardCacheNotRestoredReason = "SubframeIsNavigating"
BackForwardCacheNotRestoredReasonTimeout BackForwardCacheNotRestoredReason = "Timeout"
BackForwardCacheNotRestoredReasonCacheLimit BackForwardCacheNotRestoredReason = "CacheLimit"
BackForwardCacheNotRestoredReasonJavaScriptExecution BackForwardCacheNotRestoredReason = "JavaScriptExecution"
BackForwardCacheNotRestoredReasonRendererProcessKilled BackForwardCacheNotRestoredReason = "RendererProcessKilled"
BackForwardCacheNotRestoredReasonRendererProcessCrashed BackForwardCacheNotRestoredReason = "RendererProcessCrashed"
BackForwardCacheNotRestoredReasonGrantedMediaStreamAccess BackForwardCacheNotRestoredReason = "GrantedMediaStreamAccess"
BackForwardCacheNotRestoredReasonSchedulerTrackedFeatureUsed BackForwardCacheNotRestoredReason = "SchedulerTrackedFeatureUsed"
BackForwardCacheNotRestoredReasonConflictingBrowsingInstance BackForwardCacheNotRestoredReason = "ConflictingBrowsingInstance"
BackForwardCacheNotRestoredReasonCacheFlushed BackForwardCacheNotRestoredReason = "CacheFlushed"
BackForwardCacheNotRestoredReasonServiceWorkerVersionActivation BackForwardCacheNotRestoredReason = "ServiceWorkerVersionActivation"
BackForwardCacheNotRestoredReasonSessionRestored BackForwardCacheNotRestoredReason = "SessionRestored"
BackForwardCacheNotRestoredReasonServiceWorkerPostMessage BackForwardCacheNotRestoredReason = "ServiceWorkerPostMessage"
BackForwardCacheNotRestoredReasonEnteredBackForwardCacheBeforeServiceWorkerHostAdded BackForwardCacheNotRestoredReason = "EnteredBackForwardCacheBeforeServiceWorkerHostAdded"
BackForwardCacheNotRestoredReasonRenderFrameHostReusedSameSite BackForwardCacheNotRestoredReason = "RenderFrameHostReused_SameSite"
BackForwardCacheNotRestoredReasonRenderFrameHostReusedCrossSite BackForwardCacheNotRestoredReason = "RenderFrameHostReused_CrossSite"
BackForwardCacheNotRestoredReasonServiceWorkerClaim BackForwardCacheNotRestoredReason = "ServiceWorkerClaim"
BackForwardCacheNotRestoredReasonIgnoreEventAndEvict BackForwardCacheNotRestoredReason = "IgnoreEventAndEvict"
BackForwardCacheNotRestoredReasonHaveInnerContents BackForwardCacheNotRestoredReason = "HaveInnerContents"
BackForwardCacheNotRestoredReasonTimeoutPuttingInCache BackForwardCacheNotRestoredReason = "TimeoutPuttingInCache"
BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByLowMemory BackForwardCacheNotRestoredReason = "BackForwardCacheDisabledByLowMemory"
BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByCommandLine BackForwardCacheNotRestoredReason = "BackForwardCacheDisabledByCommandLine"
BackForwardCacheNotRestoredReasonNetworkRequestDatapipeDrainedAsBytesConsumer BackForwardCacheNotRestoredReason = "NetworkRequestDatapipeDrainedAsBytesConsumer"
BackForwardCacheNotRestoredReasonNetworkRequestRedirected BackForwardCacheNotRestoredReason = "NetworkRequestRedirected"
BackForwardCacheNotRestoredReasonNetworkRequestTimeout BackForwardCacheNotRestoredReason = "NetworkRequestTimeout"
BackForwardCacheNotRestoredReasonNetworkExceedsBufferLimit BackForwardCacheNotRestoredReason = "NetworkExceedsBufferLimit"
BackForwardCacheNotRestoredReasonNavigationCancelledWhileRestoring BackForwardCacheNotRestoredReason = "NavigationCancelledWhileRestoring"
BackForwardCacheNotRestoredReasonNotMostRecentNavigationEntry BackForwardCacheNotRestoredReason = "NotMostRecentNavigationEntry"
BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForPrerender BackForwardCacheNotRestoredReason = "BackForwardCacheDisabledForPrerender"
BackForwardCacheNotRestoredReasonUserAgentOverrideDiffers BackForwardCacheNotRestoredReason = "UserAgentOverrideDiffers"
BackForwardCacheNotRestoredReasonForegroundCacheLimit BackForwardCacheNotRestoredReason = "ForegroundCacheLimit"
BackForwardCacheNotRestoredReasonBrowsingInstanceNotSwapped BackForwardCacheNotRestoredReason = "BrowsingInstanceNotSwapped"
BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForDelegate BackForwardCacheNotRestoredReason = "BackForwardCacheDisabledForDelegate"
BackForwardCacheNotRestoredReasonOptInUnloadHeaderNotPresent BackForwardCacheNotRestoredReason = "OptInUnloadHeaderNotPresent"
BackForwardCacheNotRestoredReasonUnloadHandlerExistsInMainFrame BackForwardCacheNotRestoredReason = "UnloadHandlerExistsInMainFrame"
BackForwardCacheNotRestoredReasonUnloadHandlerExistsInSubFrame BackForwardCacheNotRestoredReason = "UnloadHandlerExistsInSubFrame"
BackForwardCacheNotRestoredReasonServiceWorkerUnregistration BackForwardCacheNotRestoredReason = "ServiceWorkerUnregistration"
BackForwardCacheNotRestoredReasonWebSocket BackForwardCacheNotRestoredReason = "WebSocket"
BackForwardCacheNotRestoredReasonWebRTC BackForwardCacheNotRestoredReason = "WebRTC"
BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoStore BackForwardCacheNotRestoredReason = "MainResourceHasCacheControlNoStore"
BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoCache BackForwardCacheNotRestoredReason = "MainResourceHasCacheControlNoCache"
BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoStore BackForwardCacheNotRestoredReason = "SubresourceHasCacheControlNoStore"
BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoCache BackForwardCacheNotRestoredReason = "SubresourceHasCacheControlNoCache"
BackForwardCacheNotRestoredReasonContainsPlugins BackForwardCacheNotRestoredReason = "ContainsPlugins"
BackForwardCacheNotRestoredReasonDocumentLoaded BackForwardCacheNotRestoredReason = "DocumentLoaded"
BackForwardCacheNotRestoredReasonDedicatedWorkerOrWorklet BackForwardCacheNotRestoredReason = "DedicatedWorkerOrWorklet"
BackForwardCacheNotRestoredReasonOutstandingNetworkRequestOthers BackForwardCacheNotRestoredReason = "OutstandingNetworkRequestOthers"
BackForwardCacheNotRestoredReasonOutstandingIndexedDBTransaction BackForwardCacheNotRestoredReason = "OutstandingIndexedDBTransaction"
BackForwardCacheNotRestoredReasonRequestedGeolocationPermission BackForwardCacheNotRestoredReason = "RequestedGeolocationPermission"
BackForwardCacheNotRestoredReasonRequestedNotificationsPermission BackForwardCacheNotRestoredReason = "RequestedNotificationsPermission"
BackForwardCacheNotRestoredReasonRequestedMIDIPermission BackForwardCacheNotRestoredReason = "RequestedMIDIPermission"
BackForwardCacheNotRestoredReasonRequestedAudioCapturePermission BackForwardCacheNotRestoredReason = "RequestedAudioCapturePermission"
BackForwardCacheNotRestoredReasonRequestedVideoCapturePermission BackForwardCacheNotRestoredReason = "RequestedVideoCapturePermission"
BackForwardCacheNotRestoredReasonRequestedBackForwardCacheBlockedSensors BackForwardCacheNotRestoredReason = "RequestedBackForwardCacheBlockedSensors"
BackForwardCacheNotRestoredReasonRequestedBackgroundWorkPermission BackForwardCacheNotRestoredReason = "RequestedBackgroundWorkPermission"
BackForwardCacheNotRestoredReasonBroadcastChannel BackForwardCacheNotRestoredReason = "BroadcastChannel"
BackForwardCacheNotRestoredReasonIndexedDBConnection BackForwardCacheNotRestoredReason = "IndexedDBConnection"
BackForwardCacheNotRestoredReasonWebXR BackForwardCacheNotRestoredReason = "WebXR"
BackForwardCacheNotRestoredReasonSharedWorker BackForwardCacheNotRestoredReason = "SharedWorker"
BackForwardCacheNotRestoredReasonWebLocks BackForwardCacheNotRestoredReason = "WebLocks"
BackForwardCacheNotRestoredReasonWebHID BackForwardCacheNotRestoredReason = "WebHID"
BackForwardCacheNotRestoredReasonWebShare BackForwardCacheNotRestoredReason = "WebShare"
BackForwardCacheNotRestoredReasonRequestedStorageAccessGrant BackForwardCacheNotRestoredReason = "RequestedStorageAccessGrant"
BackForwardCacheNotRestoredReasonWebNfc BackForwardCacheNotRestoredReason = "WebNfc"
BackForwardCacheNotRestoredReasonWebFileSystem BackForwardCacheNotRestoredReason = "WebFileSystem"
BackForwardCacheNotRestoredReasonOutstandingNetworkRequestFetch BackForwardCacheNotRestoredReason = "OutstandingNetworkRequestFetch"
BackForwardCacheNotRestoredReasonOutstandingNetworkRequestXHR BackForwardCacheNotRestoredReason = "OutstandingNetworkRequestXHR"
BackForwardCacheNotRestoredReasonAppBanner BackForwardCacheNotRestoredReason = "AppBanner"
BackForwardCacheNotRestoredReasonPrinting BackForwardCacheNotRestoredReason = "Printing"
BackForwardCacheNotRestoredReasonWebDatabase BackForwardCacheNotRestoredReason = "WebDatabase"
BackForwardCacheNotRestoredReasonPictureInPicture BackForwardCacheNotRestoredReason = "PictureInPicture"
BackForwardCacheNotRestoredReasonPortal BackForwardCacheNotRestoredReason = "Portal"
BackForwardCacheNotRestoredReasonSpeechRecognizer BackForwardCacheNotRestoredReason = "SpeechRecognizer"
BackForwardCacheNotRestoredReasonIdleManager BackForwardCacheNotRestoredReason = "IdleManager"
BackForwardCacheNotRestoredReasonPaymentManager BackForwardCacheNotRestoredReason = "PaymentManager"
BackForwardCacheNotRestoredReasonSpeechSynthesis BackForwardCacheNotRestoredReason = "SpeechSynthesis"
BackForwardCacheNotRestoredReasonKeyboardLock BackForwardCacheNotRestoredReason = "KeyboardLock"
BackForwardCacheNotRestoredReasonWebOTPService BackForwardCacheNotRestoredReason = "WebOTPService"
BackForwardCacheNotRestoredReasonOutstandingNetworkRequestDirectSocket BackForwardCacheNotRestoredReason = "OutstandingNetworkRequestDirectSocket"
BackForwardCacheNotRestoredReasonIsolatedWorldScript BackForwardCacheNotRestoredReason = "IsolatedWorldScript"
BackForwardCacheNotRestoredReasonInjectedStyleSheet BackForwardCacheNotRestoredReason = "InjectedStyleSheet"
BackForwardCacheNotRestoredReasonMediaSessionImplOnServiceCreated BackForwardCacheNotRestoredReason = "MediaSessionImplOnServiceCreated"
BackForwardCacheNotRestoredReasonUnknown BackForwardCacheNotRestoredReason = "Unknown"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t BackForwardCacheNotRestoredReason) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t BackForwardCacheNotRestoredReason) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *BackForwardCacheNotRestoredReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch BackForwardCacheNotRestoredReason(in.String()) {
case BackForwardCacheNotRestoredReasonNotMainFrame:
*t = BackForwardCacheNotRestoredReasonNotMainFrame
case BackForwardCacheNotRestoredReasonBackForwardCacheDisabled:
*t = BackForwardCacheNotRestoredReasonBackForwardCacheDisabled
case BackForwardCacheNotRestoredReasonRelatedActiveContentsExist:
*t = BackForwardCacheNotRestoredReasonRelatedActiveContentsExist
case BackForwardCacheNotRestoredReasonHTTPSTatusNotOK:
*t = BackForwardCacheNotRestoredReasonHTTPSTatusNotOK
case BackForwardCacheNotRestoredReasonSchemeNotHTTPOrHTTPS:
*t = BackForwardCacheNotRestoredReasonSchemeNotHTTPOrHTTPS
case BackForwardCacheNotRestoredReasonLoading:
*t = BackForwardCacheNotRestoredReasonLoading
case BackForwardCacheNotRestoredReasonWasGrantedMediaAccess:
*t = BackForwardCacheNotRestoredReasonWasGrantedMediaAccess
case BackForwardCacheNotRestoredReasonDisableForRenderFrameHostCalled:
*t = BackForwardCacheNotRestoredReasonDisableForRenderFrameHostCalled
case BackForwardCacheNotRestoredReasonDomainNotAllowed:
*t = BackForwardCacheNotRestoredReasonDomainNotAllowed
case BackForwardCacheNotRestoredReasonHTTPMethodNotGET:
*t = BackForwardCacheNotRestoredReasonHTTPMethodNotGET
case BackForwardCacheNotRestoredReasonSubframeIsNavigating:
*t = BackForwardCacheNotRestoredReasonSubframeIsNavigating
case BackForwardCacheNotRestoredReasonTimeout:
*t = BackForwardCacheNotRestoredReasonTimeout
case BackForwardCacheNotRestoredReasonCacheLimit:
*t = BackForwardCacheNotRestoredReasonCacheLimit
case BackForwardCacheNotRestoredReasonJavaScriptExecution:
*t = BackForwardCacheNotRestoredReasonJavaScriptExecution
case BackForwardCacheNotRestoredReasonRendererProcessKilled:
*t = BackForwardCacheNotRestoredReasonRendererProcessKilled
case BackForwardCacheNotRestoredReasonRendererProcessCrashed:
*t = BackForwardCacheNotRestoredReasonRendererProcessCrashed
case BackForwardCacheNotRestoredReasonGrantedMediaStreamAccess:
*t = BackForwardCacheNotRestoredReasonGrantedMediaStreamAccess
case BackForwardCacheNotRestoredReasonSchedulerTrackedFeatureUsed:
*t = BackForwardCacheNotRestoredReasonSchedulerTrackedFeatureUsed
case BackForwardCacheNotRestoredReasonConflictingBrowsingInstance:
*t = BackForwardCacheNotRestoredReasonConflictingBrowsingInstance
case BackForwardCacheNotRestoredReasonCacheFlushed:
*t = BackForwardCacheNotRestoredReasonCacheFlushed
case BackForwardCacheNotRestoredReasonServiceWorkerVersionActivation:
*t = BackForwardCacheNotRestoredReasonServiceWorkerVersionActivation
case BackForwardCacheNotRestoredReasonSessionRestored:
*t = BackForwardCacheNotRestoredReasonSessionRestored
case BackForwardCacheNotRestoredReasonServiceWorkerPostMessage:
*t = BackForwardCacheNotRestoredReasonServiceWorkerPostMessage
case BackForwardCacheNotRestoredReasonEnteredBackForwardCacheBeforeServiceWorkerHostAdded:
*t = BackForwardCacheNotRestoredReasonEnteredBackForwardCacheBeforeServiceWorkerHostAdded
case BackForwardCacheNotRestoredReasonRenderFrameHostReusedSameSite:
*t = BackForwardCacheNotRestoredReasonRenderFrameHostReusedSameSite
case BackForwardCacheNotRestoredReasonRenderFrameHostReusedCrossSite:
*t = BackForwardCacheNotRestoredReasonRenderFrameHostReusedCrossSite
case BackForwardCacheNotRestoredReasonServiceWorkerClaim:
*t = BackForwardCacheNotRestoredReasonServiceWorkerClaim
case BackForwardCacheNotRestoredReasonIgnoreEventAndEvict:
*t = BackForwardCacheNotRestoredReasonIgnoreEventAndEvict
case BackForwardCacheNotRestoredReasonHaveInnerContents:
*t = BackForwardCacheNotRestoredReasonHaveInnerContents
case BackForwardCacheNotRestoredReasonTimeoutPuttingInCache:
*t = BackForwardCacheNotRestoredReasonTimeoutPuttingInCache
case BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByLowMemory:
*t = BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByLowMemory
case BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByCommandLine:
*t = BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByCommandLine
case BackForwardCacheNotRestoredReasonNetworkRequestDatapipeDrainedAsBytesConsumer:
*t = BackForwardCacheNotRestoredReasonNetworkRequestDatapipeDrainedAsBytesConsumer
case BackForwardCacheNotRestoredReasonNetworkRequestRedirected:
*t = BackForwardCacheNotRestoredReasonNetworkRequestRedirected
case BackForwardCacheNotRestoredReasonNetworkRequestTimeout:
*t = BackForwardCacheNotRestoredReasonNetworkRequestTimeout
case BackForwardCacheNotRestoredReasonNetworkExceedsBufferLimit:
*t = BackForwardCacheNotRestoredReasonNetworkExceedsBufferLimit
case BackForwardCacheNotRestoredReasonNavigationCancelledWhileRestoring:
*t = BackForwardCacheNotRestoredReasonNavigationCancelledWhileRestoring
case BackForwardCacheNotRestoredReasonNotMostRecentNavigationEntry:
*t = BackForwardCacheNotRestoredReasonNotMostRecentNavigationEntry
case BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForPrerender:
*t = BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForPrerender
case BackForwardCacheNotRestoredReasonUserAgentOverrideDiffers:
*t = BackForwardCacheNotRestoredReasonUserAgentOverrideDiffers
case BackForwardCacheNotRestoredReasonForegroundCacheLimit:
*t = BackForwardCacheNotRestoredReasonForegroundCacheLimit
case BackForwardCacheNotRestoredReasonBrowsingInstanceNotSwapped:
*t = BackForwardCacheNotRestoredReasonBrowsingInstanceNotSwapped
case BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForDelegate:
*t = BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForDelegate
case BackForwardCacheNotRestoredReasonOptInUnloadHeaderNotPresent:
*t = BackForwardCacheNotRestoredReasonOptInUnloadHeaderNotPresent
case BackForwardCacheNotRestoredReasonUnloadHandlerExistsInMainFrame:
*t = BackForwardCacheNotRestoredReasonUnloadHandlerExistsInMainFrame
case BackForwardCacheNotRestoredReasonUnloadHandlerExistsInSubFrame:
*t = BackForwardCacheNotRestoredReasonUnloadHandlerExistsInSubFrame
case BackForwardCacheNotRestoredReasonServiceWorkerUnregistration:
*t = BackForwardCacheNotRestoredReasonServiceWorkerUnregistration
case BackForwardCacheNotRestoredReasonWebSocket:
*t = BackForwardCacheNotRestoredReasonWebSocket
case BackForwardCacheNotRestoredReasonWebRTC:
*t = BackForwardCacheNotRestoredReasonWebRTC
case BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoStore:
*t = BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoStore
case BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoCache:
*t = BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoCache
case BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoStore:
*t = BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoStore
case BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoCache:
*t = BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoCache
case BackForwardCacheNotRestoredReasonContainsPlugins:
*t = BackForwardCacheNotRestoredReasonContainsPlugins
case BackForwardCacheNotRestoredReasonDocumentLoaded:
*t = BackForwardCacheNotRestoredReasonDocumentLoaded
case BackForwardCacheNotRestoredReasonDedicatedWorkerOrWorklet:
*t = BackForwardCacheNotRestoredReasonDedicatedWorkerOrWorklet
case BackForwardCacheNotRestoredReasonOutstandingNetworkRequestOthers:
*t = BackForwardCacheNotRestoredReasonOutstandingNetworkRequestOthers
case BackForwardCacheNotRestoredReasonOutstandingIndexedDBTransaction:
*t = BackForwardCacheNotRestoredReasonOutstandingIndexedDBTransaction
case BackForwardCacheNotRestoredReasonRequestedGeolocationPermission:
*t = BackForwardCacheNotRestoredReasonRequestedGeolocationPermission
case BackForwardCacheNotRestoredReasonRequestedNotificationsPermission:
*t = BackForwardCacheNotRestoredReasonRequestedNotificationsPermission
case BackForwardCacheNotRestoredReasonRequestedMIDIPermission:
*t = BackForwardCacheNotRestoredReasonRequestedMIDIPermission
case BackForwardCacheNotRestoredReasonRequestedAudioCapturePermission:
*t = BackForwardCacheNotRestoredReasonRequestedAudioCapturePermission
case BackForwardCacheNotRestoredReasonRequestedVideoCapturePermission:
*t = BackForwardCacheNotRestoredReasonRequestedVideoCapturePermission
case BackForwardCacheNotRestoredReasonRequestedBackForwardCacheBlockedSensors:
*t = BackForwardCacheNotRestoredReasonRequestedBackForwardCacheBlockedSensors
case BackForwardCacheNotRestoredReasonRequestedBackgroundWorkPermission:
*t = BackForwardCacheNotRestoredReasonRequestedBackgroundWorkPermission
case BackForwardCacheNotRestoredReasonBroadcastChannel:
*t = BackForwardCacheNotRestoredReasonBroadcastChannel
case BackForwardCacheNotRestoredReasonIndexedDBConnection:
*t = BackForwardCacheNotRestoredReasonIndexedDBConnection
case BackForwardCacheNotRestoredReasonWebXR:
*t = BackForwardCacheNotRestoredReasonWebXR
case BackForwardCacheNotRestoredReasonSharedWorker:
*t = BackForwardCacheNotRestoredReasonSharedWorker
case BackForwardCacheNotRestoredReasonWebLocks:
*t = BackForwardCacheNotRestoredReasonWebLocks
case BackForwardCacheNotRestoredReasonWebHID:
*t = BackForwardCacheNotRestoredReasonWebHID
case BackForwardCacheNotRestoredReasonWebShare:
*t = BackForwardCacheNotRestoredReasonWebShare
case BackForwardCacheNotRestoredReasonRequestedStorageAccessGrant:
*t = BackForwardCacheNotRestoredReasonRequestedStorageAccessGrant
case BackForwardCacheNotRestoredReasonWebNfc:
*t = BackForwardCacheNotRestoredReasonWebNfc
case BackForwardCacheNotRestoredReasonWebFileSystem:
*t = BackForwardCacheNotRestoredReasonWebFileSystem
case BackForwardCacheNotRestoredReasonOutstandingNetworkRequestFetch:
*t = BackForwardCacheNotRestoredReasonOutstandingNetworkRequestFetch
case BackForwardCacheNotRestoredReasonOutstandingNetworkRequestXHR:
*t = BackForwardCacheNotRestoredReasonOutstandingNetworkRequestXHR
case BackForwardCacheNotRestoredReasonAppBanner:
*t = BackForwardCacheNotRestoredReasonAppBanner
case BackForwardCacheNotRestoredReasonPrinting:
*t = BackForwardCacheNotRestoredReasonPrinting
case BackForwardCacheNotRestoredReasonWebDatabase:
*t = BackForwardCacheNotRestoredReasonWebDatabase
case BackForwardCacheNotRestoredReasonPictureInPicture:
*t = BackForwardCacheNotRestoredReasonPictureInPicture
case BackForwardCacheNotRestoredReasonPortal:
*t = BackForwardCacheNotRestoredReasonPortal
case BackForwardCacheNotRestoredReasonSpeechRecognizer:
*t = BackForwardCacheNotRestoredReasonSpeechRecognizer
case BackForwardCacheNotRestoredReasonIdleManager:
*t = BackForwardCacheNotRestoredReasonIdleManager
case BackForwardCacheNotRestoredReasonPaymentManager:
*t = BackForwardCacheNotRestoredReasonPaymentManager
case BackForwardCacheNotRestoredReasonSpeechSynthesis:
*t = BackForwardCacheNotRestoredReasonSpeechSynthesis
case BackForwardCacheNotRestoredReasonKeyboardLock:
*t = BackForwardCacheNotRestoredReasonKeyboardLock
case BackForwardCacheNotRestoredReasonWebOTPService:
*t = BackForwardCacheNotRestoredReasonWebOTPService
case BackForwardCacheNotRestoredReasonOutstandingNetworkRequestDirectSocket:
*t = BackForwardCacheNotRestoredReasonOutstandingNetworkRequestDirectSocket
case BackForwardCacheNotRestoredReasonIsolatedWorldScript:
*t = BackForwardCacheNotRestoredReasonIsolatedWorldScript
case BackForwardCacheNotRestoredReasonInjectedStyleSheet:
*t = BackForwardCacheNotRestoredReasonInjectedStyleSheet
case BackForwardCacheNotRestoredReasonMediaSessionImplOnServiceCreated:
*t = BackForwardCacheNotRestoredReasonMediaSessionImplOnServiceCreated
case BackForwardCacheNotRestoredReasonUnknown:
*t = BackForwardCacheNotRestoredReasonUnknown
default:
in.AddError(errors.New("unknown BackForwardCacheNotRestoredReason value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *BackForwardCacheNotRestoredReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// BackForwardCacheNotRestoredReasonType types of not restored reasons for
// back-forward cache.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-BackForwardCacheNotRestoredReasonType
type BackForwardCacheNotRestoredReasonType string
// String returns the BackForwardCacheNotRestoredReasonType as string value.
func (t BackForwardCacheNotRestoredReasonType) String() string {
return string(t)
}
// BackForwardCacheNotRestoredReasonType values.
const (
BackForwardCacheNotRestoredReasonTypeSupportPending BackForwardCacheNotRestoredReasonType = "SupportPending"
BackForwardCacheNotRestoredReasonTypePageSupportNeeded BackForwardCacheNotRestoredReasonType = "PageSupportNeeded"
BackForwardCacheNotRestoredReasonTypeCircumstantial BackForwardCacheNotRestoredReasonType = "Circumstantial"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t BackForwardCacheNotRestoredReasonType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t BackForwardCacheNotRestoredReasonType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *BackForwardCacheNotRestoredReasonType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch BackForwardCacheNotRestoredReasonType(in.String()) {
case BackForwardCacheNotRestoredReasonTypeSupportPending:
*t = BackForwardCacheNotRestoredReasonTypeSupportPending
case BackForwardCacheNotRestoredReasonTypePageSupportNeeded:
*t = BackForwardCacheNotRestoredReasonTypePageSupportNeeded
case BackForwardCacheNotRestoredReasonTypeCircumstantial:
*t = BackForwardCacheNotRestoredReasonTypeCircumstantial
default:
in.AddError(errors.New("unknown BackForwardCacheNotRestoredReasonType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *BackForwardCacheNotRestoredReasonType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// BackForwardCacheNotRestoredExplanation [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-BackForwardCacheNotRestoredExplanation
type BackForwardCacheNotRestoredExplanation struct {
Type BackForwardCacheNotRestoredReasonType `json:"type"` // Type of the reason
Reason BackForwardCacheNotRestoredReason `json:"reason"` // Not restored reason
}
// FileChooserOpenedMode input mode.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-fileChooserOpened
@@ -511,50 +1214,47 @@ func (t *FileChooserOpenedMode) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// DownloadProgressState download status.
// FrameDetachedReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-downloadProgress
type DownloadProgressState string
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameDetached
type FrameDetachedReason string
// String returns the DownloadProgressState as string value.
func (t DownloadProgressState) String() string {
// String returns the FrameDetachedReason as string value.
func (t FrameDetachedReason) String() string {
return string(t)
}
// DownloadProgressState values.
// FrameDetachedReason values.
const (
DownloadProgressStateInProgress DownloadProgressState = "inProgress"
DownloadProgressStateCompleted DownloadProgressState = "completed"
DownloadProgressStateCanceled DownloadProgressState = "canceled"
FrameDetachedReasonRemove FrameDetachedReason = "remove"
FrameDetachedReasonSwap FrameDetachedReason = "swap"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t DownloadProgressState) MarshalEasyJSON(out *jwriter.Writer) {
func (t FrameDetachedReason) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t DownloadProgressState) MarshalJSON() ([]byte, error) {
func (t FrameDetachedReason) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *DownloadProgressState) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch DownloadProgressState(in.String()) {
case DownloadProgressStateInProgress:
*t = DownloadProgressStateInProgress
case DownloadProgressStateCompleted:
*t = DownloadProgressStateCompleted
case DownloadProgressStateCanceled:
*t = DownloadProgressStateCanceled
func (t *FrameDetachedReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch FrameDetachedReason(in.String()) {
case FrameDetachedReasonRemove:
*t = FrameDetachedReasonRemove
case FrameDetachedReasonSwap:
*t = FrameDetachedReasonSwap
default:
in.AddError(errors.New("unknown DownloadProgressState value"))
in.AddError(errors.New("unknown FrameDetachedReason value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *DownloadProgressState) UnmarshalJSON(buf []byte) error {
func (t *FrameDetachedReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
@@ -572,6 +1272,7 @@ func (t CaptureScreenshotFormat) String() string {
const (
CaptureScreenshotFormatJpeg CaptureScreenshotFormat = "jpeg"
CaptureScreenshotFormatPng CaptureScreenshotFormat = "png"
CaptureScreenshotFormatWebp CaptureScreenshotFormat = "webp"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -591,6 +1292,8 @@ func (t *CaptureScreenshotFormat) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CaptureScreenshotFormatJpeg
case CaptureScreenshotFormatPng:
*t = CaptureScreenshotFormatPng
case CaptureScreenshotFormatWebp:
*t = CaptureScreenshotFormatWebp
default:
in.AddError(errors.New("unknown CaptureScreenshotFormat value"))
@@ -687,6 +1390,54 @@ func (t *PrintToPDFTransferMode) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// SetDownloadBehaviorBehavior whether to allow all or deny all download
// requests, or use default Chrome behavior if available (otherwise deny).
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setDownloadBehavior
type SetDownloadBehaviorBehavior string
// String returns the SetDownloadBehaviorBehavior as string value.
func (t SetDownloadBehaviorBehavior) String() string {
return string(t)
}
// SetDownloadBehaviorBehavior values.
const (
SetDownloadBehaviorBehaviorDeny SetDownloadBehaviorBehavior = "deny"
SetDownloadBehaviorBehaviorAllow SetDownloadBehaviorBehavior = "allow"
SetDownloadBehaviorBehaviorDefault SetDownloadBehaviorBehavior = "default"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t SetDownloadBehaviorBehavior) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t SetDownloadBehaviorBehavior) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *SetDownloadBehaviorBehavior) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch SetDownloadBehaviorBehavior(in.String()) {
case SetDownloadBehaviorBehaviorDeny:
*t = SetDownloadBehaviorBehaviorDeny
case SetDownloadBehaviorBehaviorAllow:
*t = SetDownloadBehaviorBehaviorAllow
case SetDownloadBehaviorBehaviorDefault:
*t = SetDownloadBehaviorBehaviorDefault
default:
in.AddError(errors.New("unknown SetDownloadBehaviorBehavior value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *SetDownloadBehaviorBehavior) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// ScreencastFormat image compression format.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-startScreencast

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -101,7 +101,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance1(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -210,7 +210,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance2(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -269,7 +269,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance3(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -386,7 +386,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance4(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -453,7 +453,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance5(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -0,0 +1,705 @@
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
package performancetimeline
import (
json "encoding/json"
cdp "github.com/chromedp/cdproto/cdp"
dom "github.com/chromedp/cdproto/dom"
easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
)
// suppress unused package warning
var (
_ *json.RawMessage
_ *jlexer.Lexer
_ *jwriter.Writer
_ easyjson.Marshaler
)
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline(in *jlexer.Lexer, out *TimelineEvent) {
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 "frameId":
(out.FrameID).UnmarshalEasyJSON(in)
case "type":
out.Type = string(in.String())
case "name":
out.Name = string(in.String())
case "time":
if in.IsNull() {
in.Skip()
out.Time = nil
} else {
if out.Time == nil {
out.Time = new(cdp.TimeSinceEpoch)
}
(*out.Time).UnmarshalEasyJSON(in)
}
case "duration":
out.Duration = float64(in.Float64())
case "lcpDetails":
if in.IsNull() {
in.Skip()
out.LcpDetails = nil
} else {
if out.LcpDetails == nil {
out.LcpDetails = new(LargestContentfulPaint)
}
(*out.LcpDetails).UnmarshalEasyJSON(in)
}
case "layoutShiftDetails":
if in.IsNull() {
in.Skip()
out.LayoutShiftDetails = nil
} else {
if out.LayoutShiftDetails == nil {
out.LayoutShiftDetails = new(LayoutShift)
}
(*out.LayoutShiftDetails).UnmarshalEasyJSON(in)
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline(out *jwriter.Writer, in TimelineEvent) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"frameId\":"
out.RawString(prefix[1:])
out.String(string(in.FrameID))
}
{
const prefix string = ",\"type\":"
out.RawString(prefix)
out.String(string(in.Type))
}
{
const prefix string = ",\"name\":"
out.RawString(prefix)
out.String(string(in.Name))
}
{
const prefix string = ",\"time\":"
out.RawString(prefix)
if in.Time == nil {
out.RawString("null")
} else {
(*in.Time).MarshalEasyJSON(out)
}
}
if in.Duration != 0 {
const prefix string = ",\"duration\":"
out.RawString(prefix)
out.Float64(float64(in.Duration))
}
if in.LcpDetails != nil {
const prefix string = ",\"lcpDetails\":"
out.RawString(prefix)
(*in.LcpDetails).MarshalEasyJSON(out)
}
if in.LayoutShiftDetails != nil {
const prefix string = ",\"layoutShiftDetails\":"
out.RawString(prefix)
(*in.LayoutShiftDetails).MarshalEasyJSON(out)
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v TimelineEvent) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v TimelineEvent) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *TimelineEvent) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *TimelineEvent) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline1(in *jlexer.Lexer, out *LayoutShiftAttribution) {
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 "previousRect":
if in.IsNull() {
in.Skip()
out.PreviousRect = nil
} else {
if out.PreviousRect == nil {
out.PreviousRect = new(dom.Rect)
}
(*out.PreviousRect).UnmarshalEasyJSON(in)
}
case "currentRect":
if in.IsNull() {
in.Skip()
out.CurrentRect = nil
} else {
if out.CurrentRect == nil {
out.CurrentRect = new(dom.Rect)
}
(*out.CurrentRect).UnmarshalEasyJSON(in)
}
case "nodeId":
(out.NodeID).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline1(out *jwriter.Writer, in LayoutShiftAttribution) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"previousRect\":"
out.RawString(prefix[1:])
if in.PreviousRect == nil {
out.RawString("null")
} else {
(*in.PreviousRect).MarshalEasyJSON(out)
}
}
{
const prefix string = ",\"currentRect\":"
out.RawString(prefix)
if in.CurrentRect == nil {
out.RawString("null")
} else {
(*in.CurrentRect).MarshalEasyJSON(out)
}
}
if in.NodeID != 0 {
const prefix string = ",\"nodeId\":"
out.RawString(prefix)
out.Int64(int64(in.NodeID))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v LayoutShiftAttribution) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v LayoutShiftAttribution) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline1(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *LayoutShiftAttribution) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline1(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *LayoutShiftAttribution) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline1(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline2(in *jlexer.Lexer, out *LayoutShift) {
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 "value":
out.Value = float64(in.Float64())
case "hadRecentInput":
out.HadRecentInput = bool(in.Bool())
case "lastInputTime":
if in.IsNull() {
in.Skip()
out.LastInputTime = nil
} else {
if out.LastInputTime == nil {
out.LastInputTime = new(cdp.TimeSinceEpoch)
}
(*out.LastInputTime).UnmarshalEasyJSON(in)
}
case "sources":
if in.IsNull() {
in.Skip()
out.Sources = nil
} else {
in.Delim('[')
if out.Sources == nil {
if !in.IsDelim(']') {
out.Sources = make([]*LayoutShiftAttribution, 0, 8)
} else {
out.Sources = []*LayoutShiftAttribution{}
}
} else {
out.Sources = (out.Sources)[:0]
}
for !in.IsDelim(']') {
var v1 *LayoutShiftAttribution
if in.IsNull() {
in.Skip()
v1 = nil
} else {
if v1 == nil {
v1 = new(LayoutShiftAttribution)
}
(*v1).UnmarshalEasyJSON(in)
}
out.Sources = append(out.Sources, v1)
in.WantComma()
}
in.Delim(']')
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline2(out *jwriter.Writer, in LayoutShift) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"value\":"
out.RawString(prefix[1:])
out.Float64(float64(in.Value))
}
{
const prefix string = ",\"hadRecentInput\":"
out.RawString(prefix)
out.Bool(bool(in.HadRecentInput))
}
{
const prefix string = ",\"lastInputTime\":"
out.RawString(prefix)
if in.LastInputTime == nil {
out.RawString("null")
} else {
(*in.LastInputTime).MarshalEasyJSON(out)
}
}
{
const prefix string = ",\"sources\":"
out.RawString(prefix)
if in.Sources == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v2, v3 := range in.Sources {
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 LayoutShift) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline2(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v LayoutShift) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline2(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *LayoutShift) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline2(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *LayoutShift) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline2(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline3(in *jlexer.Lexer, out *LargestContentfulPaint) {
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 "renderTime":
if in.IsNull() {
in.Skip()
out.RenderTime = nil
} else {
if out.RenderTime == nil {
out.RenderTime = new(cdp.TimeSinceEpoch)
}
(*out.RenderTime).UnmarshalEasyJSON(in)
}
case "loadTime":
if in.IsNull() {
in.Skip()
out.LoadTime = nil
} else {
if out.LoadTime == nil {
out.LoadTime = new(cdp.TimeSinceEpoch)
}
(*out.LoadTime).UnmarshalEasyJSON(in)
}
case "size":
out.Size = float64(in.Float64())
case "elementId":
out.ElementID = string(in.String())
case "url":
out.URL = string(in.String())
case "nodeId":
(out.NodeID).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline3(out *jwriter.Writer, in LargestContentfulPaint) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"renderTime\":"
out.RawString(prefix[1:])
if in.RenderTime == nil {
out.RawString("null")
} else {
(*in.RenderTime).MarshalEasyJSON(out)
}
}
{
const prefix string = ",\"loadTime\":"
out.RawString(prefix)
if in.LoadTime == nil {
out.RawString("null")
} else {
(*in.LoadTime).MarshalEasyJSON(out)
}
}
{
const prefix string = ",\"size\":"
out.RawString(prefix)
out.Float64(float64(in.Size))
}
if in.ElementID != "" {
const prefix string = ",\"elementId\":"
out.RawString(prefix)
out.String(string(in.ElementID))
}
if in.URL != "" {
const prefix string = ",\"url\":"
out.RawString(prefix)
out.String(string(in.URL))
}
if in.NodeID != 0 {
const prefix string = ",\"nodeId\":"
out.RawString(prefix)
out.Int64(int64(in.NodeID))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v LargestContentfulPaint) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline3(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v LargestContentfulPaint) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline3(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *LargestContentfulPaint) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline3(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *LargestContentfulPaint) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline3(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline4(in *jlexer.Lexer, out *EventTimelineEventAdded) {
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 "event":
if in.IsNull() {
in.Skip()
out.Event = nil
} else {
if out.Event == nil {
out.Event = new(TimelineEvent)
}
(*out.Event).UnmarshalEasyJSON(in)
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline4(out *jwriter.Writer, in EventTimelineEventAdded) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"event\":"
out.RawString(prefix[1:])
if in.Event == nil {
out.RawString("null")
} else {
(*in.Event).MarshalEasyJSON(out)
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v EventTimelineEventAdded) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline4(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventTimelineEventAdded) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline4(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EventTimelineEventAdded) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline4(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventTimelineEventAdded) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline4(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline5(in *jlexer.Lexer, out *EnableParams) {
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 "eventTypes":
if in.IsNull() {
in.Skip()
out.EventTypes = nil
} else {
in.Delim('[')
if out.EventTypes == nil {
if !in.IsDelim(']') {
out.EventTypes = make([]string, 0, 4)
} else {
out.EventTypes = []string{}
}
} else {
out.EventTypes = (out.EventTypes)[:0]
}
for !in.IsDelim(']') {
var v4 string
v4 = string(in.String())
out.EventTypes = append(out.EventTypes, v4)
in.WantComma()
}
in.Delim(']')
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline5(out *jwriter.Writer, in EnableParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"eventTypes\":"
out.RawString(prefix[1:])
if in.EventTypes == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v5, v6 := range in.EventTypes {
if v5 > 0 {
out.RawByte(',')
}
out.String(string(v6))
}
out.RawByte(']')
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v EnableParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline5(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformancetimeline5(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EnableParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline5(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformancetimeline5(l, v)
}

View File

@@ -0,0 +1,11 @@
package performancetimeline
// Code generated by cdproto-gen. DO NOT EDIT.
// EventTimelineEventAdded sent when a performance timeline event is added.
// See reportPerformanceTimeline method.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#event-timelineEventAdded
type EventTimelineEventAdded struct {
Event *TimelineEvent `json:"event"`
}

View File

@@ -0,0 +1,45 @@
// Package performancetimeline provides the Chrome DevTools Protocol
// commands, types, and events for the PerformanceTimeline domain.
//
// Reporting of performance timeline events, as specified in
// https://w3c.github.io/performance-timeline/#dom-performanceobserver.
//
// Generated by the cdproto-gen command.
package performancetimeline
// Code generated by cdproto-gen. DO NOT EDIT.
import (
"context"
"github.com/chromedp/cdproto/cdp"
)
// EnableParams previously buffered events would be reported before method
// returns. See also: timelineEventAdded.
type EnableParams struct {
EventTypes []string `json:"eventTypes"` // The types of event to report, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype The specified filter overrides any previous filters, passing empty filter disables recording. Note that not all types exposed to the web platform are currently supported.
}
// Enable previously buffered events would be reported before method returns.
// See also: timelineEventAdded.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#method-enable
//
// parameters:
// eventTypes - The types of event to report, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype The specified filter overrides any previous filters, passing empty filter disables recording. Note that not all types exposed to the web platform are currently supported.
func Enable(eventTypes []string) *EnableParams {
return &EnableParams{
EventTypes: eventTypes,
}
}
// Do executes PerformanceTimeline.enable against the provided context.
func (p *EnableParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandEnable, p, nil)
}
// Command names.
const (
CommandEnable = "PerformanceTimeline.enable"
)

View File

@@ -0,0 +1,55 @@
package performancetimeline
// Code generated by cdproto-gen. DO NOT EDIT.
import (
"github.com/chromedp/cdproto/cdp"
"github.com/chromedp/cdproto/dom"
)
// LargestContentfulPaint see https://github.com/WICG/LargestContentfulPaint
// and largest_contentful_paint.idl.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#type-LargestContentfulPaint
type LargestContentfulPaint struct {
RenderTime *cdp.TimeSinceEpoch `json:"renderTime"`
LoadTime *cdp.TimeSinceEpoch `json:"loadTime"`
Size float64 `json:"size"` // The number of pixels being painted.
ElementID string `json:"elementId,omitempty"` // The id attribute of the element, if available.
URL string `json:"url,omitempty"` // The URL of the image (may be trimmed).
NodeID cdp.BackendNodeID `json:"nodeId,omitempty"`
}
// LayoutShiftAttribution [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#type-LayoutShiftAttribution
type LayoutShiftAttribution struct {
PreviousRect *dom.Rect `json:"previousRect"`
CurrentRect *dom.Rect `json:"currentRect"`
NodeID cdp.BackendNodeID `json:"nodeId,omitempty"`
}
// LayoutShift see
// https://wicg.github.io/layout-instability/#sec-layout-shift and
// layout_shift.idl.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#type-LayoutShift
type LayoutShift struct {
Value float64 `json:"value"` // Score increment produced by this event.
HadRecentInput bool `json:"hadRecentInput"`
LastInputTime *cdp.TimeSinceEpoch `json:"lastInputTime"`
Sources []*LayoutShiftAttribution `json:"sources"`
}
// TimelineEvent [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#type-TimelineEvent
type TimelineEvent struct {
FrameID cdp.FrameID `json:"frameId"` // Identifies the frame that this event is related to. Empty for non-frame targets.
Type string `json:"type"` // The event type, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype This determines which of the optional "details" fiedls is present.
Name string `json:"name"` // Name may be empty depending on the type.
Time *cdp.TimeSinceEpoch `json:"time"` // Time in seconds since Epoch, monotonically increasing within document lifetime.
Duration float64 `json:"duration,omitempty"` // Event duration, if applicable.
LcpDetails *LargestContentfulPaint `json:"lcpDetails,omitempty"`
LayoutShiftDetails *LayoutShift `json:"layoutShiftDetails,omitempty"`
}

File diff suppressed because it is too large Load Diff

View File

@@ -35,6 +35,6 @@ type EventConsoleProfileStarted struct {
// See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#event-preciseCoverageDeltaUpdate
type EventPreciseCoverageDeltaUpdate struct {
Timestamp float64 `json:"timestamp"` // Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
Occassion string `json:"occassion"` // Identifier for distinguishing coverage events.
Occasion string `json:"occasion"` // Identifier for distinguishing coverage events.
Result []*ScriptCoverage `json:"result"` // Coverage data for the current isolate.
}

View File

@@ -317,6 +317,66 @@ func (p *TakeTypeProfileParams) Do(ctx context.Context) (result []*ScriptTypePro
return res.Result, nil
}
// EnableCountersParams enable counters collection.
type EnableCountersParams struct{}
// EnableCounters enable counters collection.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-enableCounters
func EnableCounters() *EnableCountersParams {
return &EnableCountersParams{}
}
// Do executes Profiler.enableCounters against the provided context.
func (p *EnableCountersParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandEnableCounters, nil, nil)
}
// DisableCountersParams disable counters collection.
type DisableCountersParams struct{}
// DisableCounters disable counters collection.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-disableCounters
func DisableCounters() *DisableCountersParams {
return &DisableCountersParams{}
}
// Do executes Profiler.disableCounters against the provided context.
func (p *DisableCountersParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandDisableCounters, nil, nil)
}
// GetCountersParams retrieve counters.
type GetCountersParams struct{}
// GetCounters retrieve counters.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-getCounters
func GetCounters() *GetCountersParams {
return &GetCountersParams{}
}
// GetCountersReturns return values.
type GetCountersReturns struct {
Result []*CounterInfo `json:"result,omitempty"` // Collected counters information.
}
// Do executes Profiler.getCounters against the provided context.
//
// returns:
// result - Collected counters information.
func (p *GetCountersParams) Do(ctx context.Context) (result []*CounterInfo, err error) {
// execute
var res GetCountersReturns
err = cdp.Execute(ctx, CommandGetCounters, nil, &res)
if err != nil {
return nil, err
}
return res.Result, nil
}
// EnableRuntimeCallStatsParams enable run time call stats collection.
type EnableRuntimeCallStatsParams struct{}
@@ -359,14 +419,14 @@ func GetRuntimeCallStats() *GetRuntimeCallStatsParams {
// GetRuntimeCallStatsReturns return values.
type GetRuntimeCallStatsReturns struct {
Result []*CounterInfo `json:"result,omitempty"` // Collected counter information.
Result []*RuntimeCallCounterInfo `json:"result,omitempty"` // Collected runtime call counter information.
}
// Do executes Profiler.getRuntimeCallStats against the provided context.
//
// returns:
// result - Collected counter information.
func (p *GetRuntimeCallStatsParams) Do(ctx context.Context) (result []*CounterInfo, err error) {
// result - Collected runtime call counter information.
func (p *GetRuntimeCallStatsParams) Do(ctx context.Context) (result []*RuntimeCallCounterInfo, err error) {
// execute
var res GetRuntimeCallStatsReturns
err = cdp.Execute(ctx, CommandGetRuntimeCallStats, nil, &res)
@@ -391,6 +451,9 @@ const (
CommandStopTypeProfile = "Profiler.stopTypeProfile"
CommandTakePreciseCoverage = "Profiler.takePreciseCoverage"
CommandTakeTypeProfile = "Profiler.takeTypeProfile"
CommandEnableCounters = "Profiler.enableCounters"
CommandDisableCounters = "Profiler.disableCounters"
CommandGetCounters = "Profiler.getCounters"
CommandEnableRuntimeCallStats = "Profiler.enableRuntimeCallStats"
CommandDisableRuntimeCallStats = "Profiler.disableRuntimeCallStats"
CommandGetRuntimeCallStats = "Profiler.getRuntimeCallStats"

View File

@@ -98,3 +98,12 @@ type CounterInfo struct {
Name string `json:"name"` // Counter name.
Value int64 `json:"value"` // Counter value.
}
// RuntimeCallCounterInfo runtime call counter information.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-RuntimeCallCounterInfo
type RuntimeCallCounterInfo struct {
Name string `json:"name"` // Counter name.
Value float64 `json:"value"` // Counter value.
Time float64 `json:"time"` // Counter time in seconds.
}

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -87,7 +87,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime1(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -160,7 +160,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime2(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -313,7 +313,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime3(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -379,7 +379,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime4(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -445,7 +445,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime5(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -540,7 +540,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime6(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -655,7 +655,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime7(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -714,7 +714,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime8(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -780,7 +780,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime9(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -918,7 +918,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime10(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -984,7 +984,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime11(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1050,7 +1050,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime12(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1125,7 +1125,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime13(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1198,7 +1198,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime14(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1300,7 +1300,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime15(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1461,7 +1461,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime16(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1572,7 +1572,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime17(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1759,7 +1759,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime18(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1840,7 +1840,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime19(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1937,7 +1937,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime20(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2004,7 +2004,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime21(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2241,7 +2241,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime22(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2328,7 +2328,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime23(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2395,7 +2395,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime24(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2454,7 +2454,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime25(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2533,7 +2533,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime26(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2592,7 +2592,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime27(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2606,6 +2606,8 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime27(in *jlexer.Lexer, o
out.Origin = string(in.String())
case "name":
out.Name = string(in.String())
case "uniqueId":
out.UniqueID = string(in.String())
case "auxData":
(out.AuxData).UnmarshalEasyJSON(in)
default:
@@ -2637,6 +2639,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime27(out *jwriter.Writer
out.RawString(prefix)
out.String(string(in.Name))
}
{
const prefix string = ",\"uniqueId\":"
out.RawString(prefix)
out.String(string(in.UniqueID))
}
if (in.AuxData).IsDefined() {
const prefix string = ",\"auxData\":"
out.RawString(prefix)
@@ -2679,7 +2686,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime28(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2721,6 +2728,8 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime28(in *jlexer.Lexer, o
}
case "executionContextId":
out.ExecutionContextID = ExecutionContextID(in.Int64())
case "exceptionMetaData":
(out.ExceptionMetaData).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
@@ -2780,6 +2789,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime28(out *jwriter.Writer
out.RawString(prefix)
out.Int64(int64(in.ExecutionContextID))
}
if (in.ExceptionMetaData).IsDefined() {
const prefix string = ",\"exceptionMetaData\":"
out.RawString(prefix)
(in.ExceptionMetaData).MarshalEasyJSON(out)
}
out.RawByte('}')
}
@@ -2817,7 +2831,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime29(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2902,7 +2916,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime30(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2961,7 +2975,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime31(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -3027,7 +3041,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime32(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -3105,7 +3119,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime33(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -3202,7 +3216,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime34(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -3275,7 +3289,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime35(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -3440,7 +3454,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime36(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -3520,7 +3534,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime37(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -3615,7 +3629,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime38(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -3649,6 +3663,10 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime38(in *jlexer.Lexer, o
out.DisableBreaks = bool(in.Bool())
case "replMode":
out.ReplMode = bool(in.Bool())
case "allowUnsafeEvalBlockedByCSP":
out.AllowUnsafeEvalBlockedByCSP = bool(in.Bool())
case "uniqueContextId":
out.UniqueContextID = string(in.String())
default:
in.SkipRecursive()
}
@@ -3728,6 +3746,16 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime38(out *jwriter.Writer
out.RawString(prefix)
out.Bool(bool(in.ReplMode))
}
if in.AllowUnsafeEvalBlockedByCSP {
const prefix string = ",\"allowUnsafeEvalBlockedByCSP\":"
out.RawString(prefix)
out.Bool(bool(in.AllowUnsafeEvalBlockedByCSP))
}
if in.UniqueContextID != "" {
const prefix string = ",\"uniqueContextId\":"
out.RawString(prefix)
out.String(string(in.UniqueContextID))
}
out.RawByte('}')
}
@@ -3765,7 +3793,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime39(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -3864,7 +3892,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime40(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -3923,7 +3951,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime41(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -3982,7 +4010,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime42(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -4041,7 +4069,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime43(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -4114,7 +4142,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime44(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -4201,7 +4229,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime45(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -4288,7 +4316,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime46(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -4383,7 +4411,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime47(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -4554,7 +4582,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime48(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -4648,7 +4676,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime49(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -4739,7 +4767,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime50(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -4834,7 +4862,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime51(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -4914,7 +4942,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime52(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -4924,8 +4952,8 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoRuntime52(in *jlexer.Lexer, o
switch key {
case "name":
out.Name = string(in.String())
case "executionContextId":
out.ExecutionContextID = ExecutionContextID(in.Int64())
case "executionContextName":
out.ExecutionContextName = string(in.String())
default:
in.SkipRecursive()
}
@@ -4945,10 +4973,10 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime52(out *jwriter.Writer
out.RawString(prefix[1:])
out.String(string(in.Name))
}
if in.ExecutionContextID != 0 {
const prefix string = ",\"executionContextId\":"
if in.ExecutionContextName != "" {
const prefix string = ",\"executionContextName\":"
out.RawString(prefix)
out.Int64(int64(in.ExecutionContextID))
out.String(string(in.ExecutionContextName))
}
out.RawByte('}')
}

View File

@@ -293,19 +293,21 @@ func (p *EnableParams) Do(ctx context.Context) (err error) {
// EvaluateParams evaluates expression on global object.
type EvaluateParams struct {
Expression string `json:"expression"` // Expression to evaluate.
ObjectGroup string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects.
IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"` // Determines whether Command Line API should be available during the evaluation.
Silent bool `json:"silent,omitempty"` // In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
ContextID ExecutionContextID `json:"contextId,omitempty"` // Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
ReturnByValue bool `json:"returnByValue,omitempty"` // Whether the result is expected to be a JSON object that should be sent by value.
GeneratePreview bool `json:"generatePreview,omitempty"` // Whether preview should be generated for the result.
UserGesture bool `json:"userGesture,omitempty"` // Whether execution should be treated as initiated by user in the UI.
AwaitPromise bool `json:"awaitPromise,omitempty"` // Whether execution should await for resulting value and return once awaited promise is resolved.
ThrowOnSideEffect bool `json:"throwOnSideEffect,omitempty"` // Whether to throw an exception if side effect cannot be ruled out during evaluation. This implies disableBreaks below.
Timeout TimeDelta `json:"timeout,omitempty"` // Terminate execution after timing out (number of milliseconds).
DisableBreaks bool `json:"disableBreaks,omitempty"` // Disable breakpoints during execution.
ReplMode bool `json:"replMode,omitempty"` // Setting this flag to true enables let re-declaration and top-level await. Note that let variables can only be re-declared if they originate from replMode themselves.
Expression string `json:"expression"` // Expression to evaluate.
ObjectGroup string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects.
IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"` // Determines whether Command Line API should be available during the evaluation.
Silent bool `json:"silent,omitempty"` // In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
ContextID ExecutionContextID `json:"contextId,omitempty"` // Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. This is mutually exclusive with uniqueContextId, which offers an alternative way to identify the execution context that is more reliable in a multi-process environment.
ReturnByValue bool `json:"returnByValue,omitempty"` // Whether the result is expected to be a JSON object that should be sent by value.
GeneratePreview bool `json:"generatePreview,omitempty"` // Whether preview should be generated for the result.
UserGesture bool `json:"userGesture,omitempty"` // Whether execution should be treated as initiated by user in the UI.
AwaitPromise bool `json:"awaitPromise,omitempty"` // Whether execution should await for resulting value and return once awaited promise is resolved.
ThrowOnSideEffect bool `json:"throwOnSideEffect,omitempty"` // Whether to throw an exception if side effect cannot be ruled out during evaluation. This implies disableBreaks below.
Timeout TimeDelta `json:"timeout,omitempty"` // Terminate execution after timing out (number of milliseconds).
DisableBreaks bool `json:"disableBreaks,omitempty"` // Disable breakpoints during execution.
ReplMode bool `json:"replMode,omitempty"` // Setting this flag to true enables let re-declaration and top-level await. Note that let variables can only be re-declared if they originate from replMode themselves.
AllowUnsafeEvalBlockedByCSP bool `json:"allowUnsafeEvalBlockedByCSP,omitempty"` // The Content Security Policy (CSP) for the target might block 'unsafe-eval' which includes eval(), Function(), setTimeout() and setInterval() when called with non-callable arguments. This flag bypasses CSP for this evaluation and allows unsafe-eval. Defaults to true.
UniqueContextID string `json:"uniqueContextId,omitempty"` // An alternative way to specify the execution context to evaluate in. Compared to contextId that may be reused across processes, this is guaranteed to be system-unique, so it can be used to prevent accidental evaluation of the expression in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with contextId.
}
// Evaluate evaluates expression on global object.
@@ -343,7 +345,9 @@ func (p EvaluateParams) WithSilent(silent bool) *EvaluateParams {
// WithContextID specifies in which execution context to perform evaluation.
// If the parameter is omitted the evaluation will be performed in the context
// of the inspected page.
// of the inspected page. This is mutually exclusive with uniqueContextId, which
// offers an alternative way to identify the execution context that is more
// reliable in a multi-process environment.
func (p EvaluateParams) WithContextID(contextID ExecutionContextID) *EvaluateParams {
p.ContextID = contextID
return &p
@@ -403,6 +407,27 @@ func (p EvaluateParams) WithReplMode(replMode bool) *EvaluateParams {
return &p
}
// WithAllowUnsafeEvalBlockedByCSP the Content Security Policy (CSP) for the
// target might block 'unsafe-eval' which includes eval(), Function(),
// setTimeout() and setInterval() when called with non-callable arguments. This
// flag bypasses CSP for this evaluation and allows unsafe-eval. Defaults to
// true.
func (p EvaluateParams) WithAllowUnsafeEvalBlockedByCSP(allowUnsafeEvalBlockedByCSP bool) *EvaluateParams {
p.AllowUnsafeEvalBlockedByCSP = allowUnsafeEvalBlockedByCSP
return &p
}
// WithUniqueContextID an alternative way to specify the execution context to
// evaluate in. Compared to contextId that may be reused across processes, this
// is guaranteed to be system-unique, so it can be used to prevent accidental
// evaluation of the expression in context different than intended (e.g. as a
// result of navigation across process boundaries). This is mutually exclusive
// with contextId.
func (p EvaluateParams) WithUniqueContextID(uniqueContextID string) *EvaluateParams {
p.UniqueContextID = uniqueContextID
return &p
}
// EvaluateReturns return values.
type EvaluateReturns struct {
Result *RemoteObject `json:"result,omitempty"` // Evaluation result.
@@ -866,23 +891,21 @@ func (p *TerminateExecutionParams) Do(ctx context.Context) (err error) {
// AddBindingParams if executionContextId is empty, adds binding with the
// given name on the global objects of all inspected contexts, including those
// created later, bindings survive reloads. If executionContextId is specified,
// adds binding only on global object of given execution context. Binding
// function takes exactly one argument, this argument should be string, in case
// of any other input, function throws an exception. Each binding function call
// produces Runtime.bindingCalled notification.
// created later, bindings survive reloads. Binding function takes exactly one
// argument, this argument should be string, in case of any other input,
// function throws an exception. Each binding function call produces
// Runtime.bindingCalled notification.
type AddBindingParams struct {
Name string `json:"name"`
ExecutionContextID ExecutionContextID `json:"executionContextId,omitempty"`
Name string `json:"name"`
ExecutionContextName string `json:"executionContextName,omitempty"` // If specified, the binding is exposed to the executionContext with matching name, even for contexts created after the binding is added. See also ExecutionContext.name and worldName parameter to Page.addScriptToEvaluateOnNewDocument. This parameter is mutually exclusive with executionContextId.
}
// AddBinding if executionContextId is empty, adds binding with the given
// name on the global objects of all inspected contexts, including those created
// later, bindings survive reloads. If executionContextId is specified, adds
// binding only on global object of given execution context. Binding function
// takes exactly one argument, this argument should be string, in case of any
// other input, function throws an exception. Each binding function call
// produces Runtime.bindingCalled notification.
// later, bindings survive reloads. Binding function takes exactly one argument,
// this argument should be string, in case of any other input, function throws
// an exception. Each binding function call produces Runtime.bindingCalled
// notification.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-addBinding
//
@@ -894,9 +917,13 @@ func AddBinding(name string) *AddBindingParams {
}
}
// WithExecutionContextID [no description].
func (p AddBindingParams) WithExecutionContextID(executionContextID ExecutionContextID) *AddBindingParams {
p.ExecutionContextID = executionContextID
// WithExecutionContextName if specified, the binding is exposed to the
// executionContext with matching name, even for contexts created after the
// binding is added. See also ExecutionContext.name and worldName parameter to
// Page.addScriptToEvaluateOnNewDocument. This parameter is mutually exclusive
// with executionContextId.
func (p AddBindingParams) WithExecutionContextName(executionContextName string) *AddBindingParams {
p.ExecutionContextName = executionContextName
return &p
}

View File

@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"strconv"
"strings"
"time"
"github.com/mailru/easyjson"
@@ -49,7 +50,7 @@ func (t UnserializableValue) String() string {
// See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#type-RemoteObject
type RemoteObject struct {
Type Type `json:"type"` // Object type.
Subtype Subtype `json:"subtype,omitempty"` // Object subtype hint. Specified for object or wasm type values only.
Subtype Subtype `json:"subtype,omitempty"` // Object subtype hint. Specified for object type values only. NOTE: If you change anything here, make sure to also update subtype in ObjectPreview and PropertyPreview below.
ClassName string `json:"className,omitempty"` // Object class (constructor) name. Specified for object type values only.
Value easyjson.RawMessage `json:"value,omitempty"` // Remote object value in case of primitive values or JSON values (if it was requested).
UnserializableValue UnserializableValue `json:"unserializableValue,omitempty"` // Primitive value which can not be JSON-stringified does not have value, but gets this property.
@@ -158,10 +159,11 @@ func (t ExecutionContextID) Int64() int64 {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#type-ExecutionContextDescription
type ExecutionContextDescription struct {
ID ExecutionContextID `json:"id"` // Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.
Origin string `json:"origin"` // Execution context origin.
Name string `json:"name"` // Human readable name describing given context.
AuxData easyjson.RawMessage `json:"auxData,omitempty"`
ID ExecutionContextID `json:"id"` // Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.
Origin string `json:"origin"` // Execution context origin.
Name string `json:"name"` // Human readable name describing given context.
UniqueID string `json:"uniqueId"` // A system-unique execution context identifier. Unlike the id, this is unique across multiple processes, so can be reliably used to identify specific context while backend performs a cross-process navigation.
AuxData easyjson.RawMessage `json:"auxData,omitempty"`
}
// ExceptionDetails detailed information about exception (or error) that was
@@ -169,22 +171,28 @@ type ExecutionContextDescription struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#type-ExceptionDetails
type ExceptionDetails struct {
ExceptionID int64 `json:"exceptionId"` // Exception id.
Text string `json:"text"` // Exception text, which should be used together with exception object when available.
LineNumber int64 `json:"lineNumber"` // Line number of the exception location (0-based).
ColumnNumber int64 `json:"columnNumber"` // Column number of the exception location (0-based).
ScriptID ScriptID `json:"scriptId,omitempty"` // Script ID of the exception location.
URL string `json:"url,omitempty"` // URL of the exception location, to be used when the script was not reported.
StackTrace *StackTrace `json:"stackTrace,omitempty"` // JavaScript stack trace if available.
Exception *RemoteObject `json:"exception,omitempty"` // Exception object if available.
ExecutionContextID ExecutionContextID `json:"executionContextId,omitempty"` // Identifier of the context where exception happened.
ExceptionID int64 `json:"exceptionId"` // Exception id.
Text string `json:"text"` // Exception text, which should be used together with exception object when available.
LineNumber int64 `json:"lineNumber"` // Line number of the exception location (0-based).
ColumnNumber int64 `json:"columnNumber"` // Column number of the exception location (0-based).
ScriptID ScriptID `json:"scriptId,omitempty"` // Script ID of the exception location.
URL string `json:"url,omitempty"` // URL of the exception location, to be used when the script was not reported.
StackTrace *StackTrace `json:"stackTrace,omitempty"` // JavaScript stack trace if available.
Exception *RemoteObject `json:"exception,omitempty"` // Exception object if available.
ExecutionContextID ExecutionContextID `json:"executionContextId,omitempty"` // Identifier of the context where exception happened.
ExceptionMetaData easyjson.RawMessage `json:"exceptionMetaData,omitempty"`
}
// Error satisfies the error interface.
func (e *ExceptionDetails) Error() string {
var b strings.Builder
// TODO: watch script parsed events and match the ExceptionDetails.ScriptID
// to the name/location of the actual code and display here
return fmt.Sprintf("encountered exception '%s' (%d:%d)", e.Text, e.LineNumber, e.ColumnNumber)
fmt.Fprintf(&b, "exception %q (%d:%d)", e.Text, e.LineNumber, e.ColumnNumber)
if obj := e.Exception; obj != nil {
fmt.Fprintf(&b, ": %s", obj.Description)
}
return b.String()
}
// Timestamp number of milliseconds since epoch.
@@ -291,7 +299,6 @@ const (
TypeBoolean Type = "boolean"
TypeSymbol Type = "symbol"
TypeBigint Type = "bigint"
TypeWasm Type = "wasm"
TypeAccessor Type = "accessor"
)
@@ -324,8 +331,6 @@ func (t *Type) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = TypeSymbol
case TypeBigint:
*t = TypeBigint
case TypeWasm:
*t = TypeWasm
case TypeAccessor:
*t = TypeAccessor
@@ -339,8 +344,9 @@ func (t *Type) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// Subtype object subtype hint. Specified for object or wasm type values
// only.
// Subtype object subtype hint. Specified for object type values only. NOTE:
// If you change anything here, make sure to also update subtype in
// ObjectPreview and PropertyPreview below.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#type-RemoteObject
type Subtype string
@@ -352,29 +358,25 @@ func (t Subtype) String() string {
// Subtype values.
const (
SubtypeArray Subtype = "array"
SubtypeNull Subtype = "null"
SubtypeNode Subtype = "node"
SubtypeRegexp Subtype = "regexp"
SubtypeDate Subtype = "date"
SubtypeMap Subtype = "map"
SubtypeSet Subtype = "set"
SubtypeWeakmap Subtype = "weakmap"
SubtypeWeakset Subtype = "weakset"
SubtypeIterator Subtype = "iterator"
SubtypeGenerator Subtype = "generator"
SubtypeError Subtype = "error"
SubtypeProxy Subtype = "proxy"
SubtypePromise Subtype = "promise"
SubtypeTypedarray Subtype = "typedarray"
SubtypeArraybuffer Subtype = "arraybuffer"
SubtypeDataview Subtype = "dataview"
SubtypeI32 Subtype = "i32"
SubtypeI64 Subtype = "i64"
SubtypeF32 Subtype = "f32"
SubtypeF64 Subtype = "f64"
SubtypeV128 Subtype = "v128"
SubtypeAnyref Subtype = "anyref"
SubtypeArray Subtype = "array"
SubtypeNull Subtype = "null"
SubtypeNode Subtype = "node"
SubtypeRegexp Subtype = "regexp"
SubtypeDate Subtype = "date"
SubtypeMap Subtype = "map"
SubtypeSet Subtype = "set"
SubtypeWeakmap Subtype = "weakmap"
SubtypeWeakset Subtype = "weakset"
SubtypeIterator Subtype = "iterator"
SubtypeGenerator Subtype = "generator"
SubtypeError Subtype = "error"
SubtypeProxy Subtype = "proxy"
SubtypePromise Subtype = "promise"
SubtypeTypedarray Subtype = "typedarray"
SubtypeArraybuffer Subtype = "arraybuffer"
SubtypeDataview Subtype = "dataview"
SubtypeWebassemblymemory Subtype = "webassemblymemory"
SubtypeWasmvalue Subtype = "wasmvalue"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -424,18 +426,10 @@ func (t *Subtype) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = SubtypeArraybuffer
case SubtypeDataview:
*t = SubtypeDataview
case SubtypeI32:
*t = SubtypeI32
case SubtypeI64:
*t = SubtypeI64
case SubtypeF32:
*t = SubtypeF32
case SubtypeF64:
*t = SubtypeF64
case SubtypeV128:
*t = SubtypeV128
case SubtypeAnyref:
*t = SubtypeAnyref
case SubtypeWebassemblymemory:
*t = SubtypeWebassemblymemory
case SubtypeWasmvalue:
*t = SubtypeWasmvalue
default:
in.AddError(errors.New("unknown Subtype value"))

View File

@@ -29,7 +29,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSecurity(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -164,7 +164,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSecurity1(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -334,7 +334,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSecurity2(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -400,7 +400,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSecurity3(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -473,7 +473,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSecurity4(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -551,7 +551,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSecurity5(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -675,7 +675,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSecurity6(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -734,7 +734,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSecurity7(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -793,7 +793,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSecurity8(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -29,7 +29,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker(in *jlexer.Lexe
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -181,7 +181,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker1(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -247,7 +247,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker2(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -313,7 +313,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker3(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -379,7 +379,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker4(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -438,7 +438,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker5(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -504,7 +504,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker6(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -570,7 +570,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker7(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -636,7 +636,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker8(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -716,7 +716,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker9(in *jlexer.Lex
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -782,7 +782,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker10(in *jlexer.Le
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -892,7 +892,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker11(in *jlexer.Le
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1002,7 +1002,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker12(in *jlexer.Le
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1080,7 +1080,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker13(in *jlexer.Le
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1181,7 +1181,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker14(in *jlexer.Le
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1240,7 +1240,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker15(in *jlexer.Le
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1327,7 +1327,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker16(in *jlexer.Le
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1407,7 +1407,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker17(in *jlexer.Le
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1466,7 +1466,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker18(in *jlexer.Le
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

File diff suppressed because it is too large Load Diff

View File

@@ -156,6 +156,7 @@ func GetUsageAndQuota(origin string) *GetUsageAndQuotaParams {
type GetUsageAndQuotaReturns struct {
Usage float64 `json:"usage,omitempty"` // Storage usage (bytes).
Quota float64 `json:"quota,omitempty"` // Storage quota (bytes).
OverrideActive bool `json:"overrideActive,omitempty"` // Whether or not the origin has an active storage quota override
UsageBreakdown []*UsageForType `json:"usageBreakdown,omitempty"` // Storage usage per type (bytes).
}
@@ -164,16 +165,52 @@ type GetUsageAndQuotaReturns struct {
// returns:
// usage - Storage usage (bytes).
// quota - Storage quota (bytes).
// overrideActive - Whether or not the origin has an active storage quota override
// usageBreakdown - Storage usage per type (bytes).
func (p *GetUsageAndQuotaParams) Do(ctx context.Context) (usage float64, quota float64, usageBreakdown []*UsageForType, err error) {
func (p *GetUsageAndQuotaParams) Do(ctx context.Context) (usage float64, quota float64, overrideActive bool, usageBreakdown []*UsageForType, err error) {
// execute
var res GetUsageAndQuotaReturns
err = cdp.Execute(ctx, CommandGetUsageAndQuota, p, &res)
if err != nil {
return 0, 0, nil, err
return 0, 0, false, nil, err
}
return res.Usage, res.Quota, res.UsageBreakdown, nil
return res.Usage, res.Quota, res.OverrideActive, res.UsageBreakdown, nil
}
// OverrideQuotaForOriginParams override quota for the specified origin.
type OverrideQuotaForOriginParams struct {
Origin string `json:"origin"` // Security origin.
QuotaSize float64 `json:"quotaSize,omitempty"` // The quota size (in bytes) to override the original quota with. If this is called multiple times, the overridden quota will be equal to the quotaSize provided in the final call. If this is called without specifying a quotaSize, the quota will be reset to the default value for the specified origin. If this is called multiple times with different origins, the override will be maintained for each origin until it is disabled (called without a quotaSize).
}
// OverrideQuotaForOrigin override quota for the specified origin.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-overrideQuotaForOrigin
//
// parameters:
// origin - Security origin.
func OverrideQuotaForOrigin(origin string) *OverrideQuotaForOriginParams {
return &OverrideQuotaForOriginParams{
Origin: origin,
}
}
// WithQuotaSize the quota size (in bytes) to override the original quota
// with. If this is called multiple times, the overridden quota will be equal to
// the quotaSize provided in the final call. If this is called without
// specifying a quotaSize, the quota will be reset to the default value for the
// specified origin. If this is called multiple times with different origins,
// the override will be maintained for each origin until it is disabled (called
// without a quotaSize).
func (p OverrideQuotaForOriginParams) WithQuotaSize(quotaSize float64) *OverrideQuotaForOriginParams {
p.QuotaSize = quotaSize
return &p
}
// Do executes Storage.overrideQuotaForOrigin against the provided context.
func (p *OverrideQuotaForOriginParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandOverrideQuotaForOrigin, p, nil)
}
// TrackCacheStorageForOriginParams registers origin to be notified when an
@@ -272,6 +309,79 @@ func (p *UntrackIndexedDBForOriginParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandUntrackIndexedDBForOrigin, p, nil)
}
// GetTrustTokensParams returns the number of stored Trust Tokens per issuer
// for the current browsing context.
type GetTrustTokensParams struct{}
// GetTrustTokens returns the number of stored Trust Tokens per issuer for
// the current browsing context.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-getTrustTokens
func GetTrustTokens() *GetTrustTokensParams {
return &GetTrustTokensParams{}
}
// GetTrustTokensReturns return values.
type GetTrustTokensReturns struct {
Tokens []*TrustTokens `json:"tokens,omitempty"`
}
// Do executes Storage.getTrustTokens against the provided context.
//
// returns:
// tokens
func (p *GetTrustTokensParams) Do(ctx context.Context) (tokens []*TrustTokens, err error) {
// execute
var res GetTrustTokensReturns
err = cdp.Execute(ctx, CommandGetTrustTokens, nil, &res)
if err != nil {
return nil, err
}
return res.Tokens, nil
}
// ClearTrustTokensParams removes all Trust Tokens issued by the provided
// issuerOrigin. Leaves other stored data, including the issuer's Redemption
// Records, intact.
type ClearTrustTokensParams struct {
IssuerOrigin string `json:"issuerOrigin"`
}
// ClearTrustTokens removes all Trust Tokens issued by the provided
// issuerOrigin. Leaves other stored data, including the issuer's Redemption
// Records, intact.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-clearTrustTokens
//
// parameters:
// issuerOrigin
func ClearTrustTokens(issuerOrigin string) *ClearTrustTokensParams {
return &ClearTrustTokensParams{
IssuerOrigin: issuerOrigin,
}
}
// ClearTrustTokensReturns return values.
type ClearTrustTokensReturns struct {
DidDeleteTokens bool `json:"didDeleteTokens,omitempty"` // True if any tokens were deleted, false otherwise.
}
// Do executes Storage.clearTrustTokens against the provided context.
//
// returns:
// didDeleteTokens - True if any tokens were deleted, false otherwise.
func (p *ClearTrustTokensParams) Do(ctx context.Context) (didDeleteTokens bool, err error) {
// execute
var res ClearTrustTokensReturns
err = cdp.Execute(ctx, CommandClearTrustTokens, p, &res)
if err != nil {
return false, err
}
return res.DidDeleteTokens, nil
}
// Command names.
const (
CommandClearDataForOrigin = "Storage.clearDataForOrigin"
@@ -279,8 +389,11 @@ const (
CommandSetCookies = "Storage.setCookies"
CommandClearCookies = "Storage.clearCookies"
CommandGetUsageAndQuota = "Storage.getUsageAndQuota"
CommandOverrideQuotaForOrigin = "Storage.overrideQuotaForOrigin"
CommandTrackCacheStorageForOrigin = "Storage.trackCacheStorageForOrigin"
CommandTrackIndexedDBForOrigin = "Storage.trackIndexedDBForOrigin"
CommandUntrackCacheStorageForOrigin = "Storage.untrackCacheStorageForOrigin"
CommandUntrackIndexedDBForOrigin = "Storage.untrackIndexedDBForOrigin"
CommandGetTrustTokens = "Storage.getTrustTokens"
CommandClearTrustTokens = "Storage.clearTrustTokens"
)

View File

@@ -88,3 +88,12 @@ type UsageForType struct {
StorageType Type `json:"storageType"` // Name of storage type.
Usage float64 `json:"usage"` // Storage usage (bytes).
}
// TrustTokens pair of issuer origin and number of available (signed, but not
// used) Trust Tokens from that issuer.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#type-TrustTokens
type TrustTokens struct {
IssuerOrigin string `json:"issuerOrigin"`
Count float64 `json:"count"`
}

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSysteminfo(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -127,7 +127,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSysteminfo1(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -231,7 +231,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSysteminfo2(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -304,7 +304,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSysteminfo3(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -384,7 +384,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSysteminfo4(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -527,7 +527,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSysteminfo5(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -636,7 +636,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSysteminfo6(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -695,7 +695,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSysteminfo7(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -806,7 +806,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSysteminfo8(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -865,7 +865,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSysteminfo9(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1181,7 +1181,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoSysteminfo10(in *jlexer.Lexer
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -29,7 +29,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -139,7 +139,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget1(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -205,7 +205,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget2(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -285,7 +285,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget3(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -358,7 +358,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget4(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -378,6 +378,10 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget4(in *jlexer.Lexer, out
out.Attached = bool(in.Bool())
case "openerId":
out.OpenerID = ID(in.String())
case "canAccessOpener":
out.CanAccessOpener = bool(in.Bool())
case "openerFrameId":
(out.OpenerFrameID).UnmarshalEasyJSON(in)
case "browserContextId":
out.BrowserContextID = cdp.BrowserContextID(in.String())
default:
@@ -424,6 +428,16 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget4(out *jwriter.Writer,
out.RawString(prefix)
out.String(string(in.OpenerID))
}
{
const prefix string = ",\"canAccessOpener\":"
out.RawString(prefix)
out.Bool(bool(in.CanAccessOpener))
}
if in.OpenerFrameID != "" {
const prefix string = ",\"openerFrameId\":"
out.RawString(prefix)
out.String(string(in.OpenerFrameID))
}
if in.BrowserContextID != "" {
const prefix string = ",\"browserContextId\":"
out.RawString(prefix)
@@ -466,7 +480,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget5(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -575,7 +589,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget6(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -634,7 +648,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget7(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -709,7 +723,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget8(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -776,7 +790,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget9(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -873,7 +887,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget10(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -932,7 +946,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget11(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1005,7 +1019,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget12(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1083,7 +1097,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget13(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1149,7 +1163,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget14(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1227,7 +1241,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget15(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1307,7 +1321,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget16(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1380,7 +1394,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget17(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1446,7 +1460,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget18(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1538,7 +1552,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget19(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1604,7 +1618,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget20(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1671,7 +1685,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget21(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1738,7 +1752,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget22(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1846,7 +1860,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget23(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1913,7 +1927,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget24(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1993,7 +2007,7 @@ func (v *CreateBrowserContextParams) UnmarshalJSON(data []byte) error {
func (v *CreateBrowserContextParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget24(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget25(in *jlexer.Lexer, out *CloseTargetReturns) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget25(in *jlexer.Lexer, out *CloseTargetParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -2004,74 +2018,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget25(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "success":
out.Success = bool(in.Bool())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget25(out *jwriter.Writer, in CloseTargetReturns) {
out.RawByte('{')
first := true
_ = first
if in.Success {
const prefix string = ",\"success\":"
first = false
out.RawString(prefix[1:])
out.Bool(bool(in.Success))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v CloseTargetReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget25(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v CloseTargetReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget25(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *CloseTargetReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget25(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CloseTargetReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget25(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget26(in *jlexer.Lexer, out *CloseTargetParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2091,7 +2038,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget26(in *jlexer.Lexer, ou
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget26(out *jwriter.Writer, in CloseTargetParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget25(out *jwriter.Writer, in CloseTargetParams) {
out.RawByte('{')
first := true
_ = first
@@ -2106,27 +2053,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget26(out *jwriter.Writer,
// MarshalJSON supports json.Marshaler interface
func (v CloseTargetParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget26(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget25(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v CloseTargetParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget26(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget25(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *CloseTargetParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget26(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget25(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CloseTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget26(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget25(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget27(in *jlexer.Lexer, out *AttachToTargetReturns) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget26(in *jlexer.Lexer, out *AttachToTargetReturns) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -2137,7 +2084,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget27(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2157,7 +2104,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget27(in *jlexer.Lexer, ou
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget27(out *jwriter.Writer, in AttachToTargetReturns) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget26(out *jwriter.Writer, in AttachToTargetReturns) {
out.RawByte('{')
first := true
_ = first
@@ -2173,27 +2120,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget27(out *jwriter.Writer,
// MarshalJSON supports json.Marshaler interface
func (v AttachToTargetReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget27(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget26(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v AttachToTargetReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget27(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget26(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *AttachToTargetReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget27(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget26(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *AttachToTargetReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget27(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget26(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget28(in *jlexer.Lexer, out *AttachToTargetParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget27(in *jlexer.Lexer, out *AttachToTargetParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -2204,7 +2151,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget28(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2226,7 +2173,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget28(in *jlexer.Lexer, ou
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget28(out *jwriter.Writer, in AttachToTargetParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget27(out *jwriter.Writer, in AttachToTargetParams) {
out.RawByte('{')
first := true
_ = first
@@ -2246,27 +2193,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget28(out *jwriter.Writer,
// MarshalJSON supports json.Marshaler interface
func (v AttachToTargetParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget28(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget27(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v AttachToTargetParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget28(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget27(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *AttachToTargetParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget28(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget27(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *AttachToTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget28(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget27(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget29(in *jlexer.Lexer, out *AttachToBrowserTargetReturns) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget28(in *jlexer.Lexer, out *AttachToBrowserTargetReturns) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -2277,7 +2224,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget29(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2297,7 +2244,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget29(in *jlexer.Lexer, ou
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget29(out *jwriter.Writer, in AttachToBrowserTargetReturns) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget28(out *jwriter.Writer, in AttachToBrowserTargetReturns) {
out.RawByte('{')
first := true
_ = first
@@ -2313,27 +2260,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget29(out *jwriter.Writer,
// MarshalJSON supports json.Marshaler interface
func (v AttachToBrowserTargetReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget29(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget28(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v AttachToBrowserTargetReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget29(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget28(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *AttachToBrowserTargetReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget29(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget28(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *AttachToBrowserTargetReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget29(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget28(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget30(in *jlexer.Lexer, out *AttachToBrowserTargetParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget29(in *jlexer.Lexer, out *AttachToBrowserTargetParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -2344,7 +2291,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget30(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2362,7 +2309,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget30(in *jlexer.Lexer, ou
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget30(out *jwriter.Writer, in AttachToBrowserTargetParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget29(out *jwriter.Writer, in AttachToBrowserTargetParams) {
out.RawByte('{')
first := true
_ = first
@@ -2372,27 +2319,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget30(out *jwriter.Writer,
// MarshalJSON supports json.Marshaler interface
func (v AttachToBrowserTargetParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget30(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget29(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v AttachToBrowserTargetParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget30(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget29(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *AttachToBrowserTargetParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget30(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget29(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *AttachToBrowserTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget30(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget29(l, v)
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget31(in *jlexer.Lexer, out *ActivateTargetParams) {
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget30(in *jlexer.Lexer, out *ActivateTargetParams) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
@@ -2403,7 +2350,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget31(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -2423,7 +2370,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget31(in *jlexer.Lexer, ou
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget31(out *jwriter.Writer, in ActivateTargetParams) {
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget30(out *jwriter.Writer, in ActivateTargetParams) {
out.RawByte('{')
first := true
_ = first
@@ -2438,23 +2385,23 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget31(out *jwriter.Writer,
// MarshalJSON supports json.Marshaler interface
func (v ActivateTargetParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget31(&w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget30(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v ActivateTargetParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget31(w, v)
easyjsonC5a4559bEncodeGithubComChromedpCdprotoTarget30(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *ActivateTargetParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget31(&r, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget30(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ActivateTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget31(l, v)
easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget30(l, v)
}

View File

@@ -133,24 +133,9 @@ func CloseTarget(targetID ID) *CloseTargetParams {
}
}
// CloseTargetReturns return values.
type CloseTargetReturns struct {
Success bool `json:"success,omitempty"`
}
// Do executes Target.closeTarget against the provided context.
//
// returns:
// success
func (p *CloseTargetParams) Do(ctx context.Context) (success bool, err error) {
// execute
var res CloseTargetReturns
err = cdp.Execute(ctx, CommandCloseTarget, p, &res)
if err != nil {
return false, err
}
return res.Success, nil
func (p *CloseTargetParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandCloseTarget, p, nil)
}
// ExposeDevToolsProtocolParams inject object to the target's main frame that
@@ -284,7 +269,7 @@ func (p *GetBrowserContextsParams) Do(ctx context.Context) (browserContextIds []
// CreateTargetParams creates a new page.
type CreateTargetParams struct {
URL string `json:"url"` // The initial URL the page will be navigated to.
URL string `json:"url"` // The initial URL the page will be navigated to. An empty string indicates about:blank.
Width int64 `json:"width,omitempty"` // Frame width in DIP (headless chrome only).
Height int64 `json:"height,omitempty"` // Frame height in DIP (headless chrome only).
BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty"` // The browser context to create the page in.
@@ -298,7 +283,7 @@ type CreateTargetParams struct {
// See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-createTarget
//
// parameters:
// url - The initial URL the page will be navigated to.
// url - The initial URL the page will be navigated to. An empty string indicates about:blank.
func CreateTarget(url string) *CreateTargetParams {
return &CreateTargetParams{
URL: url,

View File

@@ -34,8 +34,10 @@ type Info struct {
Type string `json:"type"`
Title string `json:"title"`
URL string `json:"url"`
Attached bool `json:"attached"` // Whether the target has an attached client.
OpenerID ID `json:"openerId,omitempty"` // Opener target Id
Attached bool `json:"attached"` // Whether the target has an attached client.
OpenerID ID `json:"openerId,omitempty"` // Opener target Id
CanAccessOpener bool `json:"canAccessOpener"` // Whether the target has access to the originating window.
OpenerFrameID cdp.FrameID `json:"openerFrameId,omitempty"` // Frame id of originating window (is only set if target has an opener).
BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty"`
}

View File

@@ -28,7 +28,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -94,7 +94,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering1(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -167,7 +167,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTethering2(in *jlexer.Lexer,
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -29,7 +29,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -278,7 +278,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing1(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -304,6 +304,10 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing1(in *jlexer.Lexer, ou
}
(*out.TraceConfig).UnmarshalEasyJSON(in)
}
case "perfettoConfig":
out.PerfettoConfig = string(in.String())
case "tracingBackend":
(out.TracingBackend).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
@@ -364,6 +368,26 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTracing1(out *jwriter.Writer,
}
(*in.TraceConfig).MarshalEasyJSON(out)
}
if in.PerfettoConfig != "" {
const prefix string = ",\"perfettoConfig\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.String(string(in.PerfettoConfig))
}
if in.TracingBackend != "" {
const prefix string = ",\"tracingBackend\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
(in.TracingBackend).MarshalEasyJSON(out)
}
out.RawByte('}')
}
@@ -401,7 +425,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing2(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -480,7 +504,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing3(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -490,6 +514,8 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing3(in *jlexer.Lexer, ou
switch key {
case "deterministic":
out.Deterministic = bool(in.Bool())
case "levelOfDetail":
(out.LevelOfDetail).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
@@ -510,6 +536,16 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTracing3(out *jwriter.Writer,
out.RawString(prefix[1:])
out.Bool(bool(in.Deterministic))
}
if in.LevelOfDetail != "" {
const prefix string = ",\"levelOfDetail\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
(in.LevelOfDetail).MarshalEasyJSON(out)
}
out.RawByte('}')
}
@@ -547,7 +583,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing4(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -613,7 +649,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing5(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -672,7 +708,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing6(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -769,7 +805,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing7(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -828,7 +864,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing8(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -915,7 +951,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing9(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1013,7 +1049,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing10(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1104,7 +1140,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing11(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -81,7 +81,8 @@ func (p *RecordClockSyncMarkerParams) Do(ctx context.Context) (err error) {
// RequestMemoryDumpParams request a global memory dump.
type RequestMemoryDumpParams struct {
Deterministic bool `json:"deterministic,omitempty"` // Enables more deterministic results by forcing garbage collection
Deterministic bool `json:"deterministic,omitempty"` // Enables more deterministic results by forcing garbage collection
LevelOfDetail MemoryDumpLevelOfDetail `json:"levelOfDetail,omitempty"` // Specifies level of details in memory dump. Defaults to "detailed".
}
// RequestMemoryDump request a global memory dump.
@@ -100,6 +101,13 @@ func (p RequestMemoryDumpParams) WithDeterministic(deterministic bool) *RequestM
return &p
}
// WithLevelOfDetail specifies level of details in memory dump. Defaults to
// "detailed".
func (p RequestMemoryDumpParams) WithLevelOfDetail(levelOfDetail MemoryDumpLevelOfDetail) *RequestMemoryDumpParams {
p.LevelOfDetail = levelOfDetail
return &p
}
// RequestMemoryDumpReturns return values.
type RequestMemoryDumpReturns struct {
DumpGUID string `json:"dumpGuid,omitempty"` // GUID of the resulting global memory dump.
@@ -129,6 +137,8 @@ type StartParams struct {
StreamFormat StreamFormat `json:"streamFormat,omitempty"` // Trace data format to use. This only applies when using ReturnAsStream transfer mode (defaults to json).
StreamCompression StreamCompression `json:"streamCompression,omitempty"` // Compression format to use. This only applies when using ReturnAsStream transfer mode (defaults to none)
TraceConfig *TraceConfig `json:"traceConfig,omitempty"`
PerfettoConfig string `json:"perfettoConfig,omitempty"` // Base64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameters categories, options, traceConfig are ignored.
TracingBackend Backend `json:"tracingBackend,omitempty"` // Backend type (defaults to auto)
}
// Start start trace events collection.
@@ -174,6 +184,20 @@ func (p StartParams) WithTraceConfig(traceConfig *TraceConfig) *StartParams {
return &p
}
// WithPerfettoConfig base64-encoded serialized perfetto.protos.TraceConfig
// protobuf message When specified, the parameters categories, options,
// traceConfig are ignored.
func (p StartParams) WithPerfettoConfig(perfettoConfig string) *StartParams {
p.PerfettoConfig = perfettoConfig
return &p
}
// WithTracingBackend backend type (defaults to auto).
func (p StartParams) WithTracingBackend(tracingBackend Backend) *StartParams {
p.TracingBackend = tracingBackend
return &p
}
// Do executes Tracing.start against the provided context.
func (p *StartParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStart, p, nil)

Some files were not shown because too many files have changed in this diff Show More