From 5c732ec7c4ffe86e0021c208f00fdd5c9ee3b86b Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Fri, 14 Jul 2017 13:58:33 +0700 Subject: [PATCH] Adding faviconURL field to client.Chrome --- client/chrome.go | 1 + client/easyjson.go | 10 ++++++++++ client/target.go | 3 +++ 3 files changed, 14 insertions(+) diff --git a/client/chrome.go b/client/chrome.go index b8e9609..039f897 100644 --- a/client/chrome.go +++ b/client/chrome.go @@ -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. diff --git a/client/easyjson.go b/client/easyjson.go index 14c5661..2517a71 100644 --- a/client/easyjson.go +++ b/client/easyjson.go @@ -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('}') } diff --git a/client/target.go b/client/target.go index b49b73d..16a3d21 100644 --- a/client/target.go +++ b/client/target.go @@ -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"))