Updating to latest chrome protocol.json
This commit is contained in:
parent
58283934b9
commit
4ff7580243
|
@ -174,6 +174,7 @@ const (
|
||||||
CommandIndexedDBRequestDatabase MethodType = "IndexedDB.requestDatabase"
|
CommandIndexedDBRequestDatabase MethodType = "IndexedDB.requestDatabase"
|
||||||
CommandIndexedDBRequestData MethodType = "IndexedDB.requestData"
|
CommandIndexedDBRequestData MethodType = "IndexedDB.requestData"
|
||||||
CommandIndexedDBClearObjectStore MethodType = "IndexedDB.clearObjectStore"
|
CommandIndexedDBClearObjectStore MethodType = "IndexedDB.clearObjectStore"
|
||||||
|
CommandIndexedDBDeleteDatabase MethodType = "IndexedDB.deleteDatabase"
|
||||||
CommandCacheStorageRequestCacheNames MethodType = "CacheStorage.requestCacheNames"
|
CommandCacheStorageRequestCacheNames MethodType = "CacheStorage.requestCacheNames"
|
||||||
CommandCacheStorageRequestEntries MethodType = "CacheStorage.requestEntries"
|
CommandCacheStorageRequestEntries MethodType = "CacheStorage.requestEntries"
|
||||||
CommandCacheStorageDeleteCache MethodType = "CacheStorage.deleteCache"
|
CommandCacheStorageDeleteCache MethodType = "CacheStorage.deleteCache"
|
||||||
|
@ -713,6 +714,8 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
*t = CommandIndexedDBRequestData
|
*t = CommandIndexedDBRequestData
|
||||||
case CommandIndexedDBClearObjectStore:
|
case CommandIndexedDBClearObjectStore:
|
||||||
*t = CommandIndexedDBClearObjectStore
|
*t = CommandIndexedDBClearObjectStore
|
||||||
|
case CommandIndexedDBDeleteDatabase:
|
||||||
|
*t = CommandIndexedDBDeleteDatabase
|
||||||
case CommandCacheStorageRequestCacheNames:
|
case CommandCacheStorageRequestCacheNames:
|
||||||
*t = CommandCacheStorageRequestCacheNames
|
*t = CommandCacheStorageRequestCacheNames
|
||||||
case CommandCacheStorageRequestEntries:
|
case CommandCacheStorageRequestEntries:
|
||||||
|
|
|
@ -1355,7 +1355,82 @@ func (v *DisableParams) UnmarshalJSON(data []byte) error {
|
||||||
func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb12(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb12(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(in *jlexer.Lexer, out *DatabaseWithObjectStores) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(in *jlexer.Lexer, out *DeleteDatabaseParams) {
|
||||||
|
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 "securityOrigin":
|
||||||
|
out.SecurityOrigin = string(in.String())
|
||||||
|
case "databaseName":
|
||||||
|
out.DatabaseName = string(in.String())
|
||||||
|
default:
|
||||||
|
in.SkipRecursive()
|
||||||
|
}
|
||||||
|
in.WantComma()
|
||||||
|
}
|
||||||
|
in.Delim('}')
|
||||||
|
if isTopLevel {
|
||||||
|
in.Consumed()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(out *jwriter.Writer, in DeleteDatabaseParams) {
|
||||||
|
out.RawByte('{')
|
||||||
|
first := true
|
||||||
|
_ = first
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"securityOrigin\":")
|
||||||
|
out.String(string(in.SecurityOrigin))
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"databaseName\":")
|
||||||
|
out.String(string(in.DatabaseName))
|
||||||
|
out.RawByte('}')
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON supports json.Marshaler interface
|
||||||
|
func (v DeleteDatabaseParams) MarshalJSON() ([]byte, error) {
|
||||||
|
w := jwriter.Writer{}
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(&w, v)
|
||||||
|
return w.Buffer.BuildBytes(), w.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
||||||
|
func (v DeleteDatabaseParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(w, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
|
func (v *DeleteDatabaseParams) UnmarshalJSON(data []byte) error {
|
||||||
|
r := jlexer.Lexer{Data: data}
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(&r, v)
|
||||||
|
return r.Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
|
func (v *DeleteDatabaseParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(l, v)
|
||||||
|
}
|
||||||
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(in *jlexer.Lexer, out *DatabaseWithObjectStores) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -1415,7 +1490,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(in *jlexer.Lexer,
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(out *jwriter.Writer, in DatabaseWithObjectStores) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(out *jwriter.Writer, in DatabaseWithObjectStores) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -1464,27 +1539,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(out *jwriter.Write
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v DatabaseWithObjectStores) MarshalJSON() ([]byte, error) {
|
func (v DatabaseWithObjectStores) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(&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 DatabaseWithObjectStores) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v DatabaseWithObjectStores) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *DatabaseWithObjectStores) UnmarshalJSON(data []byte) error {
|
func (v *DatabaseWithObjectStores) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *DatabaseWithObjectStores) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *DatabaseWithObjectStores) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(in *jlexer.Lexer, out *DataEntry) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(in *jlexer.Lexer, out *DataEntry) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -1543,7 +1618,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(in *jlexer.Lexer,
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(out *jwriter.Writer, in DataEntry) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(out *jwriter.Writer, in DataEntry) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -1589,27 +1664,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(out *jwriter.Write
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v DataEntry) MarshalJSON() ([]byte, error) {
|
func (v DataEntry) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(&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 DataEntry) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v DataEntry) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *DataEntry) UnmarshalJSON(data []byte) error {
|
func (v *DataEntry) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *DataEntry) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *DataEntry) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(l, v)
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(in *jlexer.Lexer, out *ClearObjectStoreParams) {
|
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb16(in *jlexer.Lexer, out *ClearObjectStoreParams) {
|
||||||
isTopLevel := in.IsStart()
|
isTopLevel := in.IsStart()
|
||||||
if in.IsNull() {
|
if in.IsNull() {
|
||||||
if isTopLevel {
|
if isTopLevel {
|
||||||
|
@ -1644,7 +1719,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(in *jlexer.Lexer,
|
||||||
in.Consumed()
|
in.Consumed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(out *jwriter.Writer, in ClearObjectStoreParams) {
|
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(out *jwriter.Writer, in ClearObjectStoreParams) {
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
@ -1672,23 +1747,23 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(out *jwriter.Write
|
||||||
// MarshalJSON supports json.Marshaler interface
|
// MarshalJSON supports json.Marshaler interface
|
||||||
func (v ClearObjectStoreParams) MarshalJSON() ([]byte, error) {
|
func (v ClearObjectStoreParams) MarshalJSON() ([]byte, error) {
|
||||||
w := jwriter.Writer{}
|
w := jwriter.Writer{}
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(&w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(&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 ClearObjectStoreParams) MarshalEasyJSON(w *jwriter.Writer) {
|
func (v ClearObjectStoreParams) MarshalEasyJSON(w *jwriter.Writer) {
|
||||||
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(w, v)
|
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(w, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON supports json.Unmarshaler interface
|
// UnmarshalJSON supports json.Unmarshaler interface
|
||||||
func (v *ClearObjectStoreParams) UnmarshalJSON(data []byte) error {
|
func (v *ClearObjectStoreParams) UnmarshalJSON(data []byte) error {
|
||||||
r := jlexer.Lexer{Data: data}
|
r := jlexer.Lexer{Data: data}
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(&r, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb16(&r, v)
|
||||||
return r.Error()
|
return r.Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
||||||
func (v *ClearObjectStoreParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
func (v *ClearObjectStoreParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
||||||
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(l, v)
|
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb16(l, v)
|
||||||
}
|
}
|
||||||
|
|
|
@ -377,3 +377,58 @@ func (p *ClearObjectStoreParams) Do(ctxt context.Context, h cdp.FrameHandler) (e
|
||||||
|
|
||||||
return cdp.ErrUnknownResult
|
return cdp.ErrUnknownResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DeleteDatabaseParams deletes a database.
|
||||||
|
type DeleteDatabaseParams struct {
|
||||||
|
SecurityOrigin string `json:"securityOrigin"` // Security origin.
|
||||||
|
DatabaseName string `json:"databaseName"` // Database name.
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteDatabase deletes a database.
|
||||||
|
//
|
||||||
|
// parameters:
|
||||||
|
// securityOrigin - Security origin.
|
||||||
|
// databaseName - Database name.
|
||||||
|
func DeleteDatabase(securityOrigin string, databaseName string) *DeleteDatabaseParams {
|
||||||
|
return &DeleteDatabaseParams{
|
||||||
|
SecurityOrigin: securityOrigin,
|
||||||
|
DatabaseName: databaseName,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do executes IndexedDB.deleteDatabase.
|
||||||
|
func (p *DeleteDatabaseParams) Do(ctxt context.Context, h cdp.FrameHandler) (err error) {
|
||||||
|
if ctxt == nil {
|
||||||
|
ctxt = context.Background()
|
||||||
|
}
|
||||||
|
|
||||||
|
// marshal
|
||||||
|
buf, err := easyjson.Marshal(p)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// execute
|
||||||
|
ch := h.Execute(ctxt, cdp.CommandIndexedDBDeleteDatabase, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
|
// read response
|
||||||
|
select {
|
||||||
|
case res := <-ch:
|
||||||
|
if res == nil {
|
||||||
|
return cdp.ErrChannelClosed
|
||||||
|
}
|
||||||
|
|
||||||
|
switch v := res.(type) {
|
||||||
|
case easyjson.RawMessage:
|
||||||
|
return nil
|
||||||
|
|
||||||
|
case error:
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
|
||||||
|
case <-ctxt.Done():
|
||||||
|
return cdp.ErrContextDone
|
||||||
|
}
|
||||||
|
|
||||||
|
return cdp.ErrUnknownResult
|
||||||
|
}
|
||||||
|
|
|
@ -484,7 +484,6 @@ func (t InitiatorType) String() string {
|
||||||
const (
|
const (
|
||||||
InitiatorTypeParser InitiatorType = "parser"
|
InitiatorTypeParser InitiatorType = "parser"
|
||||||
InitiatorTypeScript InitiatorType = "script"
|
InitiatorTypeScript InitiatorType = "script"
|
||||||
InitiatorTypePreload InitiatorType = "preload"
|
|
||||||
InitiatorTypeOther InitiatorType = "other"
|
InitiatorTypeOther InitiatorType = "other"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -505,8 +504,6 @@ func (t *InitiatorType) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
*t = InitiatorTypeParser
|
*t = InitiatorTypeParser
|
||||||
case InitiatorTypeScript:
|
case InitiatorTypeScript:
|
||||||
*t = InitiatorTypeScript
|
*t = InitiatorTypeScript
|
||||||
case InitiatorTypePreload:
|
|
||||||
*t = InitiatorTypePreload
|
|
||||||
case InitiatorTypeOther:
|
case InitiatorTypeOther:
|
||||||
*t = InitiatorTypeOther
|
*t = InitiatorTypeOther
|
||||||
|
|
||||||
|
|
|
@ -4552,6 +4552,10 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPage56(in *jlexer.Lexer, out *
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
switch key {
|
switch key {
|
||||||
|
case "format":
|
||||||
|
(out.Format).UnmarshalEasyJSON(in)
|
||||||
|
case "quality":
|
||||||
|
out.Quality = int64(in.Int64())
|
||||||
default:
|
default:
|
||||||
in.SkipRecursive()
|
in.SkipRecursive()
|
||||||
}
|
}
|
||||||
|
@ -4566,6 +4570,22 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPage56(out *jwriter.Writer, in
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
first := true
|
first := true
|
||||||
_ = first
|
_ = first
|
||||||
|
if in.Format != "" {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"format\":")
|
||||||
|
(in.Format).MarshalEasyJSON(out)
|
||||||
|
}
|
||||||
|
if in.Quality != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"quality\":")
|
||||||
|
out.Int64(int64(in.Quality))
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -830,29 +830,52 @@ func (p *SetDocumentContentParams) Do(ctxt context.Context, h cdp.FrameHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CaptureScreenshotParams capture page screenshot.
|
// CaptureScreenshotParams capture page screenshot.
|
||||||
type CaptureScreenshotParams struct{}
|
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).
|
||||||
|
}
|
||||||
|
|
||||||
// CaptureScreenshot capture page screenshot.
|
// CaptureScreenshot capture page screenshot.
|
||||||
|
//
|
||||||
|
// parameters:
|
||||||
func CaptureScreenshot() *CaptureScreenshotParams {
|
func CaptureScreenshot() *CaptureScreenshotParams {
|
||||||
return &CaptureScreenshotParams{}
|
return &CaptureScreenshotParams{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithFormat image compression format (defaults to png).
|
||||||
|
func (p CaptureScreenshotParams) WithFormat(format CaptureScreenshotFormat) *CaptureScreenshotParams {
|
||||||
|
p.Format = format
|
||||||
|
return &p
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithQuality compression quality from range [0..100] (jpeg only).
|
||||||
|
func (p CaptureScreenshotParams) WithQuality(quality int64) *CaptureScreenshotParams {
|
||||||
|
p.Quality = quality
|
||||||
|
return &p
|
||||||
|
}
|
||||||
|
|
||||||
// CaptureScreenshotReturns return values.
|
// CaptureScreenshotReturns return values.
|
||||||
type CaptureScreenshotReturns struct {
|
type CaptureScreenshotReturns struct {
|
||||||
Data string `json:"data,omitempty"` // Base64-encoded image data (PNG).
|
Data string `json:"data,omitempty"` // Base64-encoded image data.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do executes Page.captureScreenshot.
|
// Do executes Page.captureScreenshot.
|
||||||
//
|
//
|
||||||
// returns:
|
// returns:
|
||||||
// data - Base64-encoded image data (PNG).
|
// data - Base64-encoded image data.
|
||||||
func (p *CaptureScreenshotParams) Do(ctxt context.Context, h cdp.FrameHandler) (data []byte, err error) {
|
func (p *CaptureScreenshotParams) Do(ctxt context.Context, h cdp.FrameHandler) (data []byte, err error) {
|
||||||
if ctxt == nil {
|
if ctxt == nil {
|
||||||
ctxt = context.Background()
|
ctxt = context.Background()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// marshal
|
||||||
|
buf, err := easyjson.Marshal(p)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
ch := h.Execute(ctxt, cdp.CommandPageCaptureScreenshot, cdp.Empty)
|
ch := h.Execute(ctxt, cdp.CommandPageCaptureScreenshot, easyjson.RawMessage(buf))
|
||||||
|
|
||||||
// read response
|
// read response
|
||||||
select {
|
select {
|
||||||
|
|
|
@ -253,6 +253,48 @@ type VisualViewport struct {
|
||||||
Scale float64 `json:"scale,omitempty"` // Scale relative to the ideal viewport (size at width=device-width).
|
Scale float64 `json:"scale,omitempty"` // Scale relative to the ideal viewport (size at width=device-width).
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CaptureScreenshotFormat image compression format (defaults to png).
|
||||||
|
type CaptureScreenshotFormat string
|
||||||
|
|
||||||
|
// String returns the CaptureScreenshotFormat as string value.
|
||||||
|
func (t CaptureScreenshotFormat) String() string {
|
||||||
|
return string(t)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CaptureScreenshotFormat values.
|
||||||
|
const (
|
||||||
|
CaptureScreenshotFormatJpeg CaptureScreenshotFormat = "jpeg"
|
||||||
|
CaptureScreenshotFormatPng CaptureScreenshotFormat = "png"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
||||||
|
func (t CaptureScreenshotFormat) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
|
out.String(string(t))
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON satisfies json.Marshaler.
|
||||||
|
func (t CaptureScreenshotFormat) MarshalJSON() ([]byte, error) {
|
||||||
|
return easyjson.Marshal(t)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
|
||||||
|
func (t *CaptureScreenshotFormat) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
|
switch CaptureScreenshotFormat(in.String()) {
|
||||||
|
case CaptureScreenshotFormatJpeg:
|
||||||
|
*t = CaptureScreenshotFormatJpeg
|
||||||
|
case CaptureScreenshotFormatPng:
|
||||||
|
*t = CaptureScreenshotFormatPng
|
||||||
|
|
||||||
|
default:
|
||||||
|
in.AddError(errors.New("unknown CaptureScreenshotFormat value"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON satisfies json.Unmarshaler.
|
||||||
|
func (t *CaptureScreenshotFormat) UnmarshalJSON(buf []byte) error {
|
||||||
|
return easyjson.Unmarshal(buf, t)
|
||||||
|
}
|
||||||
|
|
||||||
// ScreencastFormat image compression format.
|
// ScreencastFormat image compression format.
|
||||||
type ScreencastFormat string
|
type ScreencastFormat string
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,16 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpRuntime(in *jlexer.Lexer, out
|
||||||
}
|
}
|
||||||
(*out.Parent).UnmarshalEasyJSON(in)
|
(*out.Parent).UnmarshalEasyJSON(in)
|
||||||
}
|
}
|
||||||
|
case "promiseCreationFrame":
|
||||||
|
if in.IsNull() {
|
||||||
|
in.Skip()
|
||||||
|
out.PromiseCreationFrame = nil
|
||||||
|
} else {
|
||||||
|
if out.PromiseCreationFrame == nil {
|
||||||
|
out.PromiseCreationFrame = new(CallFrame)
|
||||||
|
}
|
||||||
|
(*out.PromiseCreationFrame).UnmarshalEasyJSON(in)
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
in.SkipRecursive()
|
in.SkipRecursive()
|
||||||
}
|
}
|
||||||
|
@ -132,6 +142,18 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpRuntime(out *jwriter.Writer, i
|
||||||
(*in.Parent).MarshalEasyJSON(out)
|
(*in.Parent).MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if in.PromiseCreationFrame != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
}
|
||||||
|
first = false
|
||||||
|
out.RawString("\"promiseCreationFrame\":")
|
||||||
|
if in.PromiseCreationFrame == nil {
|
||||||
|
out.RawString("null")
|
||||||
|
} else {
|
||||||
|
(*in.PromiseCreationFrame).MarshalEasyJSON(out)
|
||||||
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,6 +195,7 @@ type StackTrace struct {
|
||||||
Description string `json:"description,omitempty"` // String label of this stack trace. For async traces this may be a name of the function that initiated the async call.
|
Description string `json:"description,omitempty"` // String label of this stack trace. For async traces this may be a name of the function that initiated the async call.
|
||||||
CallFrames []*CallFrame `json:"callFrames,omitempty"` // JavaScript function name.
|
CallFrames []*CallFrame `json:"callFrames,omitempty"` // JavaScript function name.
|
||||||
Parent *StackTrace `json:"parent,omitempty"` // Asynchronous JavaScript stack trace that preceded this stack, if available.
|
Parent *StackTrace `json:"parent,omitempty"` // Asynchronous JavaScript stack trace that preceded this stack, if available.
|
||||||
|
PromiseCreationFrame *CallFrame `json:"promiseCreationFrame,omitempty"` // Creation frame of the Promise which produced the next synchronous trace when resolved, if available.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type object type.
|
// Type object type.
|
||||||
|
@ -358,6 +359,8 @@ const (
|
||||||
APITypeAssert APIType = "assert"
|
APITypeAssert APIType = "assert"
|
||||||
APITypeProfile APIType = "profile"
|
APITypeProfile APIType = "profile"
|
||||||
APITypeProfileEnd APIType = "profileEnd"
|
APITypeProfileEnd APIType = "profileEnd"
|
||||||
|
APITypeCount APIType = "count"
|
||||||
|
APITypeTimeEnd APIType = "timeEnd"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
// MarshalEasyJSON satisfies easyjson.Marshaler.
|
||||||
|
@ -405,6 +408,10 @@ func (t *APIType) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
*t = APITypeProfile
|
*t = APITypeProfile
|
||||||
case APITypeProfileEnd:
|
case APITypeProfileEnd:
|
||||||
*t = APITypeProfileEnd
|
*t = APITypeProfileEnd
|
||||||
|
case APITypeCount:
|
||||||
|
*t = APITypeCount
|
||||||
|
case APITypeTimeEnd:
|
||||||
|
*t = APITypeTimeEnd
|
||||||
|
|
||||||
default:
|
default:
|
||||||
in.AddError(errors.New("unknown APIType value"))
|
in.AddError(errors.New("unknown APIType value"))
|
||||||
|
|
|
@ -421,6 +421,9 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
|
||||||
case cdp.CommandIndexedDBClearObjectStore:
|
case cdp.CommandIndexedDBClearObjectStore:
|
||||||
return emptyVal, nil
|
return emptyVal, nil
|
||||||
|
|
||||||
|
case cdp.CommandIndexedDBDeleteDatabase:
|
||||||
|
return emptyVal, nil
|
||||||
|
|
||||||
case cdp.CommandCacheStorageRequestCacheNames:
|
case cdp.CommandCacheStorageRequestCacheNames:
|
||||||
v = new(cachestorage.RequestCacheNamesReturns)
|
v = new(cachestorage.RequestCacheNamesReturns)
|
||||||
|
|
||||||
|
|
|
@ -879,11 +879,29 @@
|
||||||
{
|
{
|
||||||
"name": "captureScreenshot",
|
"name": "captureScreenshot",
|
||||||
"description": "Capture page screenshot.",
|
"description": "Capture page screenshot.",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "format",
|
||||||
|
"type": "string",
|
||||||
|
"optional": true,
|
||||||
|
"enum": [
|
||||||
|
"jpeg",
|
||||||
|
"png"
|
||||||
|
],
|
||||||
|
"description": "Image compression format (defaults to png)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "quality",
|
||||||
|
"type": "integer",
|
||||||
|
"optional": true,
|
||||||
|
"description": "Compression quality from range [0..100] (jpeg only)."
|
||||||
|
}
|
||||||
|
],
|
||||||
"returns": [
|
"returns": [
|
||||||
{
|
{
|
||||||
"name": "data",
|
"name": "data",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Base64-encoded image data (PNG)."
|
"description": "Base64-encoded image data."
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"experimental": true
|
"experimental": true
|
||||||
|
@ -2387,7 +2405,6 @@
|
||||||
"enum": [
|
"enum": [
|
||||||
"parser",
|
"parser",
|
||||||
"script",
|
"script",
|
||||||
"preload",
|
|
||||||
"other"
|
"other"
|
||||||
],
|
],
|
||||||
"description": "Type of this initiator."
|
"description": "Type of this initiator."
|
||||||
|
@ -3738,6 +3755,23 @@
|
||||||
],
|
],
|
||||||
"returns": [],
|
"returns": [],
|
||||||
"description": "Clears all entries from an object store."
|
"description": "Clears all entries from an object store."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "deleteDatabase",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "securityOrigin",
|
||||||
|
"type": "string",
|
||||||
|
"description": "Security origin."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "databaseName",
|
||||||
|
"type": "string",
|
||||||
|
"description": "Database name."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returns": [],
|
||||||
|
"description": "Deletes a database."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -10575,6 +10609,13 @@
|
||||||
"$ref": "StackTrace",
|
"$ref": "StackTrace",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"description": "Asynchronous JavaScript stack trace that preceded this stack, if available."
|
"description": "Asynchronous JavaScript stack trace that preceded this stack, if available."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "promiseCreationFrame",
|
||||||
|
"$ref": "CallFrame",
|
||||||
|
"optional": true,
|
||||||
|
"experimental": true,
|
||||||
|
"description": "Creation frame of the Promise which produced the next synchronous trace when resolved, if available."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -11054,7 +11095,9 @@
|
||||||
"endGroup",
|
"endGroup",
|
||||||
"assert",
|
"assert",
|
||||||
"profile",
|
"profile",
|
||||||
"profileEnd"
|
"profileEnd",
|
||||||
|
"count",
|
||||||
|
"timeEnd"
|
||||||
],
|
],
|
||||||
"description": "Type of the call."
|
"description": "Type of the call."
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user