UNPKG

rebrowser-playwright-core

Version:

A drop-in replacement for playwright-core patched with rebrowser-patches. It allows to pass modern automation detection tests.

1,537 lines (1,519 loc) 695 kB
// 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 = "description"|"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"|"url"; /** * 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; /** * This `Node`'s Chrome raw role. */ chromeRole?: 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[]; /** * ID for this node's parent. */ parentId?: AXNodeId; /** * IDs for each of this node's child nodes. */ childIds?: AXNodeId[]; /** * The backend ID for the associated DOM node, if any. */ backendDOMNodeId?: DOM.BackendNodeId; /** * The frame ID for the frame associated with this nodes document. */ frameId?: Page.FrameId; } /** * The loadComplete event mirrors the load complete event sent by the browser to assistive technology when the web page has finished loading. */ export type loadCompletePayload = { /** * New document root node. */ root: AXNode; } /** * The nodesUpdated event is sent every time a previously requested node has changed the in tree. */ export type nodesUpdatedPayload = { /** * Updated node data. */ nodes: AXNode[]; } /** * 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 node's 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. */ depth?: number; /** * The frame for whose document the AX tree should be retrieved. If omitted, the root frame is used. */ frameId?: Page.FrameId; } export type getFullAXTreeReturnValue = { nodes: AXNode[]; } /** * Fetches the root node. Requires `enable()` to have been called previously. */ export type getRootAXNodeParameters = { /** * The frame in whose document the node resides. If omitted, the root frame is used. */ frameId?: Page.FrameId; } export type getRootAXNodeReturnValue = { node: AXNode; } /** * Fetches a node and all ancestors up to and including the root. Requires `enable()` to have been called previously. */ export type getAXNodeAndAncestorsParameters = { /** * Identifier of the node to get. */ nodeId?: DOM.NodeId; /** * Identifier of the backend node to get. */ backendNodeId?: DOM.BackendNodeId; /** * JavaScript object id of the node wrapper to get. */ objectId?: Runtime.RemoteObjectId; } export type getAXNodeAndAncestorsReturnValue = { nodes: AXNode[]; } /** * Fetches a particular accessibility node by AXNodeId. Requires `enable()` to have been called previously. */ export type getChildAXNodesParameters = { id: AXNodeId; /** * The frame in whose document the node resides. If omitted, the root frame is used. */ frameId?: Page.FrameId; } 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 match 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. Milliseconds for time based animations and percentage [0 - 100] for scroll driven animations (i.e. when viewOrScrollTimeline exists). */ 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; /** * View or scroll timeline */ viewOrScrollTimeline?: ViewOrScrollTimeline; } /** * Timeline instance */ export interface ViewOrScrollTimeline { /** * Scroll container node */ sourceNodeId?: DOM.BackendNodeId; /** * Represents the starting scroll position of the timeline as a length offset in pixels from scroll origin. */ startOffset?: number; /** * Represents the ending scroll position of the timeline as a length offset in pixels from scroll origin. */ endOffset?: number; /** * The element whose principal box's visibility in the scrollport defined the progress of the timeline. Does not exist for animations with ScrollTimeline */ subjectNodeId?: DOM.BackendNodeId; /** * Orientation of the scroll */ axis: DOM.ScrollOrientation; } /** * 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. Milliseconds for time based animations and percentage [0 - 100] for scroll driven animations (i.e. when viewOrScrollTimeline exists). */ 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; } /** * Event for animation that has been updated. */ export type animationUpdatedPayload = { /** * Animation that was updated. */ 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 = { } } /** * 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 CookieExclusionReason = "ExcludeSameSiteUnspecifiedTreatedAsLax"|"ExcludeSameSiteNoneInsecure"|"ExcludeSameSiteLax"|"ExcludeSameSiteStrict"|"ExcludeInvalidSameParty"|"ExcludeSamePartyCrossPartyContext"|"ExcludeDomainNonASCII"|"ExcludeThirdPartyCookieBlockedInFirstPartySet"|"ExcludeThirdPartyPhaseout"; export type CookieWarningReason = "WarnSameSiteUnspecifiedCrossSiteContext"|"WarnSameSiteNoneInsecure"|"WarnSameSiteUnspecifiedLaxAllowUnsafe"|"WarnSameSiteStrictLaxDowngradeStrict"|"WarnSameSiteStrictCrossDowngradeStrict"|"WarnSameSiteStrictCrossDowngradeLax"|"WarnSameSiteLaxCrossDowngradeStrict"|"WarnSameSiteLaxCrossDowngradeLax"|"WarnAttributeValueExceedsMaxSize"|"WarnDomainNonASCII"|"WarnThirdPartyPhaseout"|"WarnCrossSiteRedirectDowngradeChangesInclusion"|"WarnDeprecationTrialMetadata"|"WarnThirdPartyCookieHeuristic"; export type CookieOperation = "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 CookieIssueDetails { /** * If AffectedCookie is not set then rawCookieLine contains the raw Set-Cookie header string. This hints at a problem where the cookie line is syntactically or semantically malformed in a way that no valid cookie could be created. */ cookie?: AffectedCookie; rawCookieLine?: string; cookieWarningReasons: CookieWarningReason[]; cookieExclusionReasons: CookieExclusionReason[]; /** * Optionally identifies the site-for-cookies and the cookie url, which may be used by the front-end as additional context. */ operation: CookieOperation; siteForCookies?: string; cookieUrl?: string; request?: AffectedRequest; } export type MixedContentResolutionStatus = "MixedContentBlocked"|"MixedContentAutomaticallyUpgraded"|"MixedContentWarning"; export type MixedContentResourceType = "AttributionSrc"|"Audio"|"Beacon"|"CSPReport"|"Download"|"EventSource"|"Favicon"|"Font"|"Form"|"Frame"|"Image"|"Import"|"JSON"|"Manifest"|"Ping"|"PluginData"|"PluginResource"|"Prefetch"|"Resource"|"Script"|"ServiceWorker"|"SharedWorker"|"SpeculationRules"|"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"|"CorpNotSameOriginAfterDefaultedToSameOriginByDip"|"CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip"|"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"|"kWasmEvalViolation"; 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 transferred to a context that is not cross-origin isolated. */ export interface SharedArrayBufferIssueDetails { sourceCodeLocation: SourceCodeLocation; isWarning: boolean; type: SharedArrayBufferIssueType; } 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; location?: SourceCodeLocation; initiatorOrigin?: string; resourceIPAddressSpace?: Network.IPAddressSpace; clientSecurityState?: Network.ClientSecurityState; } export type AttributionReportingIssueType = "PermissionPolicyDisabled"|"UntrustworthyReportingOrigin"|"InsecureContext"|"InvalidHeader"|"InvalidRegisterTriggerHeader"|"SourceAndTriggerHeaders"|"SourceIgnored"|"TriggerIgnored"|"OsSourceIgnored"|"OsTriggerIgnored"|"InvalidRegisterOsSourceHeader"|"InvalidRegisterOsTriggerHeader"|"WebAndOsHeaders"|"NoWebOrOsSupport"|"NavigationRegistrationWithoutTransientUserActivation"|"InvalidInfoHeader"|"NoRegisterSourceHeader"|"NoRegisterTriggerHeader"|"NoRegisterOsSourceHeader"|"NoRegisterOsTriggerHeader"|"NavigationRegistrationUniqueScopeAlreadySet"; export type SharedDictionaryError = "UseErrorCrossOriginNoCorsRequest"|"UseErrorDictionaryLoadFailure"|"UseErrorMatchingDictionaryNotUsed"|"UseErrorUnexpectedContentDictionaryHeader"|"WriteErrorCossOriginNoCorsRequest"|"WriteErrorDisallowedBySettings"|"WriteErrorExpiredResponse"|"WriteErrorFeatureDisabled"|"WriteErrorInsufficientResources"|"WriteErrorInvalidMatchField"|"WriteErrorInvalidStructuredHeader"|"WriteErrorNavigationRequest"|"WriteErrorNoMatchField"|"WriteErrorNonListMatchDestField"|"WriteErrorNonSecureContext"|"WriteErrorNonStringIdField"|"WriteErrorNonStringInMatchDestList"|"WriteErrorNonStringMatchField"|"WriteErrorNonTokenTypeField"|"WriteErrorRequestAborted"|"WriteErrorShuttingDown"|"WriteErrorTooLongIdField"|"WriteErrorUnsupportedType"; /** * Details for issues around "Attribution Reporting API" usage. Explainer: https://github.com/WICG/attribution-reporting-api */ export interface AttributionReportingIssueDetails { violationType: AttributionReportingIssueType; request?: AffectedRequest; violatingNodeId?: DOM.BackendNodeId; invalidParameter?: string; } /** * Details for issues about documents in Quirks Mode or Limited Quirks Mode that affects page layouting. */ export interface QuirksModeIssueDetails { /** * If false, it means the document's mode is "quirks" instead of "limited-quirks". */ isLimitedQuirksMode: boolean; documentNodeId: DOM.BackendNodeId; url: string; frameId: Page.FrameId; loaderId: Network.LoaderId; } export interface NavigatorUserAgentIssueDetails { url: string; location?: SourceCodeLocation; } export interface SharedDictionaryIssueDetails { sharedDictionaryError: SharedDictionaryError; request: AffectedRequest; } export type GenericIssueErrorType = "FormLabelForNameError"|"FormDuplicateIdForInputError"|"FormInputWithNoLabelError"|"FormAutocompleteAttributeEmptyError"|"FormEmptyIdAndNameAttributesForInputError"|"FormAriaLabelledByToNonExistingId"|"FormInputAssignedAutocompleteValueToIdOrNameAttributeError"|"FormLabelHasNeitherForNorNestedInput"|"FormLabelForMatchesNonExistingIdError"|"FormInputHasWrongButWellIntendedAutocompleteValueError"|"ResponseWasBlockedByORB"; /** * Depending on the concrete errorType, different properties are set. */ export interface GenericIssueDetails { /** * Issues with the same errorType are aggregated in the frontend. */ errorType: GenericIssueErrorType; frameId?: Page.FrameId; violatingNodeId?: DOM.BackendNodeId; violatingNodeAttribute?: string; request?: AffectedRequest; } /** * This issue tracks information needed to print a deprecation message. https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/third_party/blink/renderer/core/frame/deprecation/README.md */ export interface DeprecationIssueDetails { affectedFrame?: AffectedFrame; sourceCodeLocation: SourceCodeLocation; /** * One of the deprecation names from third_party/blink/renderer/core/frame/deprecation/deprecation.json5 */ type: string; } /** * This issue warns about sites in the redirect chain of a finished navigation that may be flagged as trackers and have their state cleared if they don't receive a user interaction. Note that in this context 'site' means eTLD+1. For example, if the URL `https://example.test:80/bounce` was in the redirect chain, the site reported would be `example.test`. */ export interface BounceTrackingIssueDetails { trackingSites: string[]; } /** * This issue warns about third-party sites that are accessing cookies on the current page, and have been permitted due to having a global metadata grant. Note that in this context 'site' means eTLD+1. For example, if the URL `https://example.test:80/web_page` was accessing cookies, the site reported would be `example.test`. */ export interface CookieDeprecationMetadataIssueDetails { allowedSites: string[]; optOutPercentage: number; isOptOutTopLevel: boolean; operation: CookieOperation; } export type ClientHintIssueReason = "MetaTagAllowListInvalidOrigin"|"MetaTagModifiedHTML"; export interface FederatedAuthRequestIssueDetails { federatedAuthRequestIssueReason: FederatedAuthRequestIssueReason; } /** * Represents the failure reason when a federated authentication reason fails. Should be updated alongside RequestIdTokenStatus in third_party/blink/public/mojom/devtools/inspector_issue.mojom to include all cases except for success. */ export type FederatedAuthRequestIssueReason = "ShouldEmbargo"|"TooManyRequests"|"WellKnownHttpNotFound"|"WellKnownNoResponse"|"WellKnownInvalidResponse"|"WellKnownListEmpty"|"WellKnownInvalidContentType"|"ConfigNotInWellKnown"|"WellKnownTooBig"|"ConfigHttpNotFound"|"ConfigNoResponse"|"ConfigInvalidResponse"|"ConfigInvalidContentType"|"ClientMetadataHttpNotFound"|"ClientMetadataNoResponse"|"ClientMetadataInvalidResponse"|"ClientMetadataInvalidContentType"|"IdpNotPotentiallyTrustworthy"|"DisabledInSettings"|"DisabledInFlags"|"ErrorFetchingSignin"|"InvalidSigninResponse"|"AccountsHttpNotFound"|"AccountsNoResponse"|"AccountsInvalidResponse"|"AccountsListEmpty"|"AccountsInvalidContentType"|"IdTokenHttpNotFound"|"IdTokenNoResponse"|"IdTokenInvalidResponse"|"IdTokenIdpErrorResponse"|"IdTokenCrossSiteIdpErrorResponse"|"IdTokenInvalidRequest"|"IdTokenInvalidContentType"|"ErrorIdToken"|"Canceled"|"RpPageNotVisible"|"SilentMediationFailure"|"ThirdPartyCookiesBlocked"|"NotSignedInWithIdp"|"MissingTransientUserActivation"|"ReplacedByActiveMode"|"InvalidFieldsSpecified"|"RelyingPartyOriginIsOpaque"|"TypeNotMatching"; export interface FederatedAuthUserInfoRequestIssueDetails { federatedAuthUserInfoRequestIssueReason: FederatedAuthUserInfoRequestIssueReason; } /** * Represents the failure reason when a getUserInfo() call fails. Should be updated alongside FederatedAuthUserInfoRequestResult in third_party/blink/public/mojom/devtools/inspector_issue.mojom. */ export type FederatedAuthUserInfoRequestIssueReason = "NotSameOrigin"|"NotIframe"|"NotPotentiallyTrustworthy"|"NoApiPermission"|"NotSignedInWithIdp"|"NoAccountSharingPermission"|"InvalidConfigOrWellKnown"|"InvalidAccountsResponse"|"NoReturningUserFromFetchedAccounts"; /** * This issue tracks client hints related issues. It's used to deprecate old features, encourage the use of new ones, and provide general guidance. */ export interface ClientHintIssueDetails { sourceCodeLocation: SourceCodeLocation; clientHintIssueReason: ClientHintIssueReason; } export interface FailedRequestInfo { /** * The URL that failed to load. */ url: string; /** * The failure message for the failed request. */ failureMessage: string; requestId?: Network.RequestId; } export type StyleSheetLoadingIssueReason = "LateImportRule"|"RequestFailed"; /** * This issue warns when a referenced stylesheet couldn't be loaded. */ export interface StylesheetLoadingIssueDetails { /** * Source code position that referenced the failing stylesheet. */ sourceCodeLocation: SourceCodeLocation; /** * Reason why the stylesheet couldn't be loaded. */ styleSheetLoadingIssueReason: StyleSheetLoadingIssueReason; /** * Contains additional info when the failure was due to a request. */ failedRequestInfo?: FailedRequestInfo; } export type PropertyRuleIssueReason = "InvalidSyntax"|"InvalidInitialValue"|"InvalidInherits"|"InvalidName"; /** * This issue warns about errors in property rules that lead to property registrations being ignored. */ export interface PropertyRuleIssueDetails { /** * Source code position of the property rule. */ sourceCodeLocation: SourceCodeLocation; /** * Reason why the property rule was discarded. */ propertyRuleIssueReason: PropertyRuleIssueReason; /** * The value of the property rule property that failed to parse */ propertyValue?: string; } /** * 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 = "CookieIssue"|"MixedContentIssue"|"BlockedByResponseIssue"|"HeavyAdIssue"|"ContentSecurityPolicyIssue"|"SharedArrayBufferIssue"|"LowTextContrastIssue"|"CorsIssue"|"AttributionReportingIssue"|"QuirksModeIssue"|"NavigatorUserAgentIssue"|"GenericIssue"|"DeprecationIssue"|"ClientHintIssue"|"FederatedAuthRequestIssue"|"BounceTrackingIssue"|"CookieDeprecationMetadataIssue"|"StylesheetLoadingIssue"|"FederatedAuthUserInfoRequestIssue"|"PropertyRuleIssue"|"SharedDictionaryIssue"; /** * 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 { cookieIssueDetails?: CookieIssueDetails; mixedContentIssueDetails?: MixedContentIssueDetails; blockedByResponseIssueDetails?: BlockedByResponseIssueDetails; heavyAdIssueDetails?: HeavyAdIssueDetails; contentSecurityPolicyIssueDetails?: ContentSecurityPolicyIssueDetails; sharedArrayBufferIssueDetails?: SharedArrayBufferIssueDetails; lowTextContrastIssueDetails?: LowTextContrastIssueDetails; corsIssueDetails?: CorsIssueDetails; attributionReportingIssueDetails?: AttributionReportingIssueDetails; quirksModeIssueDetails?: QuirksModeIssueDetails; navigatorUserAgentIssueDetails?: NavigatorUserAgentIssueDetails; genericIssueDetails?: GenericIssueDetails; deprecationIssueDetails?: DeprecationIssueDetails; clientHintIssueDetails?: ClientHintIssueDetails; federatedAuthRequestIssueDetails?: FederatedAuthRequestIssueDetails; bounceTrackingIssueDetails?: BounceTrackingIssueDetails; cookieDeprecationMetadataIssueDetails?: CookieDeprecationMetadataIssueDetails; stylesheetLoadingIssueDetails?: StylesheetLoadingIssueDetails; propertyRuleIssueDetails?: PropertyRuleIssueDetails; federatedAuthUserInfoRequestIssueDetails?: FederatedAuthUserInfoRequestIssueDetails; sharedDictionaryIssueDetails?: SharedDictionaryIssueDetails; } /** * A unique id for a DevTools inspector issue. Allows other entities (e.g. exceptions, CDP message, console messages, etc.) to reference an issue. */ export type IssueId = string; /** * An inspector issue reported from the back-end. */ export interface InspectorIssue { code: InspectorIssueCode; details: InspectorIssueDetails; /** * A unique id for this issue. May be omitted if no other entity (e.g. exception, CDP message, etc.) is referencing this issue. */ issueId?: IssueId; } 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 = { /** * Whether to report WCAG AAA level issues. Default is false. */ reportAAA?: boolean; } export type checkContrastReturnValue = { } /** * Runs the form issues check for the target page. Found issues are reported using Audits.issueAdded event. */ export type checkFormsIssuesParameters = { } export type checkFormsIssuesReturnValue = { formIssues: GenericIssueDetails[]; } } /** * Defines commands and events for browser extensions. */ export module Extensions { /** * Storage areas. */ export type StorageArea = "session"|"local"|"sync"|"managed"; /** * Installs an unpacked extension from the filesystem similar to --load-extension CLI flags. Returns extension ID once the extension has been installed. Available if the client is connected using the --remote-debugging-pipe flag and the --enable-unsafe-extension-debugging flag is set. */ export type loadUnpackedParameters = { /** * Absolute file path. */ path: string; } export type loadUnpackedReturnValue = { /** * Extension id. */ id: string; } /** * Gets data from extension storage in the given `storageArea`. If `keys` is specified, these are used to filter the result. */ export type getStorageItemsParameters = { /** * ID of extension. */ id: string; /** * StorageArea to retrieve data from. */ storageArea: StorageArea; /** * Keys to retrieve. */ keys?: string[]; } export type getStorageItemsReturnValue = { data: { [key: string]: string }; } /** * Removes `keys` from extension storage in the given `storageArea`. */ export type removeStorageItemsParameters = { /** * ID of extension. */ id: string; /** * StorageArea to remove data from. */ storageArea: StorageArea; /** * Keys to remove. */ keys: string[]; } export type removeStorageItemsReturnValue = { } /** * Clears extension storage in the given `storageArea`. */ export type clearStorageItemsParameters = { /** * ID of extension. */ id: string; /** * StorageArea to remove data from. */ storageArea: StorageArea; } export type clearStorageItemsReturnValue = { } /** * Sets `values` in extension storage in the given `storageArea`. The provided `values` will be merged with existing values in the storage area. */ export type setStorageItemsParameters = { /** * ID of extension. */ id: string; /** * StorageArea to set data in. */ storageArea: StorageArea; /** * Values to set. */ values: { [key: string]: string }; } export type setStorageItemsReturnValue = { } } /** * Defines commands and events for Autofill. */ export module Autofill { export interface CreditCard { /** * 16-digit credit card number. */ number: string; /** * Name of the credit card owner. */ name: string; /** * 2-digit expiry month. */ expiryMonth: string; /** * 4-digit expiry year. */ expiryYear: string; /** * 3-digit card verification code. */ cvc: string; } export interface AddressField { /** * address field name, for example GIVEN_NAME. */ name: string; /** * address field value, for example Jon Doe. */ value: string; } /** * A list of address fields. */ export interface AddressFields { fields: AddressField[]; } export interface Address { /** * fields and values defining an address. */ fields: AddressField[]; } /** * Defines how an address can be displayed like in chrome://settings/addresses. Address UI is a two dimensional array, each inner array is an "address information line", and when rendered in a UI surface should be displayed as such. The following address UI for instance: [[{name: "GIVE_NAME", value: "Jon"}, {name: "FAMILY_NAME", value: "Doe"}], [{name: "CITY", value: "Munich"}, {name: "ZIP", value: "81456"}]] should allow the receiver to render: Jon Doe Munich 81456 */ export interface AddressUI { /** * A two dimension array containing the representation of values from an address profile. */ addressFields: AddressFields[]; } /** * Specified whether a filled field was done so by using the html autocomplete attribute or autofill heuristics. */ export type FillingStrategy = "autocompleteAttribute"|"autofillInferred"; export interface FilledField { /** * The type of the field, e.g text, password etc. */ htmlType: string; /** * the html id */ id: string; /** * the html name */ name: string; /** * the field value */ value: string; /** * The actual field type, e.g FAMILY_NAME */ autofillType: string; /** * The filling strategy */ fillingStrategy: FillingStrategy; /** * The frame the field belongs to */ frameId: Page.FrameId; /** * The form field's DOM node */ fieldId: DOM.BackendNodeId; } /** * Emitted when an address form is filled. */ export type addressFormFilledPayload = { /** * Information about the fields that were filled */ filledFields: FilledField[]; /** * An UI representation of the address used to fill the form. Consists of a 2D array where each child represents an address/profile line. */ addressUi: AddressUI; } /** * Trigger autofill on a form identified by the fieldId. If the field and related form cannot be autofilled, returns an error. */ export type triggerParameters = { /** * Identifies a field that serves as an anchor for autofill. */ fieldId: DOM.BackendNodeId; /** * Identifies the frame that field belongs to. */ frameId?: Page.FrameId; /** * Credit card information to fill out the form. Credit card data is not saved. */ card: CreditCard; } export type triggerReturnValue = { } /** * Set addresses so that developers can verify their forms implementation. */ export type setAddressesParameters = { addresses: Address[]; } export type setAddressesReturnValue = { } /** * Disables autofill domain notifications. */ export type disableParameters = { } export type disableReturnValue = { } /** * Enables autofill domain notifications. */ export type enableParameters = { } export type enableReturnValue = { } } /** * 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[]; /** * Storage key this event belongs to. */ storageKey: string; } /** * 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"|"capturedSurfaceControl"|"clipboardReadWrite"|"clipboardSanitizedWrite"|"displayCapture"|"durableStorage"|"flash"|"geolocation"|"idleDete