Adding faviconURL field to client.Chrome

This commit is contained in:
Kenneth Shaw 2017-07-14 13:58:33 +07:00
parent b9e4c14157
commit 5c732ec7c4
3 changed files with 14 additions and 0 deletions

View File

@ -15,6 +15,7 @@ type Chrome struct {
Type TargetType `json:"type,omitempty"`
URL string `json:"url,omitempty"`
WebsocketURL string `json:"webSocketDebuggerUrl,omitempty"`
FaviconURL string `json:"faviconURL,omitempty"`
}
// String satisfies the stringer interface.

View File

@ -50,6 +50,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpClient(in *jlexer.Lexer, out *Chr
out.URL = string(in.String())
case "webSocketDebuggerUrl":
out.WebsocketURL = string(in.String())
case "faviconURL":
out.FaviconURL = string(in.String())
default:
in.SkipRecursive()
}
@ -120,6 +122,14 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpClient(out *jwriter.Writer, in Ch
out.RawString("\"webSocketDebuggerUrl\":")
out.String(string(in.WebsocketURL))
}
if in.FaviconURL != "" {
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"faviconURL\":")
out.String(string(in.FaviconURL))
}
out.RawByte('}')
}

View File

@ -25,6 +25,7 @@ const (
Other TargetType = "other"
Page TargetType = "page"
ServiceWorker TargetType = "service_worker"
Node TargetType = "node"
)
// String satisfies stringer.
@ -53,6 +54,8 @@ func (tt *TargetType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*tt = Page
case ServiceWorker:
*tt = ServiceWorker
case Node:
*tt = Node
default:
in.AddError(errors.New("unknown TargetType"))