playwright-core
Version:
A high-level API to automate web browsers
1,746 lines (1,727 loc) • 519 kB
TypeScript
// This is generated from /utils/protocol-types-generator/index.js
type binary = string;
export module Protocol {
export module Accessibility {
/**
* Unique accessibility node identifier.
*/
export type AXNodeId = string;
/**
* Enum of possible property types.
*/
export type AXValueType = "boolean"|"tristate"|"booleanOrUndefined"|"idref"|"idrefList"|"integer"|"node"|"nodeList"|"number"|"string"|"computedString"|"token"|"tokenList"|"domRelation"|"role"|"internalRole"|"valueUndefined";
/**
* Enum of possible property sources.
*/
export type AXValueSourceType = "attribute"|"implicit"|"style"|"contents"|"placeholder"|"relatedElement";
/**
* Enum of possible native property sources (as a subtype of a particular AXValueSourceType).
*/
export type AXValueNativeSourceType = "figcaption"|"label"|"labelfor"|"labelwrapped"|"legend"|"rubyannotation"|"tablecaption"|"title"|"other";
/**
* A single source for a computed AX property.
*/
export interface AXValueSource {
/**
* What type of source this is.
*/
type: AXValueSourceType;
/**
* The value of this property source.
*/
value?: AXValue;
/**
* The name of the relevant attribute, if any.
*/
attribute?: string;
/**
* The value of the relevant attribute, if any.
*/
attributeValue?: AXValue;
/**
* Whether this source is superseded by a higher priority source.
*/
superseded?: boolean;
/**
* The native markup source for this value, e.g. a <label> element.
*/
nativeSource?: AXValueNativeSourceType;
/**
* The value, such as a node or node list, of the native source.
*/
nativeSourceValue?: AXValue;
/**
* Whether the value for this property is invalid.
*/
invalid?: boolean;
/**
* Reason for the value being invalid, if it is.
*/
invalidReason?: string;
}
export interface AXRelatedNode {
/**
* The BackendNodeId of the related DOM node.
*/
backendDOMNodeId: DOM.BackendNodeId;
/**
* The IDRef value provided, if any.
*/
idref?: string;
/**
* The text alternative of this node in the current context.
*/
text?: string;
}
export interface AXProperty {
/**
* The name of this property.
*/
name: AXPropertyName;
/**
* The value of this property.
*/
value: AXValue;
}
/**
* A single computed AX property.
*/
export interface AXValue {
/**
* The type of this value.
*/
type: AXValueType;
/**
* The computed value of this property.
*/
value?: any;
/**
* One or more related nodes, if applicable.
*/
relatedNodes?: AXRelatedNode[];
/**
* The sources which contributed to the computation of this property.
*/
sources?: AXValueSource[];
}
/**
* Values of AXProperty name:
- from 'busy' to 'roledescription': states which apply to every AX node
- from 'live' to 'root': attributes which apply to nodes in live regions
- from 'autocomplete' to 'valuetext': attributes which apply to widgets
- from 'checked' to 'selected': states which apply to widgets
- from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling.
*/
export type AXPropertyName = "busy"|"disabled"|"editable"|"focusable"|"focused"|"hidden"|"hiddenRoot"|"invalid"|"keyshortcuts"|"settable"|"roledescription"|"live"|"atomic"|"relevant"|"root"|"autocomplete"|"hasPopup"|"level"|"multiselectable"|"orientation"|"multiline"|"readonly"|"required"|"valuemin"|"valuemax"|"valuetext"|"checked"|"expanded"|"modal"|"pressed"|"selected"|"activedescendant"|"controls"|"describedby"|"details"|"errormessage"|"flowto"|"labelledby"|"owns";
/**
* A node in the accessibility tree.
*/
export interface AXNode {
/**
* Unique identifier for this node.
*/
nodeId: AXNodeId;
/**
* Whether this node is ignored for accessibility
*/
ignored: boolean;
/**
* Collection of reasons why this node is hidden.
*/
ignoredReasons?: AXProperty[];
/**
* This `Node`'s role, whether explicit or implicit.
*/
role?: AXValue;
/**
* The accessible name for this `Node`.
*/
name?: AXValue;
/**
* The accessible description for this `Node`.
*/
description?: AXValue;
/**
* The value for this `Node`.
*/
value?: AXValue;
/**
* All other properties
*/
properties?: AXProperty[];
/**
* IDs for each of this node's child nodes.
*/
childIds?: AXNodeId[];
/**
* The backend ID for the associated DOM node, if any.
*/
backendDOMNodeId?: DOM.BackendNodeId;
}
/**
* Disables the accessibility domain.
*/
export type disableParameters = {
}
export type disableReturnValue = {
}
/**
* Enables the accessibility domain which causes `AXNodeId`s to remain consistent between method calls.
This turns on accessibility for the page, which can impact performance until accessibility is disabled.
*/
export type enableParameters = {
}
export type enableReturnValue = {
}
/**
* Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.
*/
export type getPartialAXTreeParameters = {
/**
* Identifier of the node to get the partial accessibility tree for.
*/
nodeId?: DOM.NodeId;
/**
* Identifier of the backend node to get the partial accessibility tree for.
*/
backendNodeId?: DOM.BackendNodeId;
/**
* JavaScript object id of the node wrapper to get the partial accessibility tree for.
*/
objectId?: Runtime.RemoteObjectId;
/**
* Whether to fetch this nodes ancestors, siblings and children. Defaults to true.
*/
fetchRelatives?: boolean;
}
export type getPartialAXTreeReturnValue = {
/**
* The `Accessibility.AXNode` for this DOM node, if it exists, plus its ancestors, siblings and
children, if requested.
*/
nodes: AXNode[];
}
/**
* Fetches the entire accessibility tree for the root Document
*/
export type getFullAXTreeParameters = {
/**
* The maximum depth at which descendants of the root node should be retrieved.
If omitted, the full tree is returned.
*/
max_depth?: number;
}
export type getFullAXTreeReturnValue = {
nodes: AXNode[];
}
/**
* Fetches a particular accessibility node by AXNodeId.
Requires `enable()` to have been called previously.
*/
export type getChildAXNodesParameters = {
id: AXNodeId;
}
export type getChildAXNodesReturnValue = {
nodes: AXNode[];
}
/**
* Query a DOM node's accessibility subtree for accessible name and role.
This command computes the name and role for all nodes in the subtree, including those that are
ignored for accessibility, and returns those that mactch the specified name and role. If no DOM
node is specified, or the DOM node does not exist, the command returns an error. If neither
`accessibleName` or `role` is specified, it returns all the accessibility nodes in the subtree.
*/
export type queryAXTreeParameters = {
/**
* Identifier of the node for the root to query.
*/
nodeId?: DOM.NodeId;
/**
* Identifier of the backend node for the root to query.
*/
backendNodeId?: DOM.BackendNodeId;
/**
* JavaScript object id of the node wrapper for the root to query.
*/
objectId?: Runtime.RemoteObjectId;
/**
* Find nodes with this computed name.
*/
accessibleName?: string;
/**
* Find nodes with this computed role.
*/
role?: string;
}
export type queryAXTreeReturnValue = {
/**
* A list of `Accessibility.AXNode` matching the specified attributes,
including nodes that are ignored for accessibility.
*/
nodes: AXNode[];
}
}
export module Animation {
/**
* Animation instance.
*/
export interface Animation {
/**
* `Animation`'s id.
*/
id: string;
/**
* `Animation`'s name.
*/
name: string;
/**
* `Animation`'s internal paused state.
*/
pausedState: boolean;
/**
* `Animation`'s play state.
*/
playState: string;
/**
* `Animation`'s playback rate.
*/
playbackRate: number;
/**
* `Animation`'s start time.
*/
startTime: number;
/**
* `Animation`'s current time.
*/
currentTime: number;
/**
* Animation type of `Animation`.
*/
type: "CSSTransition"|"CSSAnimation"|"WebAnimation";
/**
* `Animation`'s source animation node.
*/
source?: AnimationEffect;
/**
* A unique ID for `Animation` representing the sources that triggered this CSS
animation/transition.
*/
cssId?: string;
}
/**
* AnimationEffect instance
*/
export interface AnimationEffect {
/**
* `AnimationEffect`'s delay.
*/
delay: number;
/**
* `AnimationEffect`'s end delay.
*/
endDelay: number;
/**
* `AnimationEffect`'s iteration start.
*/
iterationStart: number;
/**
* `AnimationEffect`'s iterations.
*/
iterations: number;
/**
* `AnimationEffect`'s iteration duration.
*/
duration: number;
/**
* `AnimationEffect`'s playback direction.
*/
direction: string;
/**
* `AnimationEffect`'s fill mode.
*/
fill: string;
/**
* `AnimationEffect`'s target node.
*/
backendNodeId?: DOM.BackendNodeId;
/**
* `AnimationEffect`'s keyframes.
*/
keyframesRule?: KeyframesRule;
/**
* `AnimationEffect`'s timing function.
*/
easing: string;
}
/**
* Keyframes Rule
*/
export interface KeyframesRule {
/**
* CSS keyframed animation's name.
*/
name?: string;
/**
* List of animation keyframes.
*/
keyframes: KeyframeStyle[];
}
/**
* Keyframe Style
*/
export interface KeyframeStyle {
/**
* Keyframe's time offset.
*/
offset: string;
/**
* `AnimationEffect`'s timing function.
*/
easing: string;
}
/**
* Event for when an animation has been cancelled.
*/
export type animationCanceledPayload = {
/**
* Id of the animation that was cancelled.
*/
id: string;
}
/**
* Event for each animation that has been created.
*/
export type animationCreatedPayload = {
/**
* Id of the animation that was created.
*/
id: string;
}
/**
* Event for animation that has been started.
*/
export type animationStartedPayload = {
/**
* Animation that was started.
*/
animation: Animation;
}
/**
* Disables animation domain notifications.
*/
export type disableParameters = {
}
export type disableReturnValue = {
}
/**
* Enables animation domain notifications.
*/
export type enableParameters = {
}
export type enableReturnValue = {
}
/**
* Returns the current time of the an animation.
*/
export type getCurrentTimeParameters = {
/**
* Id of animation.
*/
id: string;
}
export type getCurrentTimeReturnValue = {
/**
* Current time of the page.
*/
currentTime: number;
}
/**
* Gets the playback rate of the document timeline.
*/
export type getPlaybackRateParameters = {
}
export type getPlaybackRateReturnValue = {
/**
* Playback rate for animations on page.
*/
playbackRate: number;
}
/**
* Releases a set of animations to no longer be manipulated.
*/
export type releaseAnimationsParameters = {
/**
* List of animation ids to seek.
*/
animations: string[];
}
export type releaseAnimationsReturnValue = {
}
/**
* Gets the remote object of the Animation.
*/
export type resolveAnimationParameters = {
/**
* Animation id.
*/
animationId: string;
}
export type resolveAnimationReturnValue = {
/**
* Corresponding remote object.
*/
remoteObject: Runtime.RemoteObject;
}
/**
* Seek a set of animations to a particular time within each animation.
*/
export type seekAnimationsParameters = {
/**
* List of animation ids to seek.
*/
animations: string[];
/**
* Set the current time of each animation.
*/
currentTime: number;
}
export type seekAnimationsReturnValue = {
}
/**
* Sets the paused state of a set of animations.
*/
export type setPausedParameters = {
/**
* Animations to set the pause state of.
*/
animations: string[];
/**
* Paused state to set to.
*/
paused: boolean;
}
export type setPausedReturnValue = {
}
/**
* Sets the playback rate of the document timeline.
*/
export type setPlaybackRateParameters = {
/**
* Playback rate for animations on page
*/
playbackRate: number;
}
export type setPlaybackRateReturnValue = {
}
/**
* Sets the timing of an animation node.
*/
export type setTimingParameters = {
/**
* Animation id.
*/
animationId: string;
/**
* Duration of the animation.
*/
duration: number;
/**
* Delay of the animation.
*/
delay: number;
}
export type setTimingReturnValue = {
}
}
export module ApplicationCache {
/**
* Detailed application cache resource information.
*/
export interface ApplicationCacheResource {
/**
* Resource url.
*/
url: string;
/**
* Resource size.
*/
size: number;
/**
* Resource type.
*/
type: string;
}
/**
* Detailed application cache information.
*/
export interface ApplicationCache {
/**
* Manifest URL.
*/
manifestURL: string;
/**
* Application cache size.
*/
size: number;
/**
* Application cache creation time.
*/
creationTime: number;
/**
* Application cache update time.
*/
updateTime: number;
/**
* Application cache resources.
*/
resources: ApplicationCacheResource[];
}
/**
* Frame identifier - manifest URL pair.
*/
export interface FrameWithManifest {
/**
* Frame identifier.
*/
frameId: Page.FrameId;
/**
* Manifest URL.
*/
manifestURL: string;
/**
* Application cache status.
*/
status: number;
}
export type applicationCacheStatusUpdatedPayload = {
/**
* Identifier of the frame containing document whose application cache updated status.
*/
frameId: Page.FrameId;
/**
* Manifest URL.
*/
manifestURL: string;
/**
* Updated application cache status.
*/
status: number;
}
export type networkStateUpdatedPayload = {
isNowOnline: boolean;
}
/**
* Enables application cache domain notifications.
*/
export type enableParameters = {
}
export type enableReturnValue = {
}
/**
* Returns relevant application cache data for the document in given frame.
*/
export type getApplicationCacheForFrameParameters = {
/**
* Identifier of the frame containing document whose application cache is retrieved.
*/
frameId: Page.FrameId;
}
export type getApplicationCacheForFrameReturnValue = {
/**
* Relevant application cache data for the document in given frame.
*/
applicationCache: ApplicationCache;
}
/**
* Returns array of frame identifiers with manifest urls for each frame containing a document
associated with some application cache.
*/
export type getFramesWithManifestsParameters = {
}
export type getFramesWithManifestsReturnValue = {
/**
* Array of frame identifiers with manifest urls for each frame containing a document
associated with some application cache.
*/
frameIds: FrameWithManifest[];
}
/**
* Returns manifest URL for document in the given frame.
*/
export type getManifestForFrameParameters = {
/**
* Identifier of the frame containing document whose manifest is retrieved.
*/
frameId: Page.FrameId;
}
export type getManifestForFrameReturnValue = {
/**
* Manifest URL for document in the given frame.
*/
manifestURL: string;
}
}
/**
* Audits domain allows investigation of page violations and possible improvements.
*/
export module Audits {
/**
* Information about a cookie that is affected by an inspector issue.
*/
export interface AffectedCookie {
/**
* The following three properties uniquely identify a cookie
*/
name: string;
path: string;
domain: string;
}
/**
* Information about a request that is affected by an inspector issue.
*/
export interface AffectedRequest {
/**
* The unique request id.
*/
requestId: Network.RequestId;
url?: string;
}
/**
* Information about the frame affected by an inspector issue.
*/
export interface AffectedFrame {
frameId: Page.FrameId;
}
export type SameSiteCookieExclusionReason = "ExcludeSameSiteUnspecifiedTreatedAsLax"|"ExcludeSameSiteNoneInsecure"|"ExcludeSameSiteLax"|"ExcludeSameSiteStrict";
export type SameSiteCookieWarningReason = "WarnSameSiteUnspecifiedCrossSiteContext"|"WarnSameSiteNoneInsecure"|"WarnSameSiteUnspecifiedLaxAllowUnsafe"|"WarnSameSiteStrictLaxDowngradeStrict"|"WarnSameSiteStrictCrossDowngradeStrict"|"WarnSameSiteStrictCrossDowngradeLax"|"WarnSameSiteLaxCrossDowngradeStrict"|"WarnSameSiteLaxCrossDowngradeLax";
export type SameSiteCookieOperation = "SetCookie"|"ReadCookie";
/**
* This information is currently necessary, as the front-end has a difficult
time finding a specific cookie. With this, we can convey specific error
information without the cookie.
*/
export interface SameSiteCookieIssueDetails {
cookie: AffectedCookie;
cookieWarningReasons: SameSiteCookieWarningReason[];
cookieExclusionReasons: SameSiteCookieExclusionReason[];
/**
* Optionally identifies the site-for-cookies and the cookie url, which
may be used by the front-end as additional context.
*/
operation: SameSiteCookieOperation;
siteForCookies?: string;
cookieUrl?: string;
request?: AffectedRequest;
}
export type MixedContentResolutionStatus = "MixedContentBlocked"|"MixedContentAutomaticallyUpgraded"|"MixedContentWarning";
export type MixedContentResourceType = "Audio"|"Beacon"|"CSPReport"|"Download"|"EventSource"|"Favicon"|"Font"|"Form"|"Frame"|"Image"|"Import"|"Manifest"|"Ping"|"PluginData"|"PluginResource"|"Prefetch"|"Resource"|"Script"|"ServiceWorker"|"SharedWorker"|"Stylesheet"|"Track"|"Video"|"Worker"|"XMLHttpRequest"|"XSLT";
export interface MixedContentIssueDetails {
/**
* The type of resource causing the mixed content issue (css, js, iframe,
form,...). Marked as optional because it is mapped to from
blink::mojom::RequestContextType, which will be replaced
by network::mojom::RequestDestination
*/
resourceType?: MixedContentResourceType;
/**
* The way the mixed content issue is being resolved.
*/
resolutionStatus: MixedContentResolutionStatus;
/**
* The unsafe http url causing the mixed content issue.
*/
insecureURL: string;
/**
* The url responsible for the call to an unsafe url.
*/
mainResourceURL: string;
/**
* The mixed content request.
Does not always exist (e.g. for unsafe form submission urls).
*/
request?: AffectedRequest;
/**
* Optional because not every mixed content issue is necessarily linked to a frame.
*/
frame?: AffectedFrame;
}
/**
* Enum indicating the reason a response has been blocked. These reasons are
refinements of the net error BLOCKED_BY_RESPONSE.
*/
export type BlockedByResponseReason = "CoepFrameResourceNeedsCoepHeader"|"CoopSandboxedIFrameCannotNavigateToCoopPage"|"CorpNotSameOrigin"|"CorpNotSameOriginAfterDefaultedToSameOriginByCoep"|"CorpNotSameSite";
/**
* Details for a request that has been blocked with the BLOCKED_BY_RESPONSE
code. Currently only used for COEP/COOP, but may be extended to include
some CSP errors in the future.
*/
export interface BlockedByResponseIssueDetails {
request: AffectedRequest;
parentFrame?: AffectedFrame;
blockedFrame?: AffectedFrame;
reason: BlockedByResponseReason;
}
export type HeavyAdResolutionStatus = "HeavyAdBlocked"|"HeavyAdWarning";
export type HeavyAdReason = "NetworkTotalLimit"|"CpuTotalLimit"|"CpuPeakLimit";
export interface HeavyAdIssueDetails {
/**
* The resolution status, either blocking the content or warning.
*/
resolution: HeavyAdResolutionStatus;
/**
* The reason the ad was blocked, total network or cpu or peak cpu.
*/
reason: HeavyAdReason;
/**
* The frame that was blocked.
*/
frame: AffectedFrame;
}
export type ContentSecurityPolicyViolationType = "kInlineViolation"|"kEvalViolation"|"kURLViolation"|"kTrustedTypesSinkViolation"|"kTrustedTypesPolicyViolation";
export interface SourceCodeLocation {
scriptId?: Runtime.ScriptId;
url: string;
lineNumber: number;
columnNumber: number;
}
export interface ContentSecurityPolicyIssueDetails {
/**
* The url not included in allowed sources.
*/
blockedURL?: string;
/**
* Specific directive that is violated, causing the CSP issue.
*/
violatedDirective: string;
isReportOnly: boolean;
contentSecurityPolicyViolationType: ContentSecurityPolicyViolationType;
frameAncestor?: AffectedFrame;
sourceCodeLocation?: SourceCodeLocation;
violatingNodeId?: DOM.BackendNodeId;
}
export type SharedArrayBufferIssueType = "TransferIssue"|"CreationIssue";
/**
* Details for a issue arising from an SAB being instantiated in, or
transfered to a context that is not cross-origin isolated.
*/
export interface SharedArrayBufferIssueDetails {
sourceCodeLocation: SourceCodeLocation;
isWarning: boolean;
type: SharedArrayBufferIssueType;
}
export type TwaQualityEnforcementViolationType = "kHttpError"|"kUnavailableOffline"|"kDigitalAssetLinks";
export interface TrustedWebActivityIssueDetails {
/**
* The url that triggers the violation.
*/
url: string;
violationType: TwaQualityEnforcementViolationType;
httpStatusCode?: number;
/**
* The package name of the Trusted Web Activity client app. This field is
only used when violation type is kDigitalAssetLinks.
*/
packageName?: string;
/**
* The signature of the Trusted Web Activity client app. This field is only
used when violation type is kDigitalAssetLinks.
*/
signature?: string;
}
export interface LowTextContrastIssueDetails {
violatingNodeId: DOM.BackendNodeId;
violatingNodeSelector: string;
contrastRatio: number;
thresholdAA: number;
thresholdAAA: number;
fontSize: string;
fontWeight: string;
}
/**
* Details for a CORS related issue, e.g. a warning or error related to
CORS RFC1918 enforcement.
*/
export interface CorsIssueDetails {
corsErrorStatus: Network.CorsErrorStatus;
isWarning: boolean;
request: AffectedRequest;
resourceIPAddressSpace?: Network.IPAddressSpace;
clientSecurityState?: Network.ClientSecurityState;
}
/**
* A unique identifier for the type of issue. Each type may use one of the
optional fields in InspectorIssueDetails to convey more specific
information about the kind of issue.
*/
export type InspectorIssueCode = "SameSiteCookieIssue"|"MixedContentIssue"|"BlockedByResponseIssue"|"HeavyAdIssue"|"ContentSecurityPolicyIssue"|"SharedArrayBufferIssue"|"TrustedWebActivityIssue"|"LowTextContrastIssue"|"CorsIssue";
/**
* This struct holds a list of optional fields with additional information
specific to the kind of issue. When adding a new issue code, please also
add a new optional field to this type.
*/
export interface InspectorIssueDetails {
sameSiteCookieIssueDetails?: SameSiteCookieIssueDetails;
mixedContentIssueDetails?: MixedContentIssueDetails;
blockedByResponseIssueDetails?: BlockedByResponseIssueDetails;
heavyAdIssueDetails?: HeavyAdIssueDetails;
contentSecurityPolicyIssueDetails?: ContentSecurityPolicyIssueDetails;
sharedArrayBufferIssueDetails?: SharedArrayBufferIssueDetails;
twaQualityEnforcementDetails?: TrustedWebActivityIssueDetails;
lowTextContrastIssueDetails?: LowTextContrastIssueDetails;
corsIssueDetails?: CorsIssueDetails;
}
/**
* An inspector issue reported from the back-end.
*/
export interface InspectorIssue {
code: InspectorIssueCode;
details: InspectorIssueDetails;
}
export type issueAddedPayload = {
issue: InspectorIssue;
}
/**
* Returns the response body and size if it were re-encoded with the specified settings. Only
applies to images.
*/
export type getEncodedResponseParameters = {
/**
* Identifier of the network request to get content for.
*/
requestId: Network.RequestId;
/**
* The encoding to use.
*/
encoding: "webp"|"jpeg"|"png";
/**
* The quality of the encoding (0-1). (defaults to 1)
*/
quality?: number;
/**
* Whether to only return the size information (defaults to false).
*/
sizeOnly?: boolean;
}
export type getEncodedResponseReturnValue = {
/**
* The encoded body as a base64 string. Omitted if sizeOnly is true.
*/
body?: binary;
/**
* Size before re-encoding.
*/
originalSize: number;
/**
* Size after re-encoding.
*/
encodedSize: number;
}
/**
* Disables issues domain, prevents further issues from being reported to the client.
*/
export type disableParameters = {
}
export type disableReturnValue = {
}
/**
* Enables issues domain, sends the issues collected so far to the client by means of the
`issueAdded` event.
*/
export type enableParameters = {
}
export type enableReturnValue = {
}
/**
* Runs the contrast check for the target page. Found issues are reported
using Audits.issueAdded event.
*/
export type checkContrastParameters = {
}
export type checkContrastReturnValue = {
}
}
/**
* Defines events for background web platform features.
*/
export module BackgroundService {
/**
* The Background Service that will be associated with the commands/events.
Every Background Service operates independently, but they share the same
API.
*/
export type ServiceName = "backgroundFetch"|"backgroundSync"|"pushMessaging"|"notifications"|"paymentHandler"|"periodicBackgroundSync";
/**
* A key-value pair for additional event information to pass along.
*/
export interface EventMetadata {
key: string;
value: string;
}
export interface BackgroundServiceEvent {
/**
* Timestamp of the event (in seconds).
*/
timestamp: Network.TimeSinceEpoch;
/**
* The origin this event belongs to.
*/
origin: string;
/**
* The Service Worker ID that initiated the event.
*/
serviceWorkerRegistrationId: ServiceWorker.RegistrationID;
/**
* The Background Service this event belongs to.
*/
service: ServiceName;
/**
* A description of the event.
*/
eventName: string;
/**
* An identifier that groups related events together.
*/
instanceId: string;
/**
* A list of event-specific information.
*/
eventMetadata: EventMetadata[];
}
/**
* Called when the recording state for the service has been updated.
*/
export type recordingStateChangedPayload = {
isRecording: boolean;
service: ServiceName;
}
/**
* Called with all existing backgroundServiceEvents when enabled, and all new
events afterwards if enabled and recording.
*/
export type backgroundServiceEventReceivedPayload = {
backgroundServiceEvent: BackgroundServiceEvent;
}
/**
* Enables event updates for the service.
*/
export type startObservingParameters = {
service: ServiceName;
}
export type startObservingReturnValue = {
}
/**
* Disables event updates for the service.
*/
export type stopObservingParameters = {
service: ServiceName;
}
export type stopObservingReturnValue = {
}
/**
* Set the recording state for the service.
*/
export type setRecordingParameters = {
shouldRecord: boolean;
service: ServiceName;
}
export type setRecordingReturnValue = {
}
/**
* Clears all stored data for the service.
*/
export type clearEventsParameters = {
service: ServiceName;
}
export type clearEventsReturnValue = {
}
}
/**
* The Browser domain defines methods and events for browser managing.
*/
export module Browser {
export type BrowserContextID = string;
export type WindowID = number;
/**
* The state of the browser window.
*/
export type WindowState = "normal"|"minimized"|"maximized"|"fullscreen";
/**
* Browser window bounds information
*/
export interface Bounds {
/**
* The offset from the left edge of the screen to the window in pixels.
*/
left?: number;
/**
* The offset from the top edge of the screen to the window in pixels.
*/
top?: number;
/**
* The window width in pixels.
*/
width?: number;
/**
* The window height in pixels.
*/
height?: number;
/**
* The window state. Default to normal.
*/
windowState?: WindowState;
}
export type PermissionType = "accessibilityEvents"|"audioCapture"|"backgroundSync"|"backgroundFetch"|"clipboardReadWrite"|"clipboardSanitizedWrite"|"displayCapture"|"durableStorage"|"flash"|"geolocation"|"midi"|"midiSysex"|"nfc"|"notifications"|"paymentHandler"|"periodicBackgroundSync"|"protectedMediaIdentifier"|"sensors"|"videoCapture"|"videoCapturePanTiltZoom"|"idleDetection"|"wakeLockScreen"|"wakeLockSystem";
export type PermissionSetting = "granted"|"denied"|"prompt";
/**
* Definition of PermissionDescriptor defined in the Permissions API:
https://w3c.github.io/permissions/#dictdef-permissiondescriptor.
*/
export interface PermissionDescriptor {
/**
* Name of permission.
See https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/permissions/permission_descriptor.idl for valid permission names.
*/
name: string;
/**
* For "midi" permission, may also specify sysex control.
*/
sysex?: boolean;
/**
* For "push" permission, may specify userVisibleOnly.
Note that userVisibleOnly = true is the only currently supported type.
*/
userVisibleOnly?: boolean;
/**
* For "clipboard" permission, may specify allowWithoutSanitization.
*/
allowWithoutSanitization?: boolean;
/**
* For "camera" permission, may specify panTiltZoom.
*/
panTiltZoom?: boolean;
}
/**
* Browser command ids used by executeBrowserCommand.
*/
export type BrowserCommandId = "openTabSearch"|"closeTabSearch";
/**
* Chrome histogram bucket.
*/
export interface Bucket {
/**
* Minimum value (inclusive).
*/
low: number;
/**
* Maximum value (exclusive).
*/
high: number;
/**
* Number of samples.
*/
count: number;
}
/**
* Chrome histogram.
*/
export interface Histogram {
/**
* Name.
*/
name: string;
/**
* Sum of sample values.
*/
sum: number;
/**
* Total number of samples.
*/
count: number;
/**
* Buckets.
*/
buckets: Bucket[];
}
/**
* Set permission settings for given origin.
*/
export type setPermissionParameters = {
/**
* Descriptor of permission to override.
*/
permission: PermissionDescriptor;
/**
* Setting of the permission.
*/
setting: PermissionSetting;
/**
* Origin the permission applies to, all origins if not specified.
*/
origin?: string;
/**
* Context to override. When omitted, default browser context is used.
*/
browserContextId?: BrowserContextID;
}
export type setPermissionReturnValue = {
}
/**
* Grant specific permissions to the given origin and reject all others.
*/
export type grantPermissionsParameters = {
permissions: PermissionType[];
/**
* Origin the permission applies to, all origins if not specified.
*/
origin?: string;
/**
* BrowserContext to override permissions. When omitted, default browser context is used.
*/
browserContextId?: BrowserContextID;
}
export type grantPermissionsReturnValue = {
}
/**
* Reset all permission management for all origins.
*/
export type resetPermissionsParameters = {
/**
* BrowserContext to reset permissions. When omitted, default browser context is used.
*/
browserContextId?: BrowserContextID;
}
export type resetPermissionsReturnValue = {
}
/**
* Set the behavior when downloading a file.
*/
export type setDownloadBehaviorParameters = {
/**
* Whether to allow all or deny all download requests, or use default Chrome behavior if
available (otherwise deny). |allowAndName| allows download and names files according to
their dowmload guids.
*/
behavior: "deny"|"allow"|"allowAndName"|"default";
/**
* BrowserContext to set download behavior. When omitted, default browser context is used.
*/
browserContextId?: BrowserContextID;
/**
* The default path to save downloaded files to. This is requred if behavior is set to 'allow'
or 'allowAndName'.
*/
downloadPath?: string;
}
export type setDownloadBehaviorReturnValue = {
}
/**
* Close browser gracefully.
*/
export type closeParameters = {
}
export type closeReturnValue = {
}
/**
* Crashes browser on the main thread.
*/
export type crashParameters = {
}
export type crashReturnValue = {
}
/**
* Crashes GPU process.
*/
export type crashGpuProcessParameters = {
}
export type crashGpuProcessReturnValue = {
}
/**
* Returns version information.
*/
export type getVersionParameters = {
}
export type getVersionReturnValue = {
/**
* Protocol version.
*/
protocolVersion: string;
/**
* Product name.
*/
product: string;
/**
* Product revision.
*/
revision: string;
/**
* User-Agent.
*/
userAgent: string;
/**
* V8 version.
*/
jsVersion: string;
}
/**
* Returns the command line switches for the browser process if, and only if
--enable-automation is on the commandline.
*/
export type getBrowserCommandLineParameters = {
}
export type getBrowserCommandLineReturnValue = {
/**
* Commandline parameters
*/
arguments: string[];
}
/**
* Get Chrome histograms.
*/
export type getHistogramsParameters = {
/**
* Requested substring in name. Only histograms which have query as a
substring in their name are extracted. An empty or absent query returns
all histograms.
*/
query?: string;
/**
* If true, retrieve delta since last call.
*/
delta?: boolean;
}
export type getHistogramsReturnValue = {
/**
* Histograms.
*/
histograms: Histogram[];
}
/**
* Get a Chrome histogram by name.
*/
export type getHistogramParameters = {
/**
* Requested histogram name.
*/
name: string;
/**
* If true, retrieve delta since last call.
*/
delta?: boolean;
}
export type getHistogramReturnValue = {
/**
* Histogram.
*/
histogram: Histogram;
}
/**
* Get position and size of the browser window.
*/
export type getWindowBoundsParameters = {
/**
* Browser window id.
*/
windowId: WindowID;
}
export type getWindowBoundsReturnValue = {
/**
* Bounds information of the window. When window state is 'minimized', the restored window
position and size are returned.
*/
bounds: Bounds;
}
/**
* Get the browser window that contains the devtools target.
*/
export type getWindowForTargetParameters = {
/**
* Devtools agent host id. If called as a part of the session, associated targetId is used.
*/
targetId?: Target.TargetID;
}
export type getWindowForTargetReturnValue = {
/**
* Browser window id.
*/
windowId: WindowID;
/**
* Bounds information of the window. When window state is 'minimized', the restored window
position and size are returned.
*/
bounds: Bounds;
}
/**
* Set position and/or size of the browser window.
*/
export type setWindowBoundsParameters = {
/**
* Browser window id.
*/
windowId: WindowID;
/**
* New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined
with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged.
*/
bounds: Bounds;
}
export type setWindowBoundsReturnValue = {
}
/**
* Set dock tile details, platform-specific.
*/
export type setDockTileParameters = {
badgeLabel?: string;
/**
* Png encoded image.
*/
image?: binary;
}
export type setDockTileReturnValue = {
}
/**
* Invoke custom browser commands used by telemetry.
*/
export type executeBrowserCommandParameters = {
commandId: BrowserCommandId;
}
export type executeBrowserCommandReturnValue = {
}
}
/**
* This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles)
have an associated `id` used in subsequent operations on the related object. Each object type has
a specific `id` structure, and those are not interchangeable between objects of different kinds.
CSS objects can be loaded using the `get*ForNode()` calls (which accept a DOM node id). A client
can also keep track of stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events and
subsequently load the required stylesheet contents using the `getStyleSheet[Text]()` methods.
*/
export module CSS {
export type StyleSheetId = string;
/**
* Stylesheet type: "injected" for stylesheets injected via extension, "user-agent" for user-agent
stylesheets, "inspector" for stylesheets created by the inspector (i.e. those holding the "via
inspector" rules), "regular" for regular stylesheets.
*/
export type StyleSheetOrigin = "injected"|"user-agent"|"inspector"|"regular";
/**
* CSS rule collection for a single pseudo style.
*/
export interface PseudoElementMatches {
/**
* Pseudo element type.
*/
pseudoType: DOM.PseudoType;
/**
* Matches of CSS rules applicable to the pseudo style.
*/
matches: RuleMatch[];
}
/**
* Inherited CSS rule collection from ancestor node.
*/
export interface InheritedStyleEntry {
/**
* The ancestor node's inline style, if any, in the style inheritance chain.
*/
inlineStyle?: CSSStyle;
/**
* Matches of CSS rules matching the ancestor node in the style inheritance chain.
*/
matchedCSSRules: RuleMatch[];
}
/**
* Match data for a CSS rule.
*/
export interface RuleMatch {
/**
* CSS rule in the match.
*/
rule: CSSRule;
/**
* Matching selector indices in the rule's selectorList selectors (0-based).
*/
matchingSelectors: number[];
}
/**
* Data for a simple selector (these are delimited by commas in a selector list).
*/
export interface Value {
/**
* Value text.
*/
text: string;
/**
* Value range in the underlying resource (if available).
*/
range?: SourceRange;
}
/**
* Selector list data.
*/
export interface SelectorList {
/**
* Selectors in the list.
*/
selectors: Value[];
/**
* Rule selector text.
*/
text: string;
}
/**
* CSS stylesheet metainformation.
*/
export interface CSSStyleSheetHeader {
/**
* The stylesheet identifier.
*/
styleSheetId: StyleSheetId;
/**
* Owner frame identifier.
*/
frameId: Page.FrameId;
/**
* Stylesheet resource URL.
*/
sourceURL: string;
/**
* URL of source map associated with the stylesheet (if any).
*/
sourceMapURL?: string;
/**
* Stylesheet origin.
*/
origin: StyleSheetOrigin;
/**
* Stylesheet title.
*/
title: string;
/**
* The backend id for the owner node of the stylesheet.
*/
ownerNode?: DOM.BackendNodeId;
/**
* Denotes whether the stylesheet is disabled.
*/
disabled: boolean;
/**
* Whether the sourceURL field value comes from the sourceURL comment.
*/
hasSourceURL?: boolean;
/**
* Whether this stylesheet is created for STYLE tag by parser. This flag is not set for
document.written STYLE tags.
*/
isInline: boolean;
/**
* Whether this stylesheet is mutable. Inline stylesheets become mutable
after they have been modified via CSSOM API.
<link> element's stylesheets become mutable only if DevTools modifies them.
Constructed stylesheets (new CSSStyleSheet()) are mutable immediately after creation.
*/
isMutable: boolean;
/**
* Whether this stylesheet is a constructed stylesheet (created using new CSSStyleSheet()).
*/
isConstructed: boolean;
/**
* Line offset of the stylesheet within the resource (zero based).
*/
startLine: number;
/**
* Column offset of the stylesheet within the resource (zero based).
*/
startColumn: number;
/**
* Size of the content (in characters).
*/
length: number;
/**
* Line offset of the end of the stylesheet within the resource (zero based).
*/
endLine: number;
/**
* Column offset of the end of the stylesheet within the resource (zero based).
*/
endColumn: number;
}
/**
* CSS rule representation.
*/
export interface CSSRule {
/**
* The css style sheet identifier (absent for user agent stylesheet and user-specified
stylesheet rules) this rule came from.
*/
styleSheetId?: StyleSheetId;
/**
* Rule selector data.
*/
selectorList: SelectorList;
/**
* Parent stylesheet's origin.
*/
origin: StyleSheetOrigin;
/**
* Associated style declaration.
*/
style: CSSStyle;
/**
* Media list array (for rules involving media queries). The array enumerates media queries
starting with the innermost one, going outwards.
*/
media?: CSSMedia[];
}
/**
* CSS coverage information.
*/
export interface RuleUsage {
/**
* The css style sheet identifier (absent for user agent stylesheet and user-specified
stylesheet rules) this rule came from.
*/
styleSheetId: StyleSheetId;
/**
* Offset of the start of the rule (including selector) from the beginning of the stylesheet.
*/
startOffset: number;
/**
* Offset of the end of the rule body from the beginning of the stylesheet.
*/
endOffset: number;
/**
* Indicates whether the rule was actually used by some element in the page.
*/
used: boolean;
}
/**
* Text range within a resource. All numbers are zero-based.
*/
export interface SourceRange {
/**
* Start line of range.
*/
startLine: number;
/**
* Start column of range (inclusive).
*/
startColumn: number;
/**
* End line of range
*/
endLine: number;
/**
* End column of range (exclusive).
*/
endColumn: number;
}
export interface ShorthandEntry {
/**
* Shorthand name.
*/
name: string;
/**
* Shorthand value.
*/
value: string;
/**
* Whether the property has "!important" annotation (implies `false` if absent).
*/
important?: boolean;
}
export interface CSSComputedStyleProperty {
/**
* Computed style property name.
*/
name: string;
/**
* Computed style property value.
*/
value: string;
}
/**
* CSS style representation.
*/
export interface CSSStyle {
/**
* The css style sheet identifier (absent for user agent stylesheet and user-specified
stylesheet rules) this rule came from.
*/
styleSheetId?: StyleSheetId;
/**
* CSS properties in the style.
*/
cssProperties: CSSProperty[];
/**
* Computed values for all shorthands found in the style.
*/
shorthandEntries: ShorthandEntry[];
/**
* Style declaration text (if available).
*/
cssText?: string;
/**
* Style declaration range in the enclosing stylesheet (if available).
*/
range?: SourceRange;
}
/**
* CSS property declaration data.
*/
export interface CSSProperty {
/**
* The property name.
*/
name: string;
/**
* The property value.
*/
value: string;
/**
* Whether the property has "!important" annotation (implies `false` if absent).
*/
important?: boolean;
/**
* Whether the property is implicit (implies `false` if absent).
*/
implicit?: boolean;
/**
* The full property text as specified in the style.
*/
text?: string;
/**
* Whether the property is understood by the browser (implies `true` if absent).
*/
parsedOk?: boolean;
/**
* Whether the property is disabled by the user (present for source-based properties only).
*/
disabled?: boolean;
/**
* The entire property range in the enclosing style declaration (if available).
*/
range?: SourceRange;
}
/**
* CSS media rule descriptor.
*/
export interface CSSMedia {
/**
* Media query text.
*/
text: string;
/**
* Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if
specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked
stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline
stylesheet's STYLE tag.
*/
source: "mediaRule"|"importRule"|"linkedSheet"|"inlineSheet";
/**
* URL of the document containing the media query description.
*/
sourceURL?: string;
/**
* The associated rule (@media or @import) header range in the enclosing stylesheet (if
available).
*/