Updating to latest protocol.json

This commit is contained in:
Kenneth Shaw 2017-12-22 10:07:54 +07:00
parent 69e069d131
commit 0faecc62db
6 changed files with 61 additions and 275 deletions

View File

@ -813,12 +813,10 @@ const (
CommandPerformanceDisable MethodType = "Performance.disable" CommandPerformanceDisable MethodType = "Performance.disable"
CommandPerformanceEnable MethodType = "Performance.enable" CommandPerformanceEnable MethodType = "Performance.enable"
CommandPerformanceGetMetrics MethodType = "Performance.getMetrics" CommandPerformanceGetMetrics MethodType = "Performance.getMetrics"
EventSecurityCertificateError MethodType = "Security.certificateError"
EventSecuritySecurityStateChanged MethodType = "Security.securityStateChanged" EventSecuritySecurityStateChanged MethodType = "Security.securityStateChanged"
CommandSecurityDisable MethodType = "Security.disable" CommandSecurityDisable MethodType = "Security.disable"
CommandSecurityEnable MethodType = "Security.enable" CommandSecurityEnable MethodType = "Security.enable"
CommandSecurityHandleCertificateError MethodType = "Security.handleCertificateError" CommandSecuritySetIgnoreCertificateErrors MethodType = "Security.setIgnoreCertificateErrors"
CommandSecuritySetOverrideCertificateErrors MethodType = "Security.setOverrideCertificateErrors"
EventServiceWorkerWorkerErrorReported MethodType = "ServiceWorker.workerErrorReported" EventServiceWorkerWorkerErrorReported MethodType = "ServiceWorker.workerErrorReported"
EventServiceWorkerWorkerRegistrationUpdated MethodType = "ServiceWorker.workerRegistrationUpdated" EventServiceWorkerWorkerRegistrationUpdated MethodType = "ServiceWorker.workerRegistrationUpdated"
EventServiceWorkerWorkerVersionUpdated MethodType = "ServiceWorker.workerVersionUpdated" EventServiceWorkerWorkerVersionUpdated MethodType = "ServiceWorker.workerVersionUpdated"
@ -1599,18 +1597,14 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CommandPerformanceEnable *t = CommandPerformanceEnable
case CommandPerformanceGetMetrics: case CommandPerformanceGetMetrics:
*t = CommandPerformanceGetMetrics *t = CommandPerformanceGetMetrics
case EventSecurityCertificateError:
*t = EventSecurityCertificateError
case EventSecuritySecurityStateChanged: case EventSecuritySecurityStateChanged:
*t = EventSecuritySecurityStateChanged *t = EventSecuritySecurityStateChanged
case CommandSecurityDisable: case CommandSecurityDisable:
*t = CommandSecurityDisable *t = CommandSecurityDisable
case CommandSecurityEnable: case CommandSecurityEnable:
*t = CommandSecurityEnable *t = CommandSecurityEnable
case CommandSecurityHandleCertificateError: case CommandSecuritySetIgnoreCertificateErrors:
*t = CommandSecurityHandleCertificateError *t = CommandSecuritySetIgnoreCertificateErrors
case CommandSecuritySetOverrideCertificateErrors:
*t = CommandSecuritySetOverrideCertificateErrors
case EventServiceWorkerWorkerErrorReported: case EventServiceWorkerWorkerErrorReported:
*t = EventServiceWorkerWorkerErrorReported *t = EventServiceWorkerWorkerErrorReported
case EventServiceWorkerWorkerRegistrationUpdated: case EventServiceWorkerWorkerRegistrationUpdated:

View File

@ -991,15 +991,9 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
case cdp.CommandSecurityEnable: case cdp.CommandSecurityEnable:
return emptyVal, nil return emptyVal, nil
case cdp.CommandSecurityHandleCertificateError: case cdp.CommandSecuritySetIgnoreCertificateErrors:
return emptyVal, nil return emptyVal, nil
case cdp.CommandSecuritySetOverrideCertificateErrors:
return emptyVal, nil
case cdp.EventSecurityCertificateError:
v = new(security.EventCertificateError)
case cdp.EventSecuritySecurityStateChanged: case cdp.EventSecuritySecurityStateChanged:
v = new(security.EventSecurityStateChanged) v = new(security.EventSecurityStateChanged)

View File

@ -180,7 +180,7 @@ func (v *StateExplanation) UnmarshalJSON(data []byte) error {
func (v *StateExplanation) UnmarshalEasyJSON(l *jlexer.Lexer) { func (v *StateExplanation) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity(l, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity(l, v)
} }
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(in *jlexer.Lexer, out *SetOverrideCertificateErrorsParams) { func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(in *jlexer.Lexer, out *SetIgnoreCertificateErrorsParams) {
isTopLevel := in.IsStart() isTopLevel := in.IsStart()
if in.IsNull() { if in.IsNull() {
if isTopLevel { if isTopLevel {
@ -199,8 +199,8 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(in *jlexer.Lexer, ou
continue continue
} }
switch key { switch key {
case "override": case "ignore":
out.Override = bool(in.Bool()) out.Ignore = bool(in.Bool())
default: default:
in.SkipRecursive() in.SkipRecursive()
} }
@ -211,44 +211,44 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(in *jlexer.Lexer, ou
in.Consumed() in.Consumed()
} }
} }
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(out *jwriter.Writer, in SetOverrideCertificateErrorsParams) { func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(out *jwriter.Writer, in SetIgnoreCertificateErrorsParams) {
out.RawByte('{') out.RawByte('{')
first := true first := true
_ = first _ = first
{ {
const prefix string = ",\"override\":" const prefix string = ",\"ignore\":"
if first { if first {
first = false first = false
out.RawString(prefix[1:]) out.RawString(prefix[1:])
} else { } else {
out.RawString(prefix) out.RawString(prefix)
} }
out.Bool(bool(in.Override)) out.Bool(bool(in.Ignore))
} }
out.RawByte('}') out.RawByte('}')
} }
// MarshalJSON supports json.Marshaler interface // MarshalJSON supports json.Marshaler interface
func (v SetOverrideCertificateErrorsParams) MarshalJSON() ([]byte, error) { func (v SetIgnoreCertificateErrorsParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{} w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(&w, v) easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(&w, v)
return w.Buffer.BuildBytes(), w.Error return w.Buffer.BuildBytes(), w.Error
} }
// MarshalEasyJSON supports easyjson.Marshaler interface // MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetOverrideCertificateErrorsParams) MarshalEasyJSON(w *jwriter.Writer) { func (v SetIgnoreCertificateErrorsParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(w, v) easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity1(w, v)
} }
// UnmarshalJSON supports json.Unmarshaler interface // UnmarshalJSON supports json.Unmarshaler interface
func (v *SetOverrideCertificateErrorsParams) UnmarshalJSON(data []byte) error { func (v *SetIgnoreCertificateErrorsParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data} r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(&r, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(&r, v)
return r.Error() return r.Error()
} }
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetOverrideCertificateErrorsParams) UnmarshalEasyJSON(l *jlexer.Lexer) { func (v *SetIgnoreCertificateErrorsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(l, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity1(l, v)
} }
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity2(in *jlexer.Lexer, out *InsecureContentStatus) { func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity2(in *jlexer.Lexer, out *InsecureContentStatus) {
@ -394,90 +394,7 @@ func (v *InsecureContentStatus) UnmarshalJSON(data []byte) error {
func (v *InsecureContentStatus) UnmarshalEasyJSON(l *jlexer.Lexer) { func (v *InsecureContentStatus) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity2(l, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity2(l, v)
} }
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity3(in *jlexer.Lexer, out *HandleCertificateErrorParams) { func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity3(in *jlexer.Lexer, out *EventSecurityStateChanged) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "eventId":
out.EventID = int64(in.Int64())
case "action":
(out.Action).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity3(out *jwriter.Writer, in HandleCertificateErrorParams) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"eventId\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.Int64(int64(in.EventID))
}
{
const prefix string = ",\"action\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
(in.Action).MarshalEasyJSON(out)
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v HandleCertificateErrorParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity3(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v HandleCertificateErrorParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity3(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *HandleCertificateErrorParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity3(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *HandleCertificateErrorParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity3(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity4(in *jlexer.Lexer, out *EventSecurityStateChanged) {
isTopLevel := in.IsStart() isTopLevel := in.IsStart()
if in.IsNull() { if in.IsNull() {
if isTopLevel { if isTopLevel {
@ -553,7 +470,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity4(in *jlexer.Lexer, ou
in.Consumed() in.Consumed()
} }
} }
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity4(out *jwriter.Writer, in EventSecurityStateChanged) { func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity3(out *jwriter.Writer, in EventSecurityStateChanged) {
out.RawByte('{') out.RawByte('{')
first := true first := true
_ = first _ = first
@ -632,122 +549,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity4(out *jwriter.Writer,
// MarshalJSON supports json.Marshaler interface // MarshalJSON supports json.Marshaler interface
func (v EventSecurityStateChanged) MarshalJSON() ([]byte, error) { func (v EventSecurityStateChanged) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{} w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity4(&w, v) easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity3(&w, v)
return w.Buffer.BuildBytes(), w.Error return w.Buffer.BuildBytes(), w.Error
} }
// MarshalEasyJSON supports easyjson.Marshaler interface // MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventSecurityStateChanged) MarshalEasyJSON(w *jwriter.Writer) { func (v EventSecurityStateChanged) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity4(w, v) easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity3(w, v)
} }
// UnmarshalJSON supports json.Unmarshaler interface // UnmarshalJSON supports json.Unmarshaler interface
func (v *EventSecurityStateChanged) UnmarshalJSON(data []byte) error { func (v *EventSecurityStateChanged) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data} r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity4(&r, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity3(&r, v)
return r.Error() return r.Error()
} }
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventSecurityStateChanged) UnmarshalEasyJSON(l *jlexer.Lexer) { func (v *EventSecurityStateChanged) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity4(l, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity3(l, v)
} }
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity5(in *jlexer.Lexer, out *EventCertificateError) { func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity4(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.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "eventId":
out.EventID = int64(in.Int64())
case "errorType":
out.ErrorType = string(in.String())
case "requestURL":
out.RequestURL = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity5(out *jwriter.Writer, in EventCertificateError) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"eventId\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.Int64(int64(in.EventID))
}
{
const prefix string = ",\"errorType\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.String(string(in.ErrorType))
}
{
const prefix string = ",\"requestURL\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.String(string(in.RequestURL))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v EventCertificateError) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity5(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v EventCertificateError) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity5(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *EventCertificateError) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity5(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EventCertificateError) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity5(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity6(in *jlexer.Lexer, out *EnableParams) {
isTopLevel := in.IsStart() isTopLevel := in.IsStart()
if in.IsNull() { if in.IsNull() {
if isTopLevel { if isTopLevel {
@ -776,7 +598,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity6(in *jlexer.Lexer, ou
in.Consumed() in.Consumed()
} }
} }
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity6(out *jwriter.Writer, in EnableParams) { func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity4(out *jwriter.Writer, in EnableParams) {
out.RawByte('{') out.RawByte('{')
first := true first := true
_ = first _ = first
@ -786,27 +608,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity6(out *jwriter.Writer,
// MarshalJSON supports json.Marshaler interface // MarshalJSON supports json.Marshaler interface
func (v EnableParams) MarshalJSON() ([]byte, error) { func (v EnableParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{} w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity6(&w, v) easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity4(&w, v)
return w.Buffer.BuildBytes(), w.Error return w.Buffer.BuildBytes(), w.Error
} }
// MarshalEasyJSON supports easyjson.Marshaler interface // MarshalEasyJSON supports easyjson.Marshaler interface
func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) { func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity6(w, v) easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity4(w, v)
} }
// UnmarshalJSON supports json.Unmarshaler interface // UnmarshalJSON supports json.Unmarshaler interface
func (v *EnableParams) UnmarshalJSON(data []byte) error { func (v *EnableParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data} r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity6(&r, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity4(&r, v)
return r.Error() return r.Error()
} }
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) { func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity6(l, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity4(l, v)
} }
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity7(in *jlexer.Lexer, out *DisableParams) { func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity5(in *jlexer.Lexer, out *DisableParams) {
isTopLevel := in.IsStart() isTopLevel := in.IsStart()
if in.IsNull() { if in.IsNull() {
if isTopLevel { if isTopLevel {
@ -835,7 +657,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity7(in *jlexer.Lexer, ou
in.Consumed() in.Consumed()
} }
} }
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity7(out *jwriter.Writer, in DisableParams) { func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity5(out *jwriter.Writer, in DisableParams) {
out.RawByte('{') out.RawByte('{')
first := true first := true
_ = first _ = first
@ -845,23 +667,23 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity7(out *jwriter.Writer,
// MarshalJSON supports json.Marshaler interface // MarshalJSON supports json.Marshaler interface
func (v DisableParams) MarshalJSON() ([]byte, error) { func (v DisableParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{} w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity7(&w, v) easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity5(&w, v)
return w.Buffer.BuildBytes(), w.Error return w.Buffer.BuildBytes(), w.Error
} }
// MarshalEasyJSON supports easyjson.Marshaler interface // MarshalEasyJSON supports easyjson.Marshaler interface
func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer) { func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity7(w, v) easyjsonC5a4559bEncodeGithubComKnqChromedpCdpSecurity5(w, v)
} }
// UnmarshalJSON supports json.Unmarshaler interface // UnmarshalJSON supports json.Unmarshaler interface
func (v *DisableParams) UnmarshalJSON(data []byte) error { func (v *DisableParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data} r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity7(&r, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity5(&r, v)
return r.Error() return r.Error()
} }
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) { func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity7(l, v) easyjsonC5a4559bDecodeGithubComKnqChromedpCdpSecurity5(l, v)
} }

View File

@ -6,16 +6,6 @@ import (
cdp "github.com/knq/chromedp/cdp" cdp "github.com/knq/chromedp/cdp"
) )
// EventCertificateError there is a certificate error. If overriding
// certificate errors is enabled, then it should be handled with the
// handleCertificateError command. Note: this event does not fire if the
// certificate error has been allowed internally.
type EventCertificateError struct {
EventID int64 `json:"eventId"` // The ID of the event.
ErrorType string `json:"errorType"` // The type of the error.
RequestURL string `json:"requestURL"` // The url that was requested.
}
// EventSecurityStateChanged the security state of the page changed. // EventSecurityStateChanged the security state of the page changed.
type EventSecurityStateChanged struct { type EventSecurityStateChanged struct {
SecurityState State `json:"securityState"` // Security state. SecurityState State `json:"securityState"` // Security state.
@ -27,6 +17,5 @@ type EventSecurityStateChanged struct {
// EventTypes all event types in the domain. // EventTypes all event types in the domain.
var EventTypes = []cdp.MethodType{ var EventTypes = []cdp.MethodType{
cdp.EventSecurityCertificateError,
cdp.EventSecuritySecurityStateChanged, cdp.EventSecuritySecurityStateChanged,
} }

View File

@ -42,53 +42,25 @@ func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandSecurityEnable, nil, nil) return h.Execute(ctxt, cdp.CommandSecurityEnable, nil, nil)
} }
// HandleCertificateErrorParams handles a certificate error that fired a // SetIgnoreCertificateErrorsParams enable/disable whether all certificate
// certificateError event. // errors should be ignored.
type HandleCertificateErrorParams struct { type SetIgnoreCertificateErrorsParams struct {
EventID int64 `json:"eventId"` // The ID of the event. Ignore bool `json:"ignore"` // If true, all certificate errors will be ignored.
Action CertificateErrorAction `json:"action"` // The action to take on the certificate error.
} }
// HandleCertificateError handles a certificate error that fired a // SetIgnoreCertificateErrors enable/disable whether all certificate errors
// certificateError event. // should be ignored.
// //
// parameters: // parameters:
// eventID - The ID of the event. // ignore - If true, all certificate errors will be ignored.
// action - The action to take on the certificate error. func SetIgnoreCertificateErrors(ignore bool) *SetIgnoreCertificateErrorsParams {
func HandleCertificateError(eventID int64, action CertificateErrorAction) *HandleCertificateErrorParams { return &SetIgnoreCertificateErrorsParams{
return &HandleCertificateErrorParams{ Ignore: ignore,
EventID: eventID,
Action: action,
} }
} }
// Do executes Security.handleCertificateError against the provided context and // Do executes Security.setIgnoreCertificateErrors against the provided context and
// target handler. // target handler.
func (p *HandleCertificateErrorParams) Do(ctxt context.Context, h cdp.Handler) (err error) { func (p *SetIgnoreCertificateErrorsParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandSecurityHandleCertificateError, p, nil) return h.Execute(ctxt, cdp.CommandSecuritySetIgnoreCertificateErrors, p, nil)
}
// SetOverrideCertificateErrorsParams enable/disable overriding certificate
// errors. If enabled, all certificate error events need to be handled by the
// DevTools client and should be answered with handleCertificateError commands.
type SetOverrideCertificateErrorsParams struct {
Override bool `json:"override"` // If true, certificate errors will be overridden.
}
// SetOverrideCertificateErrors enable/disable overriding certificate errors.
// If enabled, all certificate error events need to be handled by the DevTools
// client and should be answered with handleCertificateError commands.
//
// parameters:
// override - If true, certificate errors will be overridden.
func SetOverrideCertificateErrors(override bool) *SetOverrideCertificateErrorsParams {
return &SetOverrideCertificateErrorsParams{
Override: override,
}
}
// Do executes Security.setOverrideCertificateErrors against the provided context and
// target handler.
func (p *SetOverrideCertificateErrorsParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandSecuritySetOverrideCertificateErrors, p, nil)
} }

View File

@ -10718,9 +10718,22 @@
"name": "enable", "name": "enable",
"description": "Enables tracking security state changes." "description": "Enables tracking security state changes."
}, },
{
"name": "setIgnoreCertificateErrors",
"description": "Enable/disable whether all certificate errors should be ignored.",
"experimental": true,
"parameters": [
{
"name": "ignore",
"description": "If true, all certificate errors will be ignored.",
"type": "boolean"
}
]
},
{ {
"name": "handleCertificateError", "name": "handleCertificateError",
"description": "Handles a certificate error that fired a certificateError event.", "description": "Handles a certificate error that fired a certificateError event.",
"deprecated": true,
"parameters": [ "parameters": [
{ {
"name": "eventId", "name": "eventId",
@ -10737,6 +10750,7 @@
{ {
"name": "setOverrideCertificateErrors", "name": "setOverrideCertificateErrors",
"description": "Enable/disable overriding certificate errors. If enabled, all certificate error events need to\nbe handled by the DevTools client and should be answered with handleCertificateError commands.", "description": "Enable/disable overriding certificate errors. If enabled, all certificate error events need to\nbe handled by the DevTools client and should be answered with handleCertificateError commands.",
"deprecated": true,
"parameters": [ "parameters": [
{ {
"name": "override", "name": "override",
@ -10749,7 +10763,8 @@
"events": [ "events": [
{ {
"name": "certificateError", "name": "certificateError",
"description": "There is a certificate error. If overriding certificate errors is enabled, then it should be\nhandled with the handleCertificateError command. Note: this event does not fire if the\ncertificate error has been allowed internally.", "description": "There is a certificate error. If overriding certificate errors is enabled, then it should be\nhandled with the handleCertificateError command. Note: this event does not fire if the\ncertificate error has been allowed internally. Only one client per target should override\ncertificate errors at the same time.",
"deprecated": true,
"parameters": [ "parameters": [
{ {
"name": "eventId", "name": "eventId",