Updating to latest protocol.json

This commit is contained in:
Kenneth Shaw 2017-07-11 10:39:08 +07:00
parent 60b7898f53
commit 2dda4650cf
3 changed files with 46 additions and 15 deletions

View File

@ -803,20 +803,32 @@ func (p *SetInspectedNodeParams) Do(ctxt context.Context, h cdp.Handler) (err er
return h.Execute(ctxt, cdp.CommandDOMSetInspectedNode, p, nil)
}
// ResolveNodeParams resolves JavaScript node object for given node id.
// ResolveNodeParams resolves the JavaScript node object for a given NodeId
// or BackendNodeId.
type ResolveNodeParams struct {
NodeID cdp.NodeID `json:"nodeId"` // Id of the node to resolve.
NodeID cdp.NodeID `json:"nodeId,omitempty"` // Id of the node to resolve.
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // Backend identifier of the node to resolve.
ObjectGroup string `json:"objectGroup,omitempty"` // Symbolic group name that can be used to release multiple objects.
}
// ResolveNode resolves JavaScript node object for given node id.
// ResolveNode resolves the JavaScript node object for a given NodeId or
// BackendNodeId.
//
// parameters:
// nodeID - Id of the node to resolve.
func ResolveNode(nodeID cdp.NodeID) *ResolveNodeParams {
return &ResolveNodeParams{
NodeID: nodeID,
func ResolveNode() *ResolveNodeParams {
return &ResolveNodeParams{}
}
// WithNodeID id of the node to resolve.
func (p ResolveNodeParams) WithNodeID(nodeID cdp.NodeID) *ResolveNodeParams {
p.NodeID = nodeID
return &p
}
// WithBackendNodeID backend identifier of the node to resolve.
func (p ResolveNodeParams) WithBackendNodeID(backendNodeID cdp.BackendNodeID) *ResolveNodeParams {
p.BackendNodeID = backendNodeID
return &p
}
// WithObjectGroup symbolic group name that can be used to release multiple

View File

@ -995,6 +995,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpDom11(in *jlexer.Lexer, out *R
switch key {
case "nodeId":
(out.NodeID).UnmarshalEasyJSON(in)
case "backendNodeId":
(out.BackendNodeID).UnmarshalEasyJSON(in)
case "objectGroup":
out.ObjectGroup = string(in.String())
default:
@ -1011,12 +1013,22 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpDom11(out *jwriter.Writer, in
out.RawByte('{')
first := true
_ = first
if in.NodeID != 0 {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"nodeId\":")
out.Int64(int64(in.NodeID))
}
if in.BackendNodeID != 0 {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"backendNodeId\":")
out.Int64(int64(in.BackendNodeID))
}
if in.ObjectGroup != "" {
if !first {
out.RawByte(',')

View File

@ -5874,8 +5874,15 @@
{
"name": "nodeId",
"$ref": "NodeId",
"optional": true,
"description": "Id of the node to resolve."
},
{
"name": "backendNodeId",
"$ref": "DOM.BackendNodeId",
"optional": true,
"description": "Backend identifier of the node to resolve."
},
{
"name": "objectGroup",
"type": "string",
@ -5890,7 +5897,7 @@
"description": "JavaScript object wrapper for given node."
}
],
"description": "Resolves JavaScript node object for given node id."
"description": "Resolves the JavaScript node object for a given NodeId or BackendNodeId."
},
{
"name": "getAttributes",