From 4ff758024362c495671b7aebc7b64bd93aa3704f Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Fri, 27 Jan 2017 10:29:53 +0700 Subject: [PATCH] Updating to latest chrome protocol.json --- cdp/cdp.go | 3 + cdp/indexeddb/easyjson.go | 111 +++++++++++++++++++++++++++------ cdp/indexeddb/indexeddb.go | 55 ++++++++++++++++ cdp/network/types.go | 9 +-- cdp/page/easyjson.go | 20 ++++++ cdp/page/page.go | 31 +++++++-- cdp/page/types.go | 42 +++++++++++++ cdp/runtime/easyjson.go | 22 +++++++ cdp/runtime/types.go | 13 +++- cdp/util/util.go | 3 + cmd/chromedp-gen/protocol.json | 49 ++++++++++++++- 11 files changed, 324 insertions(+), 34 deletions(-) diff --git a/cdp/cdp.go b/cdp/cdp.go index 4003fa8..9ec181a 100644 --- a/cdp/cdp.go +++ b/cdp/cdp.go @@ -174,6 +174,7 @@ const ( CommandIndexedDBRequestDatabase MethodType = "IndexedDB.requestDatabase" CommandIndexedDBRequestData MethodType = "IndexedDB.requestData" CommandIndexedDBClearObjectStore MethodType = "IndexedDB.clearObjectStore" + CommandIndexedDBDeleteDatabase MethodType = "IndexedDB.deleteDatabase" CommandCacheStorageRequestCacheNames MethodType = "CacheStorage.requestCacheNames" CommandCacheStorageRequestEntries MethodType = "CacheStorage.requestEntries" CommandCacheStorageDeleteCache MethodType = "CacheStorage.deleteCache" @@ -713,6 +714,8 @@ func (t *MethodType) UnmarshalEasyJSON(in *jlexer.Lexer) { *t = CommandIndexedDBRequestData case CommandIndexedDBClearObjectStore: *t = CommandIndexedDBClearObjectStore + case CommandIndexedDBDeleteDatabase: + *t = CommandIndexedDBDeleteDatabase case CommandCacheStorageRequestCacheNames: *t = CommandCacheStorageRequestCacheNames case CommandCacheStorageRequestEntries: diff --git a/cdp/indexeddb/easyjson.go b/cdp/indexeddb/easyjson.go index 76244fc..a7c033d 100644 --- a/cdp/indexeddb/easyjson.go +++ b/cdp/indexeddb/easyjson.go @@ -1355,7 +1355,82 @@ func (v *DisableParams) UnmarshalJSON(data []byte) error { func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) { 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() if in.IsNull() { if isTopLevel { @@ -1415,7 +1490,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(in *jlexer.Lexer, in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(out *jwriter.Writer, in DatabaseWithObjectStores) { +func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(out *jwriter.Writer, in DatabaseWithObjectStores) { out.RawByte('{') first := true _ = first @@ -1464,27 +1539,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(out *jwriter.Write // MarshalJSON supports json.Marshaler interface func (v DatabaseWithObjectStores) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(&w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v DatabaseWithObjectStores) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb13(w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *DatabaseWithObjectStores) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb13(&r, v) + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 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() if in.IsNull() { if isTopLevel { @@ -1543,7 +1618,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(in *jlexer.Lexer, in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(out *jwriter.Writer, in DataEntry) { +func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(out *jwriter.Writer, in DataEntry) { out.RawByte('{') first := true _ = first @@ -1589,27 +1664,27 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(out *jwriter.Write // MarshalJSON supports json.Marshaler interface func (v DataEntry) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(&w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v DataEntry) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb14(w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *DataEntry) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb14(&r, v) + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 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() if in.IsNull() { if isTopLevel { @@ -1644,7 +1719,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(in *jlexer.Lexer, in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(out *jwriter.Writer, in ClearObjectStoreParams) { +func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(out *jwriter.Writer, in ClearObjectStoreParams) { out.RawByte('{') first := true _ = first @@ -1672,23 +1747,23 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(out *jwriter.Write // MarshalJSON supports json.Marshaler interface func (v ClearObjectStoreParams) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(&w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v ClearObjectStoreParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb15(w, v) + easyjsonC5a4559bEncodeGithubComKnqChromedpCdpIndexeddb16(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *ClearObjectStoreParams) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(&r, v) + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb16(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *ClearObjectStoreParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb15(l, v) + easyjsonC5a4559bDecodeGithubComKnqChromedpCdpIndexeddb16(l, v) } diff --git a/cdp/indexeddb/indexeddb.go b/cdp/indexeddb/indexeddb.go index 4a9631d..8f7008c 100644 --- a/cdp/indexeddb/indexeddb.go +++ b/cdp/indexeddb/indexeddb.go @@ -377,3 +377,58 @@ func (p *ClearObjectStoreParams) Do(ctxt context.Context, h cdp.FrameHandler) (e 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 +} diff --git a/cdp/network/types.go b/cdp/network/types.go index 24fa630..c436bc5 100644 --- a/cdp/network/types.go +++ b/cdp/network/types.go @@ -482,10 +482,9 @@ func (t InitiatorType) String() string { // InitiatorType values. const ( - InitiatorTypeParser InitiatorType = "parser" - InitiatorTypeScript InitiatorType = "script" - InitiatorTypePreload InitiatorType = "preload" - InitiatorTypeOther InitiatorType = "other" + InitiatorTypeParser InitiatorType = "parser" + InitiatorTypeScript InitiatorType = "script" + InitiatorTypeOther InitiatorType = "other" ) // MarshalEasyJSON satisfies easyjson.Marshaler. @@ -505,8 +504,6 @@ func (t *InitiatorType) UnmarshalEasyJSON(in *jlexer.Lexer) { *t = InitiatorTypeParser case InitiatorTypeScript: *t = InitiatorTypeScript - case InitiatorTypePreload: - *t = InitiatorTypePreload case InitiatorTypeOther: *t = InitiatorTypeOther diff --git a/cdp/page/easyjson.go b/cdp/page/easyjson.go index bbc189e..7b01b36 100644 --- a/cdp/page/easyjson.go +++ b/cdp/page/easyjson.go @@ -4552,6 +4552,10 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPage56(in *jlexer.Lexer, out * continue } switch key { + case "format": + (out.Format).UnmarshalEasyJSON(in) + case "quality": + out.Quality = int64(in.Int64()) default: in.SkipRecursive() } @@ -4566,6 +4570,22 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPage56(out *jwriter.Writer, in out.RawByte('{') first := true _ = 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('}') } diff --git a/cdp/page/page.go b/cdp/page/page.go index 4a0c718..6f75c40 100644 --- a/cdp/page/page.go +++ b/cdp/page/page.go @@ -830,29 +830,52 @@ func (p *SetDocumentContentParams) Do(ctxt context.Context, h cdp.FrameHandler) } // 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. +// +// parameters: func CaptureScreenshot() *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. 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. // // 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) { if ctxt == nil { ctxt = context.Background() } + // marshal + buf, err := easyjson.Marshal(p) + if err != nil { + return nil, err + } + // execute - ch := h.Execute(ctxt, cdp.CommandPageCaptureScreenshot, cdp.Empty) + ch := h.Execute(ctxt, cdp.CommandPageCaptureScreenshot, easyjson.RawMessage(buf)) // read response select { diff --git a/cdp/page/types.go b/cdp/page/types.go index 6d5cdc6..a5a9efe 100644 --- a/cdp/page/types.go +++ b/cdp/page/types.go @@ -253,6 +253,48 @@ type VisualViewport struct { 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. type ScreencastFormat string diff --git a/cdp/runtime/easyjson.go b/cdp/runtime/easyjson.go index c615f17..ac779a0 100644 --- a/cdp/runtime/easyjson.go +++ b/cdp/runtime/easyjson.go @@ -75,6 +75,16 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpRuntime(in *jlexer.Lexer, out } (*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: in.SkipRecursive() } @@ -132,6 +142,18 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpRuntime(out *jwriter.Writer, i (*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('}') } diff --git a/cdp/runtime/types.go b/cdp/runtime/types.go index 904651e..5380e02 100644 --- a/cdp/runtime/types.go +++ b/cdp/runtime/types.go @@ -192,9 +192,10 @@ type CallFrame struct { // StackTrace call frames for assertions or error messages. 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. - CallFrames []*CallFrame `json:"callFrames,omitempty"` // JavaScript function name. - Parent *StackTrace `json:"parent,omitempty"` // Asynchronous JavaScript stack trace that preceded this stack, if available. + 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. + 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. @@ -358,6 +359,8 @@ const ( APITypeAssert APIType = "assert" APITypeProfile APIType = "profile" APITypeProfileEnd APIType = "profileEnd" + APITypeCount APIType = "count" + APITypeTimeEnd APIType = "timeEnd" ) // MarshalEasyJSON satisfies easyjson.Marshaler. @@ -405,6 +408,10 @@ func (t *APIType) UnmarshalEasyJSON(in *jlexer.Lexer) { *t = APITypeProfile case APITypeProfileEnd: *t = APITypeProfileEnd + case APITypeCount: + *t = APITypeCount + case APITypeTimeEnd: + *t = APITypeTimeEnd default: in.AddError(errors.New("unknown APIType value")) diff --git a/cdp/util/util.go b/cdp/util/util.go index f56213c..5a367b0 100644 --- a/cdp/util/util.go +++ b/cdp/util/util.go @@ -421,6 +421,9 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { case cdp.CommandIndexedDBClearObjectStore: return emptyVal, nil + case cdp.CommandIndexedDBDeleteDatabase: + return emptyVal, nil + case cdp.CommandCacheStorageRequestCacheNames: v = new(cachestorage.RequestCacheNamesReturns) diff --git a/cmd/chromedp-gen/protocol.json b/cmd/chromedp-gen/protocol.json index 1b99e71..009ed6c 100644 --- a/cmd/chromedp-gen/protocol.json +++ b/cmd/chromedp-gen/protocol.json @@ -879,11 +879,29 @@ { "name": "captureScreenshot", "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": [ { "name": "data", "type": "string", - "description": "Base64-encoded image data (PNG)." + "description": "Base64-encoded image data." } ], "experimental": true @@ -2387,7 +2405,6 @@ "enum": [ "parser", "script", - "preload", "other" ], "description": "Type of this initiator." @@ -3738,6 +3755,23 @@ ], "returns": [], "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", "optional": true, "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", "assert", "profile", - "profileEnd" + "profileEnd", + "count", + "timeEnd" ], "description": "Type of the call." },