Update chromedp to fix console errors (#1521)

This commit is contained in:
peolic
2021-06-23 01:05:58 +03:00
committed by GitHub
parent ae3400a9b1
commit be2fe1de26
526 changed files with 55061 additions and 30300 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -37,7 +37,8 @@ type EventFrameAttached struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameDetached
type EventFrameDetached struct {
FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has been detached.
FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has been detached.
Reason FrameDetachedReason `json:"reason"`
}
// EventFrameNavigated fired once navigation of the frame has completed.
@@ -45,6 +46,14 @@ type EventFrameDetached struct {
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameNavigated
type EventFrameNavigated struct {
Frame *cdp.Frame `json:"frame"` // Frame object.
Type NavigationType `json:"type"`
}
// EventDocumentOpened fired when opening document to write to.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-documentOpened
type EventDocumentOpened struct {
Frame *cdp.Frame `json:"frame"` // Frame object.
}
@@ -78,27 +87,6 @@ type EventFrameStoppedLoading struct {
FrameID cdp.FrameID `json:"frameId"` // Id of the frame that has stopped loading.
}
// EventDownloadWillBegin fired when page is about to start a download.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-downloadWillBegin
type EventDownloadWillBegin struct {
FrameID cdp.FrameID `json:"frameId"` // Id of the frame that caused download to begin.
GUID string `json:"guid"` // Global unique identifier of the download.
URL string `json:"url"` // URL of the resource being downloaded.
SuggestedFilename string `json:"suggestedFilename"` // Suggested file name of the resource (the actual name of the file saved on disk may differ).
}
// EventDownloadProgress fired when download makes progress. Last call has
// |done| == true.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-downloadProgress
type EventDownloadProgress struct {
GUID string `json:"guid"` // Global unique identifier of the download.
TotalBytes float64 `json:"totalBytes"` // Total expected bytes to download.
ReceivedBytes float64 `json:"receivedBytes"` // Total bytes received.
State DownloadProgressState `json:"state"` // Download status.
}
// EventInterstitialHidden fired when interstitial page was hidden.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-interstitialHidden
@@ -141,6 +129,19 @@ type EventLifecycleEvent struct {
Timestamp *cdp.MonotonicTime `json:"timestamp"`
}
// EventBackForwardCacheNotUsed fired for failed bfcache history navigations
// if BackForwardCache feature is enabled. Do not assume any ordering with the
// Page.frameNavigated event. This event is fired only for main-frame history
// navigation where the document changes (non-same-document navigations), when
// bfcache navigation fails.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-backForwardCacheNotUsed
type EventBackForwardCacheNotUsed struct {
LoaderID cdp.LoaderID `json:"loaderId"` // The loader id for the associated navgation.
FrameID cdp.FrameID `json:"frameId"` // The frame id of the associated frame.
NotRestoredExplanations []*BackForwardCacheNotRestoredExplanation `json:"notRestoredExplanations"` // Array of reasons why the page could not be cached. This must not be empty.
}
// EventLoadEventFired [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-loadEventFired

View File

@@ -23,8 +23,9 @@ import (
// AddScriptToEvaluateOnNewDocumentParams evaluates given script in every
// frame upon creation (before loading frame's scripts).
type AddScriptToEvaluateOnNewDocumentParams struct {
Source string `json:"source"`
WorldName string `json:"worldName,omitempty"` // If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted.
Source string `json:"source"`
WorldName string `json:"worldName,omitempty"` // If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted.
IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"` // Specifies whether command line API should be available to the script, defaults to false.
}
// AddScriptToEvaluateOnNewDocument evaluates given script in every frame
@@ -48,6 +49,13 @@ func (p AddScriptToEvaluateOnNewDocumentParams) WithWorldName(worldName string)
return &p
}
// WithIncludeCommandLineAPI specifies whether command line API should be
// available to the script, defaults to false.
func (p AddScriptToEvaluateOnNewDocumentParams) WithIncludeCommandLineAPI(includeCommandLineAPI bool) *AddScriptToEvaluateOnNewDocumentParams {
p.IncludeCommandLineAPI = includeCommandLineAPI
return &p
}
// AddScriptToEvaluateOnNewDocumentReturns return values.
type AddScriptToEvaluateOnNewDocumentReturns struct {
Identifier ScriptIdentifier `json:"identifier,omitempty"` // Identifier of the added script.
@@ -85,10 +93,11 @@ func (p *BringToFrontParams) Do(ctx context.Context) (err error) {
// CaptureScreenshotParams capture page screenshot.
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).
Clip *Viewport `json:"clip,omitempty"` // Capture the screenshot of a given region only.
FromSurface bool `json:"fromSurface,omitempty"` // Capture the screenshot from the surface, rather than the view. Defaults to true.
Format CaptureScreenshotFormat `json:"format,omitempty"` // Image compression format (defaults to png).
Quality int64 `json:"quality,omitempty"` // Compression quality from range [0..100] (jpeg only).
Clip *Viewport `json:"clip,omitempty"` // Capture the screenshot of a given region only.
FromSurface bool `json:"fromSurface,omitempty"` // Capture the screenshot from the surface, rather than the view. Defaults to true.
CaptureBeyondViewport bool `json:"captureBeyondViewport,omitempty"` // Capture the screenshot beyond the viewport. Defaults to false.
}
// CaptureScreenshot capture page screenshot.
@@ -125,6 +134,13 @@ func (p CaptureScreenshotParams) WithFromSurface(fromSurface bool) *CaptureScree
return &p
}
// WithCaptureBeyondViewport capture the screenshot beyond the viewport.
// Defaults to false.
func (p CaptureScreenshotParams) WithCaptureBeyondViewport(captureBeyondViewport bool) *CaptureScreenshotParams {
p.CaptureBeyondViewport = captureBeyondViewport
return &p
}
// CaptureScreenshotReturns return values.
type CaptureScreenshotReturns struct {
Data string `json:"data,omitempty"` // Base64-encoded image data.
@@ -423,26 +439,32 @@ func GetLayoutMetrics() *GetLayoutMetricsParams {
// GetLayoutMetricsReturns return values.
type GetLayoutMetricsReturns struct {
LayoutViewport *LayoutViewport `json:"layoutViewport,omitempty"` // Metrics relating to the layout viewport.
VisualViewport *VisualViewport `json:"visualViewport,omitempty"` // Metrics relating to the visual viewport.
ContentSize *dom.Rect `json:"contentSize,omitempty"` // Size of scrollable area.
LayoutViewport *LayoutViewport `json:"layoutViewport"` // Deprecated metrics relating to the layout viewport. Can be in DP or in CSS pixels depending on the enable-use-zoom-for-dsf flag. Use cssLayoutViewport instead.
VisualViewport *VisualViewport `json:"visualViewport"` // Deprecated metrics relating to the visual viewport. Can be in DP or in CSS pixels depending on the enable-use-zoom-for-dsf flag. Use cssVisualViewport instead.
ContentSize *dom.Rect `json:"contentSize"` // Deprecated size of scrollable area. Can be in DP or in CSS pixels depending on the enable-use-zoom-for-dsf flag. Use cssContentSize instead.
CSSLayoutViewport *LayoutViewport `json:"cssLayoutViewport"` // Metrics relating to the layout viewport in CSS pixels.
CSSVisualViewport *VisualViewport `json:"cssVisualViewport"` // Metrics relating to the visual viewport in CSS pixels.
CSSContentSize *dom.Rect `json:"cssContentSize"` // Size of scrollable area in CSS pixels.
}
// Do executes Page.getLayoutMetrics against the provided context.
//
// returns:
// layoutViewport - Metrics relating to the layout viewport.
// visualViewport - Metrics relating to the visual viewport.
// contentSize - Size of scrollable area.
func (p *GetLayoutMetricsParams) Do(ctx context.Context) (layoutViewport *LayoutViewport, visualViewport *VisualViewport, contentSize *dom.Rect, err error) {
// layoutViewport - Deprecated metrics relating to the layout viewport. Can be in DP or in CSS pixels depending on the enable-use-zoom-for-dsf flag. Use cssLayoutViewport instead.
// visualViewport - Deprecated metrics relating to the visual viewport. Can be in DP or in CSS pixels depending on the enable-use-zoom-for-dsf flag. Use cssVisualViewport instead.
// contentSize - Deprecated size of scrollable area. Can be in DP or in CSS pixels depending on the enable-use-zoom-for-dsf flag. Use cssContentSize instead.
// cssLayoutViewport - Metrics relating to the layout viewport in CSS pixels.
// cssVisualViewport - Metrics relating to the visual viewport in CSS pixels.
// cssContentSize - Size of scrollable area in CSS pixels.
func (p *GetLayoutMetricsParams) Do(ctx context.Context) (layoutViewport *LayoutViewport, visualViewport *VisualViewport, contentSize *dom.Rect, cssLayoutViewport *LayoutViewport, cssVisualViewport *VisualViewport, cssContentSize *dom.Rect, err error) {
// execute
var res GetLayoutMetricsReturns
err = cdp.Execute(ctx, CommandGetLayoutMetrics, nil, &res)
if err != nil {
return nil, nil, nil, err
return nil, nil, nil, nil, nil, nil, err
}
return res.LayoutViewport, res.VisualViewport, res.ContentSize, nil
return res.LayoutViewport, res.VisualViewport, res.ContentSize, res.CSSLayoutViewport, res.CSSVisualViewport, res.CSSContentSize, nil
}
// GetNavigationHistoryParams returns navigation history for the current
@@ -1047,6 +1069,44 @@ func (p *SetBypassCSPParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetBypassCSP, p, nil)
}
// GetPermissionsPolicyStateParams get Permissions Policy state on given
// frame.
type GetPermissionsPolicyStateParams struct {
FrameID cdp.FrameID `json:"frameId"`
}
// GetPermissionsPolicyState get Permissions Policy state on given frame.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getPermissionsPolicyState
//
// parameters:
// frameID
func GetPermissionsPolicyState(frameID cdp.FrameID) *GetPermissionsPolicyStateParams {
return &GetPermissionsPolicyStateParams{
FrameID: frameID,
}
}
// GetPermissionsPolicyStateReturns return values.
type GetPermissionsPolicyStateReturns struct {
States []*PermissionsPolicyFeatureState `json:"states,omitempty"`
}
// Do executes Page.getPermissionsPolicyState against the provided context.
//
// returns:
// states
func (p *GetPermissionsPolicyStateParams) Do(ctx context.Context) (states []*PermissionsPolicyFeatureState, err error) {
// execute
var res GetPermissionsPolicyStateReturns
err = cdp.Execute(ctx, CommandGetPermissionsPolicyState, p, &res)
if err != nil {
return nil, err
}
return res.States, nil
}
// SetFontFamiliesParams set generic font families.
type SetFontFamiliesParams struct {
FontFamilies *FontFamilies `json:"fontFamilies"` // Specifies font families to set. If a font family is not specified, it won't be changed.
@@ -1116,6 +1176,36 @@ func (p *SetDocumentContentParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDocumentContent, p, nil)
}
// SetDownloadBehaviorParams set the behavior when downloading a file.
type SetDownloadBehaviorParams struct {
Behavior SetDownloadBehaviorBehavior `json:"behavior"` // Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
DownloadPath string `json:"downloadPath,omitempty"` // The default path to save downloaded files to. This is required if behavior is set to 'allow'
}
// SetDownloadBehavior set the behavior when downloading a file.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setDownloadBehavior
//
// parameters:
// behavior - Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
func SetDownloadBehavior(behavior SetDownloadBehaviorBehavior) *SetDownloadBehaviorParams {
return &SetDownloadBehaviorParams{
Behavior: behavior,
}
}
// WithDownloadPath the default path to save downloaded files to. This is
// required if behavior is set to 'allow'.
func (p SetDownloadBehaviorParams) WithDownloadPath(downloadPath string) *SetDownloadBehaviorParams {
p.DownloadPath = downloadPath
return &p
}
// Do executes Page.setDownloadBehavior against the provided context.
func (p *SetDownloadBehaviorParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDownloadBehavior, p, nil)
}
// SetLifecycleEventsEnabledParams controls whether page will emit lifecycle
// events.
type SetLifecycleEventsEnabledParams struct {
@@ -1283,13 +1373,13 @@ func (p *StopScreencastParams) Do(ctx context.Context) (err error) {
}
// SetProduceCompilationCacheParams forces compilation cache to be generated
// for every subresource script.
// for every subresource script. See also: Page.produceCompilationCache.
type SetProduceCompilationCacheParams struct {
Enabled bool `json:"enabled"`
}
// SetProduceCompilationCache forces compilation cache to be generated for
// every subresource script.
// every subresource script. See also: Page.produceCompilationCache.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setProduceCompilationCache
//
@@ -1306,6 +1396,44 @@ func (p *SetProduceCompilationCacheParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetProduceCompilationCache, p, nil)
}
// ProduceCompilationCacheParams requests backend to produce compilation
// cache for the specified scripts. Unlike setProduceCompilationCache, this
// allows client to only produce cache for specific scripts. scripts are
// appeneded to the list of scripts for which the cache for would produced.
// Disabling compilation cache with setProduceCompilationCache would reset all
// pending cache requests. The list may also be reset during page navigation.
// When script with a matching URL is encountered, the cache is optionally
// produced upon backend discretion, based on internal heuristics. See also:
// Page.compilationCacheProduced.
type ProduceCompilationCacheParams struct {
Scripts []*CompilationCacheParams `json:"scripts"`
}
// ProduceCompilationCache requests backend to produce compilation cache for
// the specified scripts. Unlike setProduceCompilationCache, this allows client
// to only produce cache for specific scripts. scripts are appeneded to the list
// of scripts for which the cache for would produced. Disabling compilation
// cache with setProduceCompilationCache would reset all pending cache requests.
// The list may also be reset during page navigation. When script with a
// matching URL is encountered, the cache is optionally produced upon backend
// discretion, based on internal heuristics. See also:
// Page.compilationCacheProduced.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-produceCompilationCache
//
// parameters:
// scripts
func ProduceCompilationCache(scripts []*CompilationCacheParams) *ProduceCompilationCacheParams {
return &ProduceCompilationCacheParams{
Scripts: scripts,
}
}
// Do executes Page.produceCompilationCache against the provided context.
func (p *ProduceCompilationCacheParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandProduceCompilationCache, p, nil)
}
// AddCompilationCacheParams seeds compilation cache for given url.
// Compilation cache does not survive cross-process navigation.
type AddCompilationCacheParams struct {
@@ -1450,9 +1578,11 @@ const (
CommandSearchInResource = "Page.searchInResource"
CommandSetAdBlockingEnabled = "Page.setAdBlockingEnabled"
CommandSetBypassCSP = "Page.setBypassCSP"
CommandGetPermissionsPolicyState = "Page.getPermissionsPolicyState"
CommandSetFontFamilies = "Page.setFontFamilies"
CommandSetFontSizes = "Page.setFontSizes"
CommandSetDocumentContent = "Page.setDocumentContent"
CommandSetDownloadBehavior = "Page.setDownloadBehavior"
CommandSetLifecycleEventsEnabled = "Page.setLifecycleEventsEnabled"
CommandStartScreencast = "Page.startScreencast"
CommandStopLoading = "Page.stopLoading"
@@ -1461,6 +1591,7 @@ const (
CommandSetWebLifecycleState = "Page.setWebLifecycleState"
CommandStopScreencast = "Page.stopScreencast"
CommandSetProduceCompilationCache = "Page.setProduceCompilationCache"
CommandProduceCompilationCache = "Page.produceCompilationCache"
CommandAddCompilationCache = "Page.addCompilationCache"
CommandClearCompilationCache = "Page.clearCompilationCache"
CommandGenerateTestReport = "Page.generateTestReport"

View File

@@ -12,6 +12,282 @@ import (
"github.com/mailru/easyjson/jwriter"
)
// PermissionsPolicyFeature all Permissions Policy features. This enum should
// match the one defined in
// third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-PermissionsPolicyFeature
type PermissionsPolicyFeature string
// String returns the PermissionsPolicyFeature as string value.
func (t PermissionsPolicyFeature) String() string {
return string(t)
}
// PermissionsPolicyFeature values.
const (
PermissionsPolicyFeatureAccelerometer PermissionsPolicyFeature = "accelerometer"
PermissionsPolicyFeatureAmbientLightSensor PermissionsPolicyFeature = "ambient-light-sensor"
PermissionsPolicyFeatureAttributionReporting PermissionsPolicyFeature = "attribution-reporting"
PermissionsPolicyFeatureAutoplay PermissionsPolicyFeature = "autoplay"
PermissionsPolicyFeatureCamera PermissionsPolicyFeature = "camera"
PermissionsPolicyFeatureChDpr PermissionsPolicyFeature = "ch-dpr"
PermissionsPolicyFeatureChDeviceMemory PermissionsPolicyFeature = "ch-device-memory"
PermissionsPolicyFeatureChDownlink PermissionsPolicyFeature = "ch-downlink"
PermissionsPolicyFeatureChEct PermissionsPolicyFeature = "ch-ect"
PermissionsPolicyFeatureChLang PermissionsPolicyFeature = "ch-lang"
PermissionsPolicyFeatureChPrefersColorScheme PermissionsPolicyFeature = "ch-prefers-color-scheme"
PermissionsPolicyFeatureChRtt PermissionsPolicyFeature = "ch-rtt"
PermissionsPolicyFeatureChUa PermissionsPolicyFeature = "ch-ua"
PermissionsPolicyFeatureChUaArch PermissionsPolicyFeature = "ch-ua-arch"
PermissionsPolicyFeatureChUaBitness PermissionsPolicyFeature = "ch-ua-bitness"
PermissionsPolicyFeatureChUaPlatform PermissionsPolicyFeature = "ch-ua-platform"
PermissionsPolicyFeatureChUaModel PermissionsPolicyFeature = "ch-ua-model"
PermissionsPolicyFeatureChUaMobile PermissionsPolicyFeature = "ch-ua-mobile"
PermissionsPolicyFeatureChUaFullVersion PermissionsPolicyFeature = "ch-ua-full-version"
PermissionsPolicyFeatureChUaPlatformVersion PermissionsPolicyFeature = "ch-ua-platform-version"
PermissionsPolicyFeatureChViewportWidth PermissionsPolicyFeature = "ch-viewport-width"
PermissionsPolicyFeatureChWidth PermissionsPolicyFeature = "ch-width"
PermissionsPolicyFeatureClipboardRead PermissionsPolicyFeature = "clipboard-read"
PermissionsPolicyFeatureClipboardWrite PermissionsPolicyFeature = "clipboard-write"
PermissionsPolicyFeatureCrossOriginIsolated PermissionsPolicyFeature = "cross-origin-isolated"
PermissionsPolicyFeatureDirectSockets PermissionsPolicyFeature = "direct-sockets"
PermissionsPolicyFeatureDisplayCapture PermissionsPolicyFeature = "display-capture"
PermissionsPolicyFeatureDocumentDomain PermissionsPolicyFeature = "document-domain"
PermissionsPolicyFeatureEncryptedMedia PermissionsPolicyFeature = "encrypted-media"
PermissionsPolicyFeatureExecutionWhileOutOfViewport PermissionsPolicyFeature = "execution-while-out-of-viewport"
PermissionsPolicyFeatureExecutionWhileNotRendered PermissionsPolicyFeature = "execution-while-not-rendered"
PermissionsPolicyFeatureFocusWithoutUserActivation PermissionsPolicyFeature = "focus-without-user-activation"
PermissionsPolicyFeatureFullscreen PermissionsPolicyFeature = "fullscreen"
PermissionsPolicyFeatureFrobulate PermissionsPolicyFeature = "frobulate"
PermissionsPolicyFeatureGamepad PermissionsPolicyFeature = "gamepad"
PermissionsPolicyFeatureGeolocation PermissionsPolicyFeature = "geolocation"
PermissionsPolicyFeatureGyroscope PermissionsPolicyFeature = "gyroscope"
PermissionsPolicyFeatureHid PermissionsPolicyFeature = "hid"
PermissionsPolicyFeatureIdleDetection PermissionsPolicyFeature = "idle-detection"
PermissionsPolicyFeatureInterestCohort PermissionsPolicyFeature = "interest-cohort"
PermissionsPolicyFeatureMagnetometer PermissionsPolicyFeature = "magnetometer"
PermissionsPolicyFeatureMicrophone PermissionsPolicyFeature = "microphone"
PermissionsPolicyFeatureMidi PermissionsPolicyFeature = "midi"
PermissionsPolicyFeatureOtpCredentials PermissionsPolicyFeature = "otp-credentials"
PermissionsPolicyFeaturePayment PermissionsPolicyFeature = "payment"
PermissionsPolicyFeaturePictureInPicture PermissionsPolicyFeature = "picture-in-picture"
PermissionsPolicyFeaturePublickeyCredentialsGet PermissionsPolicyFeature = "publickey-credentials-get"
PermissionsPolicyFeatureScreenWakeLock PermissionsPolicyFeature = "screen-wake-lock"
PermissionsPolicyFeatureSerial PermissionsPolicyFeature = "serial"
PermissionsPolicyFeatureSharedAutofill PermissionsPolicyFeature = "shared-autofill"
PermissionsPolicyFeatureStorageAccessAPI PermissionsPolicyFeature = "storage-access-api"
PermissionsPolicyFeatureSyncXhr PermissionsPolicyFeature = "sync-xhr"
PermissionsPolicyFeatureTrustTokenRedemption PermissionsPolicyFeature = "trust-token-redemption"
PermissionsPolicyFeatureUsb PermissionsPolicyFeature = "usb"
PermissionsPolicyFeatureVerticalScroll PermissionsPolicyFeature = "vertical-scroll"
PermissionsPolicyFeatureWebShare PermissionsPolicyFeature = "web-share"
PermissionsPolicyFeatureWindowPlacement PermissionsPolicyFeature = "window-placement"
PermissionsPolicyFeatureXrSpatialTracking PermissionsPolicyFeature = "xr-spatial-tracking"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t PermissionsPolicyFeature) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t PermissionsPolicyFeature) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *PermissionsPolicyFeature) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch PermissionsPolicyFeature(in.String()) {
case PermissionsPolicyFeatureAccelerometer:
*t = PermissionsPolicyFeatureAccelerometer
case PermissionsPolicyFeatureAmbientLightSensor:
*t = PermissionsPolicyFeatureAmbientLightSensor
case PermissionsPolicyFeatureAttributionReporting:
*t = PermissionsPolicyFeatureAttributionReporting
case PermissionsPolicyFeatureAutoplay:
*t = PermissionsPolicyFeatureAutoplay
case PermissionsPolicyFeatureCamera:
*t = PermissionsPolicyFeatureCamera
case PermissionsPolicyFeatureChDpr:
*t = PermissionsPolicyFeatureChDpr
case PermissionsPolicyFeatureChDeviceMemory:
*t = PermissionsPolicyFeatureChDeviceMemory
case PermissionsPolicyFeatureChDownlink:
*t = PermissionsPolicyFeatureChDownlink
case PermissionsPolicyFeatureChEct:
*t = PermissionsPolicyFeatureChEct
case PermissionsPolicyFeatureChLang:
*t = PermissionsPolicyFeatureChLang
case PermissionsPolicyFeatureChPrefersColorScheme:
*t = PermissionsPolicyFeatureChPrefersColorScheme
case PermissionsPolicyFeatureChRtt:
*t = PermissionsPolicyFeatureChRtt
case PermissionsPolicyFeatureChUa:
*t = PermissionsPolicyFeatureChUa
case PermissionsPolicyFeatureChUaArch:
*t = PermissionsPolicyFeatureChUaArch
case PermissionsPolicyFeatureChUaBitness:
*t = PermissionsPolicyFeatureChUaBitness
case PermissionsPolicyFeatureChUaPlatform:
*t = PermissionsPolicyFeatureChUaPlatform
case PermissionsPolicyFeatureChUaModel:
*t = PermissionsPolicyFeatureChUaModel
case PermissionsPolicyFeatureChUaMobile:
*t = PermissionsPolicyFeatureChUaMobile
case PermissionsPolicyFeatureChUaFullVersion:
*t = PermissionsPolicyFeatureChUaFullVersion
case PermissionsPolicyFeatureChUaPlatformVersion:
*t = PermissionsPolicyFeatureChUaPlatformVersion
case PermissionsPolicyFeatureChViewportWidth:
*t = PermissionsPolicyFeatureChViewportWidth
case PermissionsPolicyFeatureChWidth:
*t = PermissionsPolicyFeatureChWidth
case PermissionsPolicyFeatureClipboardRead:
*t = PermissionsPolicyFeatureClipboardRead
case PermissionsPolicyFeatureClipboardWrite:
*t = PermissionsPolicyFeatureClipboardWrite
case PermissionsPolicyFeatureCrossOriginIsolated:
*t = PermissionsPolicyFeatureCrossOriginIsolated
case PermissionsPolicyFeatureDirectSockets:
*t = PermissionsPolicyFeatureDirectSockets
case PermissionsPolicyFeatureDisplayCapture:
*t = PermissionsPolicyFeatureDisplayCapture
case PermissionsPolicyFeatureDocumentDomain:
*t = PermissionsPolicyFeatureDocumentDomain
case PermissionsPolicyFeatureEncryptedMedia:
*t = PermissionsPolicyFeatureEncryptedMedia
case PermissionsPolicyFeatureExecutionWhileOutOfViewport:
*t = PermissionsPolicyFeatureExecutionWhileOutOfViewport
case PermissionsPolicyFeatureExecutionWhileNotRendered:
*t = PermissionsPolicyFeatureExecutionWhileNotRendered
case PermissionsPolicyFeatureFocusWithoutUserActivation:
*t = PermissionsPolicyFeatureFocusWithoutUserActivation
case PermissionsPolicyFeatureFullscreen:
*t = PermissionsPolicyFeatureFullscreen
case PermissionsPolicyFeatureFrobulate:
*t = PermissionsPolicyFeatureFrobulate
case PermissionsPolicyFeatureGamepad:
*t = PermissionsPolicyFeatureGamepad
case PermissionsPolicyFeatureGeolocation:
*t = PermissionsPolicyFeatureGeolocation
case PermissionsPolicyFeatureGyroscope:
*t = PermissionsPolicyFeatureGyroscope
case PermissionsPolicyFeatureHid:
*t = PermissionsPolicyFeatureHid
case PermissionsPolicyFeatureIdleDetection:
*t = PermissionsPolicyFeatureIdleDetection
case PermissionsPolicyFeatureInterestCohort:
*t = PermissionsPolicyFeatureInterestCohort
case PermissionsPolicyFeatureMagnetometer:
*t = PermissionsPolicyFeatureMagnetometer
case PermissionsPolicyFeatureMicrophone:
*t = PermissionsPolicyFeatureMicrophone
case PermissionsPolicyFeatureMidi:
*t = PermissionsPolicyFeatureMidi
case PermissionsPolicyFeatureOtpCredentials:
*t = PermissionsPolicyFeatureOtpCredentials
case PermissionsPolicyFeaturePayment:
*t = PermissionsPolicyFeaturePayment
case PermissionsPolicyFeaturePictureInPicture:
*t = PermissionsPolicyFeaturePictureInPicture
case PermissionsPolicyFeaturePublickeyCredentialsGet:
*t = PermissionsPolicyFeaturePublickeyCredentialsGet
case PermissionsPolicyFeatureScreenWakeLock:
*t = PermissionsPolicyFeatureScreenWakeLock
case PermissionsPolicyFeatureSerial:
*t = PermissionsPolicyFeatureSerial
case PermissionsPolicyFeatureSharedAutofill:
*t = PermissionsPolicyFeatureSharedAutofill
case PermissionsPolicyFeatureStorageAccessAPI:
*t = PermissionsPolicyFeatureStorageAccessAPI
case PermissionsPolicyFeatureSyncXhr:
*t = PermissionsPolicyFeatureSyncXhr
case PermissionsPolicyFeatureTrustTokenRedemption:
*t = PermissionsPolicyFeatureTrustTokenRedemption
case PermissionsPolicyFeatureUsb:
*t = PermissionsPolicyFeatureUsb
case PermissionsPolicyFeatureVerticalScroll:
*t = PermissionsPolicyFeatureVerticalScroll
case PermissionsPolicyFeatureWebShare:
*t = PermissionsPolicyFeatureWebShare
case PermissionsPolicyFeatureWindowPlacement:
*t = PermissionsPolicyFeatureWindowPlacement
case PermissionsPolicyFeatureXrSpatialTracking:
*t = PermissionsPolicyFeatureXrSpatialTracking
default:
in.AddError(errors.New("unknown PermissionsPolicyFeature value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *PermissionsPolicyFeature) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// PermissionsPolicyBlockReason reason for a permissions policy feature to be
// disabled.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-PermissionsPolicyBlockReason
type PermissionsPolicyBlockReason string
// String returns the PermissionsPolicyBlockReason as string value.
func (t PermissionsPolicyBlockReason) String() string {
return string(t)
}
// PermissionsPolicyBlockReason values.
const (
PermissionsPolicyBlockReasonHeader PermissionsPolicyBlockReason = "Header"
PermissionsPolicyBlockReasonIframeAttribute PermissionsPolicyBlockReason = "IframeAttribute"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t PermissionsPolicyBlockReason) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t PermissionsPolicyBlockReason) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *PermissionsPolicyBlockReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch PermissionsPolicyBlockReason(in.String()) {
case PermissionsPolicyBlockReasonHeader:
*t = PermissionsPolicyBlockReasonHeader
case PermissionsPolicyBlockReasonIframeAttribute:
*t = PermissionsPolicyBlockReasonIframeAttribute
default:
in.AddError(errors.New("unknown PermissionsPolicyBlockReason value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *PermissionsPolicyBlockReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// PermissionsPolicyBlockLocator [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-PermissionsPolicyBlockLocator
type PermissionsPolicyBlockLocator struct {
FrameID cdp.FrameID `json:"frameId"`
BlockReason PermissionsPolicyBlockReason `json:"blockReason"`
}
// PermissionsPolicyFeatureState [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-PermissionsPolicyFeatureState
type PermissionsPolicyFeatureState struct {
Feature PermissionsPolicyFeature `json:"feature"`
Allowed bool `json:"allowed"`
Locator *PermissionsPolicyBlockLocator `json:"locator,omitempty"`
}
// FrameResource information about the Resource on the page.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-FrameResource
@@ -467,6 +743,433 @@ func (t *ReferrerPolicy) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// CompilationCacheParams per-script compilation cache parameters for
// Page.produceCompilationCache.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-CompilationCacheParams
type CompilationCacheParams struct {
URL string `json:"url"` // The URL of the script to produce a compilation cache entry for.
Eager bool `json:"eager,omitempty"` // A hint to the backend whether eager compilation is recommended. (the actual compilation mode used is upon backend discretion).
}
// NavigationType the type of a frameNavigated event.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-NavigationType
type NavigationType string
// String returns the NavigationType as string value.
func (t NavigationType) String() string {
return string(t)
}
// NavigationType values.
const (
NavigationTypeNavigation NavigationType = "Navigation"
NavigationTypeBackForwardCacheRestore NavigationType = "BackForwardCacheRestore"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t NavigationType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t NavigationType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *NavigationType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch NavigationType(in.String()) {
case NavigationTypeNavigation:
*t = NavigationTypeNavigation
case NavigationTypeBackForwardCacheRestore:
*t = NavigationTypeBackForwardCacheRestore
default:
in.AddError(errors.New("unknown NavigationType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *NavigationType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// BackForwardCacheNotRestoredReason list of not restored reasons for
// back-forward cache.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-BackForwardCacheNotRestoredReason
type BackForwardCacheNotRestoredReason string
// String returns the BackForwardCacheNotRestoredReason as string value.
func (t BackForwardCacheNotRestoredReason) String() string {
return string(t)
}
// BackForwardCacheNotRestoredReason values.
const (
BackForwardCacheNotRestoredReasonNotMainFrame BackForwardCacheNotRestoredReason = "NotMainFrame"
BackForwardCacheNotRestoredReasonBackForwardCacheDisabled BackForwardCacheNotRestoredReason = "BackForwardCacheDisabled"
BackForwardCacheNotRestoredReasonRelatedActiveContentsExist BackForwardCacheNotRestoredReason = "RelatedActiveContentsExist"
BackForwardCacheNotRestoredReasonHTTPSTatusNotOK BackForwardCacheNotRestoredReason = "HTTPStatusNotOK"
BackForwardCacheNotRestoredReasonSchemeNotHTTPOrHTTPS BackForwardCacheNotRestoredReason = "SchemeNotHTTPOrHTTPS"
BackForwardCacheNotRestoredReasonLoading BackForwardCacheNotRestoredReason = "Loading"
BackForwardCacheNotRestoredReasonWasGrantedMediaAccess BackForwardCacheNotRestoredReason = "WasGrantedMediaAccess"
BackForwardCacheNotRestoredReasonDisableForRenderFrameHostCalled BackForwardCacheNotRestoredReason = "DisableForRenderFrameHostCalled"
BackForwardCacheNotRestoredReasonDomainNotAllowed BackForwardCacheNotRestoredReason = "DomainNotAllowed"
BackForwardCacheNotRestoredReasonHTTPMethodNotGET BackForwardCacheNotRestoredReason = "HTTPMethodNotGET"
BackForwardCacheNotRestoredReasonSubframeIsNavigating BackForwardCacheNotRestoredReason = "SubframeIsNavigating"
BackForwardCacheNotRestoredReasonTimeout BackForwardCacheNotRestoredReason = "Timeout"
BackForwardCacheNotRestoredReasonCacheLimit BackForwardCacheNotRestoredReason = "CacheLimit"
BackForwardCacheNotRestoredReasonJavaScriptExecution BackForwardCacheNotRestoredReason = "JavaScriptExecution"
BackForwardCacheNotRestoredReasonRendererProcessKilled BackForwardCacheNotRestoredReason = "RendererProcessKilled"
BackForwardCacheNotRestoredReasonRendererProcessCrashed BackForwardCacheNotRestoredReason = "RendererProcessCrashed"
BackForwardCacheNotRestoredReasonGrantedMediaStreamAccess BackForwardCacheNotRestoredReason = "GrantedMediaStreamAccess"
BackForwardCacheNotRestoredReasonSchedulerTrackedFeatureUsed BackForwardCacheNotRestoredReason = "SchedulerTrackedFeatureUsed"
BackForwardCacheNotRestoredReasonConflictingBrowsingInstance BackForwardCacheNotRestoredReason = "ConflictingBrowsingInstance"
BackForwardCacheNotRestoredReasonCacheFlushed BackForwardCacheNotRestoredReason = "CacheFlushed"
BackForwardCacheNotRestoredReasonServiceWorkerVersionActivation BackForwardCacheNotRestoredReason = "ServiceWorkerVersionActivation"
BackForwardCacheNotRestoredReasonSessionRestored BackForwardCacheNotRestoredReason = "SessionRestored"
BackForwardCacheNotRestoredReasonServiceWorkerPostMessage BackForwardCacheNotRestoredReason = "ServiceWorkerPostMessage"
BackForwardCacheNotRestoredReasonEnteredBackForwardCacheBeforeServiceWorkerHostAdded BackForwardCacheNotRestoredReason = "EnteredBackForwardCacheBeforeServiceWorkerHostAdded"
BackForwardCacheNotRestoredReasonRenderFrameHostReusedSameSite BackForwardCacheNotRestoredReason = "RenderFrameHostReused_SameSite"
BackForwardCacheNotRestoredReasonRenderFrameHostReusedCrossSite BackForwardCacheNotRestoredReason = "RenderFrameHostReused_CrossSite"
BackForwardCacheNotRestoredReasonServiceWorkerClaim BackForwardCacheNotRestoredReason = "ServiceWorkerClaim"
BackForwardCacheNotRestoredReasonIgnoreEventAndEvict BackForwardCacheNotRestoredReason = "IgnoreEventAndEvict"
BackForwardCacheNotRestoredReasonHaveInnerContents BackForwardCacheNotRestoredReason = "HaveInnerContents"
BackForwardCacheNotRestoredReasonTimeoutPuttingInCache BackForwardCacheNotRestoredReason = "TimeoutPuttingInCache"
BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByLowMemory BackForwardCacheNotRestoredReason = "BackForwardCacheDisabledByLowMemory"
BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByCommandLine BackForwardCacheNotRestoredReason = "BackForwardCacheDisabledByCommandLine"
BackForwardCacheNotRestoredReasonNetworkRequestDatapipeDrainedAsBytesConsumer BackForwardCacheNotRestoredReason = "NetworkRequestDatapipeDrainedAsBytesConsumer"
BackForwardCacheNotRestoredReasonNetworkRequestRedirected BackForwardCacheNotRestoredReason = "NetworkRequestRedirected"
BackForwardCacheNotRestoredReasonNetworkRequestTimeout BackForwardCacheNotRestoredReason = "NetworkRequestTimeout"
BackForwardCacheNotRestoredReasonNetworkExceedsBufferLimit BackForwardCacheNotRestoredReason = "NetworkExceedsBufferLimit"
BackForwardCacheNotRestoredReasonNavigationCancelledWhileRestoring BackForwardCacheNotRestoredReason = "NavigationCancelledWhileRestoring"
BackForwardCacheNotRestoredReasonNotMostRecentNavigationEntry BackForwardCacheNotRestoredReason = "NotMostRecentNavigationEntry"
BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForPrerender BackForwardCacheNotRestoredReason = "BackForwardCacheDisabledForPrerender"
BackForwardCacheNotRestoredReasonUserAgentOverrideDiffers BackForwardCacheNotRestoredReason = "UserAgentOverrideDiffers"
BackForwardCacheNotRestoredReasonForegroundCacheLimit BackForwardCacheNotRestoredReason = "ForegroundCacheLimit"
BackForwardCacheNotRestoredReasonBrowsingInstanceNotSwapped BackForwardCacheNotRestoredReason = "BrowsingInstanceNotSwapped"
BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForDelegate BackForwardCacheNotRestoredReason = "BackForwardCacheDisabledForDelegate"
BackForwardCacheNotRestoredReasonOptInUnloadHeaderNotPresent BackForwardCacheNotRestoredReason = "OptInUnloadHeaderNotPresent"
BackForwardCacheNotRestoredReasonUnloadHandlerExistsInMainFrame BackForwardCacheNotRestoredReason = "UnloadHandlerExistsInMainFrame"
BackForwardCacheNotRestoredReasonUnloadHandlerExistsInSubFrame BackForwardCacheNotRestoredReason = "UnloadHandlerExistsInSubFrame"
BackForwardCacheNotRestoredReasonServiceWorkerUnregistration BackForwardCacheNotRestoredReason = "ServiceWorkerUnregistration"
BackForwardCacheNotRestoredReasonWebSocket BackForwardCacheNotRestoredReason = "WebSocket"
BackForwardCacheNotRestoredReasonWebRTC BackForwardCacheNotRestoredReason = "WebRTC"
BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoStore BackForwardCacheNotRestoredReason = "MainResourceHasCacheControlNoStore"
BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoCache BackForwardCacheNotRestoredReason = "MainResourceHasCacheControlNoCache"
BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoStore BackForwardCacheNotRestoredReason = "SubresourceHasCacheControlNoStore"
BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoCache BackForwardCacheNotRestoredReason = "SubresourceHasCacheControlNoCache"
BackForwardCacheNotRestoredReasonContainsPlugins BackForwardCacheNotRestoredReason = "ContainsPlugins"
BackForwardCacheNotRestoredReasonDocumentLoaded BackForwardCacheNotRestoredReason = "DocumentLoaded"
BackForwardCacheNotRestoredReasonDedicatedWorkerOrWorklet BackForwardCacheNotRestoredReason = "DedicatedWorkerOrWorklet"
BackForwardCacheNotRestoredReasonOutstandingNetworkRequestOthers BackForwardCacheNotRestoredReason = "OutstandingNetworkRequestOthers"
BackForwardCacheNotRestoredReasonOutstandingIndexedDBTransaction BackForwardCacheNotRestoredReason = "OutstandingIndexedDBTransaction"
BackForwardCacheNotRestoredReasonRequestedGeolocationPermission BackForwardCacheNotRestoredReason = "RequestedGeolocationPermission"
BackForwardCacheNotRestoredReasonRequestedNotificationsPermission BackForwardCacheNotRestoredReason = "RequestedNotificationsPermission"
BackForwardCacheNotRestoredReasonRequestedMIDIPermission BackForwardCacheNotRestoredReason = "RequestedMIDIPermission"
BackForwardCacheNotRestoredReasonRequestedAudioCapturePermission BackForwardCacheNotRestoredReason = "RequestedAudioCapturePermission"
BackForwardCacheNotRestoredReasonRequestedVideoCapturePermission BackForwardCacheNotRestoredReason = "RequestedVideoCapturePermission"
BackForwardCacheNotRestoredReasonRequestedBackForwardCacheBlockedSensors BackForwardCacheNotRestoredReason = "RequestedBackForwardCacheBlockedSensors"
BackForwardCacheNotRestoredReasonRequestedBackgroundWorkPermission BackForwardCacheNotRestoredReason = "RequestedBackgroundWorkPermission"
BackForwardCacheNotRestoredReasonBroadcastChannel BackForwardCacheNotRestoredReason = "BroadcastChannel"
BackForwardCacheNotRestoredReasonIndexedDBConnection BackForwardCacheNotRestoredReason = "IndexedDBConnection"
BackForwardCacheNotRestoredReasonWebXR BackForwardCacheNotRestoredReason = "WebXR"
BackForwardCacheNotRestoredReasonSharedWorker BackForwardCacheNotRestoredReason = "SharedWorker"
BackForwardCacheNotRestoredReasonWebLocks BackForwardCacheNotRestoredReason = "WebLocks"
BackForwardCacheNotRestoredReasonWebHID BackForwardCacheNotRestoredReason = "WebHID"
BackForwardCacheNotRestoredReasonWebShare BackForwardCacheNotRestoredReason = "WebShare"
BackForwardCacheNotRestoredReasonRequestedStorageAccessGrant BackForwardCacheNotRestoredReason = "RequestedStorageAccessGrant"
BackForwardCacheNotRestoredReasonWebNfc BackForwardCacheNotRestoredReason = "WebNfc"
BackForwardCacheNotRestoredReasonWebFileSystem BackForwardCacheNotRestoredReason = "WebFileSystem"
BackForwardCacheNotRestoredReasonOutstandingNetworkRequestFetch BackForwardCacheNotRestoredReason = "OutstandingNetworkRequestFetch"
BackForwardCacheNotRestoredReasonOutstandingNetworkRequestXHR BackForwardCacheNotRestoredReason = "OutstandingNetworkRequestXHR"
BackForwardCacheNotRestoredReasonAppBanner BackForwardCacheNotRestoredReason = "AppBanner"
BackForwardCacheNotRestoredReasonPrinting BackForwardCacheNotRestoredReason = "Printing"
BackForwardCacheNotRestoredReasonWebDatabase BackForwardCacheNotRestoredReason = "WebDatabase"
BackForwardCacheNotRestoredReasonPictureInPicture BackForwardCacheNotRestoredReason = "PictureInPicture"
BackForwardCacheNotRestoredReasonPortal BackForwardCacheNotRestoredReason = "Portal"
BackForwardCacheNotRestoredReasonSpeechRecognizer BackForwardCacheNotRestoredReason = "SpeechRecognizer"
BackForwardCacheNotRestoredReasonIdleManager BackForwardCacheNotRestoredReason = "IdleManager"
BackForwardCacheNotRestoredReasonPaymentManager BackForwardCacheNotRestoredReason = "PaymentManager"
BackForwardCacheNotRestoredReasonSpeechSynthesis BackForwardCacheNotRestoredReason = "SpeechSynthesis"
BackForwardCacheNotRestoredReasonKeyboardLock BackForwardCacheNotRestoredReason = "KeyboardLock"
BackForwardCacheNotRestoredReasonWebOTPService BackForwardCacheNotRestoredReason = "WebOTPService"
BackForwardCacheNotRestoredReasonOutstandingNetworkRequestDirectSocket BackForwardCacheNotRestoredReason = "OutstandingNetworkRequestDirectSocket"
BackForwardCacheNotRestoredReasonIsolatedWorldScript BackForwardCacheNotRestoredReason = "IsolatedWorldScript"
BackForwardCacheNotRestoredReasonInjectedStyleSheet BackForwardCacheNotRestoredReason = "InjectedStyleSheet"
BackForwardCacheNotRestoredReasonMediaSessionImplOnServiceCreated BackForwardCacheNotRestoredReason = "MediaSessionImplOnServiceCreated"
BackForwardCacheNotRestoredReasonUnknown BackForwardCacheNotRestoredReason = "Unknown"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t BackForwardCacheNotRestoredReason) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t BackForwardCacheNotRestoredReason) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *BackForwardCacheNotRestoredReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch BackForwardCacheNotRestoredReason(in.String()) {
case BackForwardCacheNotRestoredReasonNotMainFrame:
*t = BackForwardCacheNotRestoredReasonNotMainFrame
case BackForwardCacheNotRestoredReasonBackForwardCacheDisabled:
*t = BackForwardCacheNotRestoredReasonBackForwardCacheDisabled
case BackForwardCacheNotRestoredReasonRelatedActiveContentsExist:
*t = BackForwardCacheNotRestoredReasonRelatedActiveContentsExist
case BackForwardCacheNotRestoredReasonHTTPSTatusNotOK:
*t = BackForwardCacheNotRestoredReasonHTTPSTatusNotOK
case BackForwardCacheNotRestoredReasonSchemeNotHTTPOrHTTPS:
*t = BackForwardCacheNotRestoredReasonSchemeNotHTTPOrHTTPS
case BackForwardCacheNotRestoredReasonLoading:
*t = BackForwardCacheNotRestoredReasonLoading
case BackForwardCacheNotRestoredReasonWasGrantedMediaAccess:
*t = BackForwardCacheNotRestoredReasonWasGrantedMediaAccess
case BackForwardCacheNotRestoredReasonDisableForRenderFrameHostCalled:
*t = BackForwardCacheNotRestoredReasonDisableForRenderFrameHostCalled
case BackForwardCacheNotRestoredReasonDomainNotAllowed:
*t = BackForwardCacheNotRestoredReasonDomainNotAllowed
case BackForwardCacheNotRestoredReasonHTTPMethodNotGET:
*t = BackForwardCacheNotRestoredReasonHTTPMethodNotGET
case BackForwardCacheNotRestoredReasonSubframeIsNavigating:
*t = BackForwardCacheNotRestoredReasonSubframeIsNavigating
case BackForwardCacheNotRestoredReasonTimeout:
*t = BackForwardCacheNotRestoredReasonTimeout
case BackForwardCacheNotRestoredReasonCacheLimit:
*t = BackForwardCacheNotRestoredReasonCacheLimit
case BackForwardCacheNotRestoredReasonJavaScriptExecution:
*t = BackForwardCacheNotRestoredReasonJavaScriptExecution
case BackForwardCacheNotRestoredReasonRendererProcessKilled:
*t = BackForwardCacheNotRestoredReasonRendererProcessKilled
case BackForwardCacheNotRestoredReasonRendererProcessCrashed:
*t = BackForwardCacheNotRestoredReasonRendererProcessCrashed
case BackForwardCacheNotRestoredReasonGrantedMediaStreamAccess:
*t = BackForwardCacheNotRestoredReasonGrantedMediaStreamAccess
case BackForwardCacheNotRestoredReasonSchedulerTrackedFeatureUsed:
*t = BackForwardCacheNotRestoredReasonSchedulerTrackedFeatureUsed
case BackForwardCacheNotRestoredReasonConflictingBrowsingInstance:
*t = BackForwardCacheNotRestoredReasonConflictingBrowsingInstance
case BackForwardCacheNotRestoredReasonCacheFlushed:
*t = BackForwardCacheNotRestoredReasonCacheFlushed
case BackForwardCacheNotRestoredReasonServiceWorkerVersionActivation:
*t = BackForwardCacheNotRestoredReasonServiceWorkerVersionActivation
case BackForwardCacheNotRestoredReasonSessionRestored:
*t = BackForwardCacheNotRestoredReasonSessionRestored
case BackForwardCacheNotRestoredReasonServiceWorkerPostMessage:
*t = BackForwardCacheNotRestoredReasonServiceWorkerPostMessage
case BackForwardCacheNotRestoredReasonEnteredBackForwardCacheBeforeServiceWorkerHostAdded:
*t = BackForwardCacheNotRestoredReasonEnteredBackForwardCacheBeforeServiceWorkerHostAdded
case BackForwardCacheNotRestoredReasonRenderFrameHostReusedSameSite:
*t = BackForwardCacheNotRestoredReasonRenderFrameHostReusedSameSite
case BackForwardCacheNotRestoredReasonRenderFrameHostReusedCrossSite:
*t = BackForwardCacheNotRestoredReasonRenderFrameHostReusedCrossSite
case BackForwardCacheNotRestoredReasonServiceWorkerClaim:
*t = BackForwardCacheNotRestoredReasonServiceWorkerClaim
case BackForwardCacheNotRestoredReasonIgnoreEventAndEvict:
*t = BackForwardCacheNotRestoredReasonIgnoreEventAndEvict
case BackForwardCacheNotRestoredReasonHaveInnerContents:
*t = BackForwardCacheNotRestoredReasonHaveInnerContents
case BackForwardCacheNotRestoredReasonTimeoutPuttingInCache:
*t = BackForwardCacheNotRestoredReasonTimeoutPuttingInCache
case BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByLowMemory:
*t = BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByLowMemory
case BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByCommandLine:
*t = BackForwardCacheNotRestoredReasonBackForwardCacheDisabledByCommandLine
case BackForwardCacheNotRestoredReasonNetworkRequestDatapipeDrainedAsBytesConsumer:
*t = BackForwardCacheNotRestoredReasonNetworkRequestDatapipeDrainedAsBytesConsumer
case BackForwardCacheNotRestoredReasonNetworkRequestRedirected:
*t = BackForwardCacheNotRestoredReasonNetworkRequestRedirected
case BackForwardCacheNotRestoredReasonNetworkRequestTimeout:
*t = BackForwardCacheNotRestoredReasonNetworkRequestTimeout
case BackForwardCacheNotRestoredReasonNetworkExceedsBufferLimit:
*t = BackForwardCacheNotRestoredReasonNetworkExceedsBufferLimit
case BackForwardCacheNotRestoredReasonNavigationCancelledWhileRestoring:
*t = BackForwardCacheNotRestoredReasonNavigationCancelledWhileRestoring
case BackForwardCacheNotRestoredReasonNotMostRecentNavigationEntry:
*t = BackForwardCacheNotRestoredReasonNotMostRecentNavigationEntry
case BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForPrerender:
*t = BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForPrerender
case BackForwardCacheNotRestoredReasonUserAgentOverrideDiffers:
*t = BackForwardCacheNotRestoredReasonUserAgentOverrideDiffers
case BackForwardCacheNotRestoredReasonForegroundCacheLimit:
*t = BackForwardCacheNotRestoredReasonForegroundCacheLimit
case BackForwardCacheNotRestoredReasonBrowsingInstanceNotSwapped:
*t = BackForwardCacheNotRestoredReasonBrowsingInstanceNotSwapped
case BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForDelegate:
*t = BackForwardCacheNotRestoredReasonBackForwardCacheDisabledForDelegate
case BackForwardCacheNotRestoredReasonOptInUnloadHeaderNotPresent:
*t = BackForwardCacheNotRestoredReasonOptInUnloadHeaderNotPresent
case BackForwardCacheNotRestoredReasonUnloadHandlerExistsInMainFrame:
*t = BackForwardCacheNotRestoredReasonUnloadHandlerExistsInMainFrame
case BackForwardCacheNotRestoredReasonUnloadHandlerExistsInSubFrame:
*t = BackForwardCacheNotRestoredReasonUnloadHandlerExistsInSubFrame
case BackForwardCacheNotRestoredReasonServiceWorkerUnregistration:
*t = BackForwardCacheNotRestoredReasonServiceWorkerUnregistration
case BackForwardCacheNotRestoredReasonWebSocket:
*t = BackForwardCacheNotRestoredReasonWebSocket
case BackForwardCacheNotRestoredReasonWebRTC:
*t = BackForwardCacheNotRestoredReasonWebRTC
case BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoStore:
*t = BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoStore
case BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoCache:
*t = BackForwardCacheNotRestoredReasonMainResourceHasCacheControlNoCache
case BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoStore:
*t = BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoStore
case BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoCache:
*t = BackForwardCacheNotRestoredReasonSubresourceHasCacheControlNoCache
case BackForwardCacheNotRestoredReasonContainsPlugins:
*t = BackForwardCacheNotRestoredReasonContainsPlugins
case BackForwardCacheNotRestoredReasonDocumentLoaded:
*t = BackForwardCacheNotRestoredReasonDocumentLoaded
case BackForwardCacheNotRestoredReasonDedicatedWorkerOrWorklet:
*t = BackForwardCacheNotRestoredReasonDedicatedWorkerOrWorklet
case BackForwardCacheNotRestoredReasonOutstandingNetworkRequestOthers:
*t = BackForwardCacheNotRestoredReasonOutstandingNetworkRequestOthers
case BackForwardCacheNotRestoredReasonOutstandingIndexedDBTransaction:
*t = BackForwardCacheNotRestoredReasonOutstandingIndexedDBTransaction
case BackForwardCacheNotRestoredReasonRequestedGeolocationPermission:
*t = BackForwardCacheNotRestoredReasonRequestedGeolocationPermission
case BackForwardCacheNotRestoredReasonRequestedNotificationsPermission:
*t = BackForwardCacheNotRestoredReasonRequestedNotificationsPermission
case BackForwardCacheNotRestoredReasonRequestedMIDIPermission:
*t = BackForwardCacheNotRestoredReasonRequestedMIDIPermission
case BackForwardCacheNotRestoredReasonRequestedAudioCapturePermission:
*t = BackForwardCacheNotRestoredReasonRequestedAudioCapturePermission
case BackForwardCacheNotRestoredReasonRequestedVideoCapturePermission:
*t = BackForwardCacheNotRestoredReasonRequestedVideoCapturePermission
case BackForwardCacheNotRestoredReasonRequestedBackForwardCacheBlockedSensors:
*t = BackForwardCacheNotRestoredReasonRequestedBackForwardCacheBlockedSensors
case BackForwardCacheNotRestoredReasonRequestedBackgroundWorkPermission:
*t = BackForwardCacheNotRestoredReasonRequestedBackgroundWorkPermission
case BackForwardCacheNotRestoredReasonBroadcastChannel:
*t = BackForwardCacheNotRestoredReasonBroadcastChannel
case BackForwardCacheNotRestoredReasonIndexedDBConnection:
*t = BackForwardCacheNotRestoredReasonIndexedDBConnection
case BackForwardCacheNotRestoredReasonWebXR:
*t = BackForwardCacheNotRestoredReasonWebXR
case BackForwardCacheNotRestoredReasonSharedWorker:
*t = BackForwardCacheNotRestoredReasonSharedWorker
case BackForwardCacheNotRestoredReasonWebLocks:
*t = BackForwardCacheNotRestoredReasonWebLocks
case BackForwardCacheNotRestoredReasonWebHID:
*t = BackForwardCacheNotRestoredReasonWebHID
case BackForwardCacheNotRestoredReasonWebShare:
*t = BackForwardCacheNotRestoredReasonWebShare
case BackForwardCacheNotRestoredReasonRequestedStorageAccessGrant:
*t = BackForwardCacheNotRestoredReasonRequestedStorageAccessGrant
case BackForwardCacheNotRestoredReasonWebNfc:
*t = BackForwardCacheNotRestoredReasonWebNfc
case BackForwardCacheNotRestoredReasonWebFileSystem:
*t = BackForwardCacheNotRestoredReasonWebFileSystem
case BackForwardCacheNotRestoredReasonOutstandingNetworkRequestFetch:
*t = BackForwardCacheNotRestoredReasonOutstandingNetworkRequestFetch
case BackForwardCacheNotRestoredReasonOutstandingNetworkRequestXHR:
*t = BackForwardCacheNotRestoredReasonOutstandingNetworkRequestXHR
case BackForwardCacheNotRestoredReasonAppBanner:
*t = BackForwardCacheNotRestoredReasonAppBanner
case BackForwardCacheNotRestoredReasonPrinting:
*t = BackForwardCacheNotRestoredReasonPrinting
case BackForwardCacheNotRestoredReasonWebDatabase:
*t = BackForwardCacheNotRestoredReasonWebDatabase
case BackForwardCacheNotRestoredReasonPictureInPicture:
*t = BackForwardCacheNotRestoredReasonPictureInPicture
case BackForwardCacheNotRestoredReasonPortal:
*t = BackForwardCacheNotRestoredReasonPortal
case BackForwardCacheNotRestoredReasonSpeechRecognizer:
*t = BackForwardCacheNotRestoredReasonSpeechRecognizer
case BackForwardCacheNotRestoredReasonIdleManager:
*t = BackForwardCacheNotRestoredReasonIdleManager
case BackForwardCacheNotRestoredReasonPaymentManager:
*t = BackForwardCacheNotRestoredReasonPaymentManager
case BackForwardCacheNotRestoredReasonSpeechSynthesis:
*t = BackForwardCacheNotRestoredReasonSpeechSynthesis
case BackForwardCacheNotRestoredReasonKeyboardLock:
*t = BackForwardCacheNotRestoredReasonKeyboardLock
case BackForwardCacheNotRestoredReasonWebOTPService:
*t = BackForwardCacheNotRestoredReasonWebOTPService
case BackForwardCacheNotRestoredReasonOutstandingNetworkRequestDirectSocket:
*t = BackForwardCacheNotRestoredReasonOutstandingNetworkRequestDirectSocket
case BackForwardCacheNotRestoredReasonIsolatedWorldScript:
*t = BackForwardCacheNotRestoredReasonIsolatedWorldScript
case BackForwardCacheNotRestoredReasonInjectedStyleSheet:
*t = BackForwardCacheNotRestoredReasonInjectedStyleSheet
case BackForwardCacheNotRestoredReasonMediaSessionImplOnServiceCreated:
*t = BackForwardCacheNotRestoredReasonMediaSessionImplOnServiceCreated
case BackForwardCacheNotRestoredReasonUnknown:
*t = BackForwardCacheNotRestoredReasonUnknown
default:
in.AddError(errors.New("unknown BackForwardCacheNotRestoredReason value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *BackForwardCacheNotRestoredReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// BackForwardCacheNotRestoredReasonType types of not restored reasons for
// back-forward cache.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-BackForwardCacheNotRestoredReasonType
type BackForwardCacheNotRestoredReasonType string
// String returns the BackForwardCacheNotRestoredReasonType as string value.
func (t BackForwardCacheNotRestoredReasonType) String() string {
return string(t)
}
// BackForwardCacheNotRestoredReasonType values.
const (
BackForwardCacheNotRestoredReasonTypeSupportPending BackForwardCacheNotRestoredReasonType = "SupportPending"
BackForwardCacheNotRestoredReasonTypePageSupportNeeded BackForwardCacheNotRestoredReasonType = "PageSupportNeeded"
BackForwardCacheNotRestoredReasonTypeCircumstantial BackForwardCacheNotRestoredReasonType = "Circumstantial"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t BackForwardCacheNotRestoredReasonType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t BackForwardCacheNotRestoredReasonType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *BackForwardCacheNotRestoredReasonType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch BackForwardCacheNotRestoredReasonType(in.String()) {
case BackForwardCacheNotRestoredReasonTypeSupportPending:
*t = BackForwardCacheNotRestoredReasonTypeSupportPending
case BackForwardCacheNotRestoredReasonTypePageSupportNeeded:
*t = BackForwardCacheNotRestoredReasonTypePageSupportNeeded
case BackForwardCacheNotRestoredReasonTypeCircumstantial:
*t = BackForwardCacheNotRestoredReasonTypeCircumstantial
default:
in.AddError(errors.New("unknown BackForwardCacheNotRestoredReasonType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *BackForwardCacheNotRestoredReasonType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// BackForwardCacheNotRestoredExplanation [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#type-BackForwardCacheNotRestoredExplanation
type BackForwardCacheNotRestoredExplanation struct {
Type BackForwardCacheNotRestoredReasonType `json:"type"` // Type of the reason
Reason BackForwardCacheNotRestoredReason `json:"reason"` // Not restored reason
}
// FileChooserOpenedMode input mode.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-fileChooserOpened
@@ -511,50 +1214,47 @@ func (t *FileChooserOpenedMode) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// DownloadProgressState download status.
// FrameDetachedReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-downloadProgress
type DownloadProgressState string
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#event-frameDetached
type FrameDetachedReason string
// String returns the DownloadProgressState as string value.
func (t DownloadProgressState) String() string {
// String returns the FrameDetachedReason as string value.
func (t FrameDetachedReason) String() string {
return string(t)
}
// DownloadProgressState values.
// FrameDetachedReason values.
const (
DownloadProgressStateInProgress DownloadProgressState = "inProgress"
DownloadProgressStateCompleted DownloadProgressState = "completed"
DownloadProgressStateCanceled DownloadProgressState = "canceled"
FrameDetachedReasonRemove FrameDetachedReason = "remove"
FrameDetachedReasonSwap FrameDetachedReason = "swap"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t DownloadProgressState) MarshalEasyJSON(out *jwriter.Writer) {
func (t FrameDetachedReason) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t DownloadProgressState) MarshalJSON() ([]byte, error) {
func (t FrameDetachedReason) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *DownloadProgressState) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch DownloadProgressState(in.String()) {
case DownloadProgressStateInProgress:
*t = DownloadProgressStateInProgress
case DownloadProgressStateCompleted:
*t = DownloadProgressStateCompleted
case DownloadProgressStateCanceled:
*t = DownloadProgressStateCanceled
func (t *FrameDetachedReason) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch FrameDetachedReason(in.String()) {
case FrameDetachedReasonRemove:
*t = FrameDetachedReasonRemove
case FrameDetachedReasonSwap:
*t = FrameDetachedReasonSwap
default:
in.AddError(errors.New("unknown DownloadProgressState value"))
in.AddError(errors.New("unknown FrameDetachedReason value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *DownloadProgressState) UnmarshalJSON(buf []byte) error {
func (t *FrameDetachedReason) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
@@ -572,6 +1272,7 @@ func (t CaptureScreenshotFormat) String() string {
const (
CaptureScreenshotFormatJpeg CaptureScreenshotFormat = "jpeg"
CaptureScreenshotFormatPng CaptureScreenshotFormat = "png"
CaptureScreenshotFormatWebp CaptureScreenshotFormat = "webp"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
@@ -591,6 +1292,8 @@ func (t *CaptureScreenshotFormat) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = CaptureScreenshotFormatJpeg
case CaptureScreenshotFormatPng:
*t = CaptureScreenshotFormatPng
case CaptureScreenshotFormatWebp:
*t = CaptureScreenshotFormatWebp
default:
in.AddError(errors.New("unknown CaptureScreenshotFormat value"))
@@ -687,6 +1390,54 @@ func (t *PrintToPDFTransferMode) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// SetDownloadBehaviorBehavior whether to allow all or deny all download
// requests, or use default Chrome behavior if available (otherwise deny).
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setDownloadBehavior
type SetDownloadBehaviorBehavior string
// String returns the SetDownloadBehaviorBehavior as string value.
func (t SetDownloadBehaviorBehavior) String() string {
return string(t)
}
// SetDownloadBehaviorBehavior values.
const (
SetDownloadBehaviorBehaviorDeny SetDownloadBehaviorBehavior = "deny"
SetDownloadBehaviorBehaviorAllow SetDownloadBehaviorBehavior = "allow"
SetDownloadBehaviorBehaviorDefault SetDownloadBehaviorBehavior = "default"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t SetDownloadBehaviorBehavior) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t SetDownloadBehaviorBehavior) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *SetDownloadBehaviorBehavior) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch SetDownloadBehaviorBehavior(in.String()) {
case SetDownloadBehaviorBehaviorDeny:
*t = SetDownloadBehaviorBehaviorDeny
case SetDownloadBehaviorBehaviorAllow:
*t = SetDownloadBehaviorBehaviorAllow
case SetDownloadBehaviorBehaviorDefault:
*t = SetDownloadBehaviorBehaviorDefault
default:
in.AddError(errors.New("unknown SetDownloadBehaviorBehavior value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *SetDownloadBehaviorBehavior) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// ScreencastFormat image compression format.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-startScreencast