Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/astral/bindings/celestial.ts>Celestial

A high-level puppeteer/playwright-like library for Deno
Go to Latest
class Celestial
extends EventTarget
import { Celestial } from "https://deno.land/x/astral@0.3.1/bindings/celestial.ts";

Constructors

new
Celestial(ws: WebSocket)

Celestial expects a open websocket to communicate over

Properties

Accessibility: { disable: () => Promise<void>; enable: () => Promise<void>; getPartialAXTree: (opts: { nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectId?: Runtime_RemoteObjectId; fetchRelatives?: boolean; }) => Promise<{ nodes: Accessibility_AXNode[]; }>; getFullAXTree: (opts: { depth?: number; frameId?: Page_FrameId; }) => Promise<{ nodes: Accessibility_AXNode[]; }>; getRootAXNode: (opts: { frameId?: Page_FrameId; }) => Promise<{ node: Accessibility_AXNode; }>; getAXNodeAndAncestors: (opts: { nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectId?: Runtime_RemoteObjectId; }) => Promise<{ nodes: Accessibility_AXNode[]; }>; getChildAXNodes: (opts: { id: Accessibility_AXNodeId; frameId?: Page_FrameId; }) => Promise<{ nodes: Accessibility_AXNode[]; }>; queryAXTree: (opts: { nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectId?: Runtime_RemoteObjectId; accessibleName?: string; role?: string; }) => Promise<{ nodes: Accessibility_AXNode[]; }>; }
Animation: { disable: () => Promise<void>; enable: () => Promise<void>; getCurrentTime: (opts: { id: string; }) => Promise<{ currentTime: number; }>; getPlaybackRate: () => Promise<{ playbackRate: number; }>; releaseAnimations: (opts: { animations: string[]; }) => Promise<void>; resolveAnimation: (opts: { animationId: string; }) => Promise<{ remoteObject: Runtime_RemoteObject; }>; seekAnimations: (opts: { animations: string[]; currentTime: number; }) => Promise<void>; setPaused: (opts: { animations: string[]; paused: boolean; }) => Promise<void>; setPlaybackRate: (opts: { playbackRate: number; }) => Promise<void>; setTiming: (opts: { animationId: string; duration: number; delay: number; }) => Promise<void>; }
Audits: { getEncodedResponse: (opts: { requestId: Network_RequestId; encoding: "webp" | "jpeg" | "png"; quality?: number; sizeOnly?: boolean; }) => Promise<{ body?: string; originalSize: number; encodedSize: number; }>; disable: () => Promise<void>; enable: () => Promise<void>; checkContrast: (opts: { reportAAA?: boolean; }) => Promise<void>; checkFormsIssues: () => Promise<{ formIssues: Audits_GenericIssueDetails[]; }>; }
Autofill: { trigger: (opts: { fieldId: DOM_BackendNodeId; frameId?: Page_FrameId; card: Autofill_CreditCard; }) => Promise<void>; setAddresses: (opts: { addresses: Autofill_Address[]; }) => Promise<void>; }
BackgroundService: { startObserving: (opts: { service: BackgroundService_ServiceName; }) => Promise<void>; stopObserving: (opts: { service: BackgroundService_ServiceName; }) => Promise<void>; setRecording: (opts: { shouldRecord: boolean; service: BackgroundService_ServiceName; }) => Promise<void>; clearEvents: (opts: { service: BackgroundService_ServiceName; }) => Promise<void>; }
Browser: { setPermission: (opts: { permission: Browser_PermissionDescriptor; setting: Browser_PermissionSetting; origin?: string; browserContextId?: Browser_BrowserContextID; }) => Promise<void>; grantPermissions: (opts: { permissions: Browser_PermissionType[]; origin?: string; browserContextId?: Browser_BrowserContextID; }) => Promise<void>; resetPermissions: (opts: { browserContextId?: Browser_BrowserContextID; }) => Promise<void>; setDownloadBehavior: (opts: { behavior:
| "deny"
| "allow"
| "allowAndName"
| "default"
; browserContextId?: Browser_BrowserContextID; downloadPath?: string; eventsEnabled?: boolean; }
) => Promise<void>; cancelDownload: (opts: { guid: string; browserContextId?: Browser_BrowserContextID; }) => Promise<void>; close: () => Promise<void>; crash: () => Promise<void>; crashGpuProcess: () => Promise<void>; getVersion: () => Promise<{ protocolVersion: string; product: string; revision: string; userAgent: string; jsVersion: string; }>; getBrowserCommandLine: () => Promise<{ arguments: string[]; }>; getHistograms: (opts: { query?: string; delta?: boolean; }) => Promise<{ histograms: Browser_Histogram[]; }>; getHistogram: (opts: { name: string; delta?: boolean; }) => Promise<{ histogram: Browser_Histogram; }>; getWindowBounds: (opts: { windowId: Browser_WindowID; }) => Promise<{ bounds: Browser_Bounds; }>; getWindowForTarget: (opts: { targetId?: Target_TargetID; }) => Promise<{ windowId: Browser_WindowID; bounds: Browser_Bounds; }>; setWindowBounds: (opts: { windowId: Browser_WindowID; bounds: Browser_Bounds; }) => Promise<void>; setDockTile: (opts: { badgeLabel?: string; image?: string; }) => Promise<void>; executeBrowserCommand: (opts: { commandId: Browser_BrowserCommandId; }) => Promise<void>; addPrivacySandboxEnrollmentOverride: (opts: { url: string; }) => Promise<void>; }

The Browser domain defines methods and events for browser managing.

CacheStorage: { deleteCache: (opts: { cacheId: CacheStorage_CacheId; }) => Promise<void>; deleteEntry: (opts: { cacheId: CacheStorage_CacheId; request: string; }) => Promise<void>; requestCacheNames: (opts: { securityOrigin?: string; storageKey?: string; storageBucket?: Storage_StorageBucket; }) => Promise<{ caches: CacheStorage_Cache[]; }>; requestCachedResponse: (opts: { cacheId: CacheStorage_CacheId; requestURL: string; requestHeaders: CacheStorage_Header[]; }) => Promise<{ response: CacheStorage_CachedResponse; }>; requestEntries: (opts: { cacheId: CacheStorage_CacheId; skipCount?: number; pageSize?: number; pathFilter?: string; }) => Promise<{ cacheDataEntries: CacheStorage_DataEntry[]; returnCount: number; }>; }
Cast: { enable: (opts: { presentationUrl?: string; }) => Promise<void>; disable: () => Promise<void>; setSinkToUse: (opts: { sinkName: string; }) => Promise<void>; startDesktopMirroring: (opts: { sinkName: string; }) => Promise<void>; startTabMirroring: (opts: { sinkName: string; }) => Promise<void>; stopCasting: (opts: { sinkName: string; }) => Promise<void>; }
deprecated
Console: { clearMessages: () => Promise<void>; disable: () => Promise<void>; enable: () => Promise<void>; }
CSS: { addRule: (opts: { styleSheetId: CSS_StyleSheetId; ruleText: string; location: CSS_SourceRange; }) => Promise<{ rule: CSS_CSSRule; }>; collectClassNames: (opts: { styleSheetId: CSS_StyleSheetId; }) => Promise<{ classNames: string[]; }>; createStyleSheet: (opts: { frameId: Page_FrameId; }) => Promise<{ styleSheetId: CSS_StyleSheetId; }>; disable: () => Promise<void>; enable: () => Promise<void>; forcePseudoState: (opts: { nodeId: DOM_NodeId; forcedPseudoClasses: string[]; }) => Promise<void>; getBackgroundColors: (opts: { nodeId: DOM_NodeId; }) => Promise<{ backgroundColors?: string[]; computedFontSize?: string; computedFontWeight?: string; }>; getComputedStyleForNode: (opts: { nodeId: DOM_NodeId; }) => Promise<{ computedStyle: CSS_CSSComputedStyleProperty[]; }>; getInlineStylesForNode: (opts: { nodeId: DOM_NodeId; }) => Promise<{ inlineStyle?: CSS_CSSStyle; attributesStyle?: CSS_CSSStyle; }>; getMatchedStylesForNode: (opts: { nodeId: DOM_NodeId; }) => Promise<{ inlineStyle?: CSS_CSSStyle; attributesStyle?: CSS_CSSStyle; matchedCSSRules?: CSS_RuleMatch[]; pseudoElements?: CSS_PseudoElementMatches[]; inherited?: CSS_InheritedStyleEntry[]; inheritedPseudoElements?: CSS_InheritedPseudoElementMatches[]; cssKeyframesRules?: CSS_CSSKeyframesRule[]; cssPositionFallbackRules?: CSS_CSSPositionFallbackRule[]; cssPropertyRules?: CSS_CSSPropertyRule[]; cssPropertyRegistrations?: CSS_CSSPropertyRegistration[]; parentLayoutNodeId?: DOM_NodeId; }>; getMediaQueries: () => Promise<{ medias: CSS_CSSMedia[]; }>; getPlatformFontsForNode: (opts: { nodeId: DOM_NodeId; }) => Promise<{ fonts: CSS_PlatformFontUsage[]; }>; getStyleSheetText: (opts: { styleSheetId: CSS_StyleSheetId; }) => Promise<{ text: string; }>; getLayersForNode: (opts: { nodeId: DOM_NodeId; }) => Promise<{ rootLayer: CSS_CSSLayerData; }>; trackComputedStyleUpdates: (opts: { propertiesToTrack: CSS_CSSComputedStyleProperty[]; }) => Promise<void>; takeComputedStyleUpdates: () => Promise<{ nodeIds: DOM_NodeId[]; }>; setEffectivePropertyValueForNode: (opts: { nodeId: DOM_NodeId; propertyName: string; value: string; }) => Promise<void>; setKeyframeKey: (opts: { styleSheetId: CSS_StyleSheetId; range: CSS_SourceRange; keyText: string; }) => Promise<{ keyText: CSS_Value; }>; setMediaText: (opts: { styleSheetId: CSS_StyleSheetId; range: CSS_SourceRange; text: string; }) => Promise<{ media: CSS_CSSMedia; }>; setContainerQueryText: (opts: { styleSheetId: CSS_StyleSheetId; range: CSS_SourceRange; text: string; }) => Promise<{ containerQuery: CSS_CSSContainerQuery; }>; setSupportsText: (opts: { styleSheetId: CSS_StyleSheetId; range: CSS_SourceRange; text: string; }) => Promise<{ supports: CSS_CSSSupports; }>; setScopeText: (opts: { styleSheetId: CSS_StyleSheetId; range: CSS_SourceRange; text: string; }) => Promise<{ scope: CSS_CSSScope; }>; setRuleSelector: (opts: { styleSheetId: CSS_StyleSheetId; range: CSS_SourceRange; selector: string; }) => Promise<{ selectorList: CSS_SelectorList; }>; setStyleSheetText: (opts: { styleSheetId: CSS_StyleSheetId; text: string; }) => Promise<{ sourceMapURL?: string; }>; setStyleTexts: (opts: { edits: CSS_StyleDeclarationEdit[]; }) => Promise<{ styles: CSS_CSSStyle[]; }>; startRuleUsageTracking: () => Promise<void>; stopRuleUsageTracking: () => Promise<{ ruleUsage: CSS_RuleUsage[]; }>; takeCoverageDelta: () => Promise<{ coverage: CSS_RuleUsage[]; timestamp: number; }>; setLocalFontsEnabled: (opts: { enabled: boolean; }) => Promise<void>; }
Database: { disable: () => Promise<void>; enable: () => Promise<void>; executeSQL: (opts: { databaseId: Database_DatabaseId; query: string; }) => Promise<{ columnNames?: string[]; values?: any[]; sqlError?: Database_Error; }>; getDatabaseTableNames: (opts: { databaseId: Database_DatabaseId; }) => Promise<{ tableNames: string[]; }>; }
Debugger: { continueToLocation: (opts: { location: Debugger_Location; targetCallFrames?: "any" | "current"; }) => Promise<void>; disable: () => Promise<void>; enable: (opts: { maxScriptsCacheSize?: number; }) => Promise<{ debuggerId: Runtime_UniqueDebuggerId; }>; evaluateOnCallFrame: (opts: { callFrameId: Debugger_CallFrameId; expression: string; objectGroup?: string; includeCommandLineAPI?: boolean; silent?: boolean; returnByValue?: boolean; generatePreview?: boolean; throwOnSideEffect?: boolean; timeout?: Runtime_TimeDelta; }) => Promise<{ result: Runtime_RemoteObject; exceptionDetails?: Runtime_ExceptionDetails; }>; getPossibleBreakpoints: (opts: { start: Debugger_Location; end?: Debugger_Location; restrictToFunction?: boolean; }) => Promise<{ locations: Debugger_BreakLocation[]; }>; getScriptSource: (opts: { scriptId: Runtime_ScriptId; }) => Promise<{ scriptSource: string; bytecode?: string; }>; disassembleWasmModule: (opts: { scriptId: Runtime_ScriptId; }) => Promise<{ streamId?: string; totalNumberOfLines: number; functionBodyOffsets: number[]; chunk: Debugger_WasmDisassemblyChunk; }>; nextWasmDisassemblyChunk: (opts: { streamId: string; }) => Promise<{ chunk: Debugger_WasmDisassemblyChunk; }>; getWasmBytecode: (opts: { scriptId: Runtime_ScriptId; }) => Promise<{ bytecode: string; }>; getStackTrace: (opts: { stackTraceId: Runtime_StackTraceId; }) => Promise<{ stackTrace: Runtime_StackTrace; }>; pause: () => Promise<void>; pauseOnAsyncCall: (opts: { parentStackTraceId: Runtime_StackTraceId; }) => Promise<void>; removeBreakpoint: (opts: { breakpointId: Debugger_BreakpointId; }) => Promise<void>; restartFrame: (opts: { callFrameId: Debugger_CallFrameId; mode?: "StepInto"; }) => Promise<{ callFrames: Debugger_CallFrame[]; asyncStackTrace?: Runtime_StackTrace; asyncStackTraceId?: Runtime_StackTraceId; }>; resume: (opts: { terminateOnResume?: boolean; }) => Promise<void>; searchInContent: (opts: { scriptId: Runtime_ScriptId; query: string; caseSensitive?: boolean; isRegex?: boolean; }) => Promise<{ result: Debugger_SearchMatch[]; }>; setAsyncCallStackDepth: (opts: { maxDepth: number; }) => Promise<void>; setBlackboxPatterns: (opts: { patterns: string[]; }) => Promise<void>; setBlackboxedRanges: (opts: { scriptId: Runtime_ScriptId; positions: Debugger_ScriptPosition[]; }) => Promise<void>; setBreakpoint: (opts: { location: Debugger_Location; condition?: string; }) => Promise<{ breakpointId: Debugger_BreakpointId; actualLocation: Debugger_Location; }>; setInstrumentationBreakpoint: (opts: { instrumentation: "beforeScriptExecution" | "beforeScriptWithSourceMapExecution"; }) => Promise<{ breakpointId: Debugger_BreakpointId; }>; setBreakpointByUrl: (opts: { lineNumber: number; url?: string; urlRegex?: string; scriptHash?: string; columnNumber?: number; condition?: string; }) => Promise<{ breakpointId: Debugger_BreakpointId; locations: Debugger_Location[]; }>; setBreakpointOnFunctionCall: (opts: { objectId: Runtime_RemoteObjectId; condition?: string; }) => Promise<{ breakpointId: Debugger_BreakpointId; }>; setBreakpointsActive: (opts: { active: boolean; }) => Promise<void>; setPauseOnExceptions: (opts: { state:
| "none"
| "caught"
| "uncaught"
| "all"
; }
) => Promise<void>; setReturnValue: (opts: { newValue: Runtime_CallArgument; }) => Promise<void>; setScriptSource: (opts: { scriptId: Runtime_ScriptId; scriptSource: string; dryRun?: boolean; allowTopFrameEditing?: boolean; }) => Promise<{ callFrames?: Debugger_CallFrame[]; stackChanged?: boolean; asyncStackTrace?: Runtime_StackTrace; asyncStackTraceId?: Runtime_StackTraceId; status:
| "Ok"
| "CompileError"
| "BlockedByActiveGenerator"
| "BlockedByActiveFunction"
| "BlockedByTopLevelEsModuleChange"
; exceptionDetails?: Runtime_ExceptionDetails; }>; setSkipAllPauses: (opts: { skip: boolean; }) => Promise<void>; setVariableValue: (opts: { scopeNumber: number; variableName: string; newValue: Runtime_CallArgument; callFrameId: Debugger_CallFrameId; }) => Promise<void>; stepInto: (opts: { breakOnAsyncCall?: boolean; skipList?: Debugger_LocationRange[]; }) => Promise<void>; stepOut: () => Promise<void>; stepOver: (opts: { skipList?: Debugger_LocationRange[]; }) => Promise<void>; }

Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.

DeviceAccess: { enable: () => Promise<void>; disable: () => Promise<void>; selectPrompt: (opts: { id: DeviceAccess_RequestId; deviceId: DeviceAccess_DeviceId; }) => Promise<void>; cancelPrompt: (opts: { id: DeviceAccess_RequestId; }) => Promise<void>; }
DeviceOrientation: { clearDeviceOrientationOverride: () => Promise<void>; setDeviceOrientationOverride: (opts: { alpha: number; beta: number; gamma: number; }) => Promise<void>; }
DOM: { collectClassNamesFromSubtree: (opts: { nodeId: DOM_NodeId; }) => Promise<{ classNames: string[]; }>; copyTo: (opts: { nodeId: DOM_NodeId; targetNodeId: DOM_NodeId; insertBeforeNodeId?: DOM_NodeId; }) => Promise<{ nodeId: DOM_NodeId; }>; describeNode: (opts: { nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectId?: Runtime_RemoteObjectId; depth?: number; pierce?: boolean; }) => Promise<{ node: DOM_Node; }>; scrollIntoViewIfNeeded: (opts: { nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectId?: Runtime_RemoteObjectId; rect?: DOM_Rect; }) => Promise<void>; disable: () => Promise<void>; discardSearchResults: (opts: { searchId: string; }) => Promise<void>; enable: (opts: { includeWhitespace?: "none" | "all"; }) => Promise<void>; focus: (opts: { nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectId?: Runtime_RemoteObjectId; }) => Promise<void>; getAttributes: (opts: { nodeId: DOM_NodeId; }) => Promise<{ attributes: string[]; }>; getBoxModel: (opts: { nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectId?: Runtime_RemoteObjectId; }) => Promise<{ model: DOM_BoxModel; }>; getContentQuads: (opts: { nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectId?: Runtime_RemoteObjectId; }) => Promise<{ quads: DOM_Quad[]; }>; getDocument: (opts: { depth?: number; pierce?: boolean; }) => Promise<{ root: DOM_Node; }>; getFlattenedDocument: (opts: { depth?: number; pierce?: boolean; }) => Promise<{ nodes: DOM_Node[]; }>; getNodesForSubtreeByStyle: (opts: { nodeId: DOM_NodeId; computedStyles: DOM_CSSComputedStyleProperty[]; pierce?: boolean; }) => Promise<{ nodeIds: DOM_NodeId[]; }>; getNodeForLocation: (opts: { x: number; y: number; includeUserAgentShadowDOM?: boolean; ignorePointerEventsNone?: boolean; }) => Promise<{ backendNodeId: DOM_BackendNodeId; frameId: Page_FrameId; nodeId?: DOM_NodeId; }>; getOuterHTML: (opts: { nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectId?: Runtime_RemoteObjectId; }) => Promise<{ outerHTML: string; }>; getRelayoutBoundary: (opts: { nodeId: DOM_NodeId; }) => Promise<{ nodeId: DOM_NodeId; }>; getSearchResults: (opts: { searchId: string; fromIndex: number; toIndex: number; }) => Promise<{ nodeIds: DOM_NodeId[]; }>; hideHighlight: () => Promise<void>; highlightNode: () => Promise<void>; highlightRect: () => Promise<void>; markUndoableState: () => Promise<void>; moveTo: (opts: { nodeId: DOM_NodeId; targetNodeId: DOM_NodeId; insertBeforeNodeId?: DOM_NodeId; }) => Promise<{ nodeId: DOM_NodeId; }>; performSearch: (opts: { query: string; includeUserAgentShadowDOM?: boolean; }) => Promise<{ searchId: string; resultCount: number; }>; pushNodeByPathToFrontend: (opts: { path: string; }) => Promise<{ nodeId: DOM_NodeId; }>; pushNodesByBackendIdsToFrontend: (opts: { backendNodeIds: DOM_BackendNodeId[]; }) => Promise<{ nodeIds: DOM_NodeId[]; }>; querySelector: (opts: { nodeId: DOM_NodeId; selector: string; }) => Promise<{ nodeId: DOM_NodeId; }>; querySelectorAll: (opts: { nodeId: DOM_NodeId; selector: string; }) => Promise<{ nodeIds: DOM_NodeId[]; }>; getTopLayerElements: () => Promise<{ nodeIds: DOM_NodeId[]; }>; redo: () => Promise<void>; removeAttribute: (opts: { nodeId: DOM_NodeId; name: string; }) => Promise<void>; removeNode: (opts: { nodeId: DOM_NodeId; }) => Promise<void>; requestChildNodes: (opts: { nodeId: DOM_NodeId; depth?: number; pierce?: boolean; }) => Promise<void>; requestNode: (opts: { objectId: Runtime_RemoteObjectId; }) => Promise<{ nodeId: DOM_NodeId; }>; resolveNode: (opts: { nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectGroup?: string; executionContextId?: Runtime_ExecutionContextId; }) => Promise<{ object: Runtime_RemoteObject; }>; setAttributeValue: (opts: { nodeId: DOM_NodeId; name: string; value: string; }) => Promise<void>; setAttributesAsText: (opts: { nodeId: DOM_NodeId; text: string; name?: string; }) => Promise<void>; setFileInputFiles: (opts: { files: string[]; nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectId?: Runtime_RemoteObjectId; }) => Promise<void>; setNodeStackTracesEnabled: (opts: { enable: boolean; }) => Promise<void>; getNodeStackTraces: (opts: { nodeId: DOM_NodeId; }) => Promise<{ creation?: Runtime_StackTrace; }>; getFileInfo: (opts: { objectId: Runtime_RemoteObjectId; }) => Promise<{ path: string; }>; setInspectedNode: (opts: { nodeId: DOM_NodeId; }) => Promise<void>; setNodeName: (opts: { nodeId: DOM_NodeId; name: string; }) => Promise<{ nodeId: DOM_NodeId; }>; setNodeValue: (opts: { nodeId: DOM_NodeId; value: string; }) => Promise<void>; setOuterHTML: (opts: { nodeId: DOM_NodeId; outerHTML: string; }) => Promise<void>; undo: () => Promise<void>; getFrameOwner: (opts: { frameId: Page_FrameId; }) => Promise<{ backendNodeId: DOM_BackendNodeId; nodeId?: DOM_NodeId; }>; getContainerForNode: (opts: { nodeId: DOM_NodeId; containerName?: string; physicalAxes?: DOM_PhysicalAxes; logicalAxes?: DOM_LogicalAxes; }) => Promise<{ nodeId?: DOM_NodeId; }>; getQueryingDescendantsForContainer: (opts: { nodeId: DOM_NodeId; }) => Promise<{ nodeIds: DOM_NodeId[]; }>; }

This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an id. This id can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client's responsibility to collect information about the nodes that were sent to the client. Note that iframe owner elements will return corresponding document elements as their child nodes.

DOMDebugger: { getEventListeners: (opts: { objectId: Runtime_RemoteObjectId; depth?: number; pierce?: boolean; }) => Promise<{ listeners: DOMDebugger_EventListener[]; }>; removeDOMBreakpoint: (opts: { nodeId: DOM_NodeId; type: DOMDebugger_DOMBreakpointType; }) => Promise<void>; removeEventListenerBreakpoint: (opts: { eventName: string; targetName?: string; }) => Promise<void>; removeInstrumentationBreakpoint: (opts: { eventName: string; }) => Promise<void>; removeXHRBreakpoint: (opts: { url: string; }) => Promise<void>; setBreakOnCSPViolation: (opts: { violationTypes: DOMDebugger_CSPViolationType[]; }) => Promise<void>; setDOMBreakpoint: (opts: { nodeId: DOM_NodeId; type: DOMDebugger_DOMBreakpointType; }) => Promise<void>; setEventListenerBreakpoint: (opts: { eventName: string; targetName?: string; }) => Promise<void>; setInstrumentationBreakpoint: (opts: { eventName: string; }) => Promise<void>; setXHRBreakpoint: (opts: { url: string; }) => Promise<void>; }

DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript execution will stop on these operations as if there was a regular breakpoint set.

DOMSnapshot: { disable: () => Promise<void>; enable: () => Promise<void>; getSnapshot: (opts: { computedStyleWhitelist: string[]; includeEventListeners?: boolean; includePaintOrder?: boolean; includeUserAgentShadowTree?: boolean; }) => Promise<{ domNodes: DOMSnapshot_DOMNode[]; layoutTreeNodes: DOMSnapshot_LayoutTreeNode[]; computedStyles: DOMSnapshot_ComputedStyle[]; }>; captureSnapshot: (opts: { computedStyles: string[]; includePaintOrder?: boolean; includeDOMRects?: boolean; includeBlendedBackgroundColors?: boolean; includeTextColorOpacities?: boolean; }) => Promise<{ documents: DOMSnapshot_DocumentSnapshot[]; strings: string[]; }>; }
DOMStorage: { clear: (opts: { storageId: DOMStorage_StorageId; }) => Promise<void>; disable: () => Promise<void>; enable: () => Promise<void>; getDOMStorageItems: (opts: { storageId: DOMStorage_StorageId; }) => Promise<{ entries: DOMStorage_Item[]; }>; removeDOMStorageItem: (opts: { storageId: DOMStorage_StorageId; key: string; }) => Promise<void>; setDOMStorageItem: (opts: { storageId: DOMStorage_StorageId; key: string; value: string; }) => Promise<void>; }
Emulation: { canEmulate: () => Promise<{ result: boolean; }>; clearDeviceMetricsOverride: () => Promise<void>; clearGeolocationOverride: () => Promise<void>; resetPageScaleFactor: () => Promise<void>; setFocusEmulationEnabled: (opts: { enabled: boolean; }) => Promise<void>; setAutoDarkModeOverride: (opts: { enabled?: boolean; }) => Promise<void>; setCPUThrottlingRate: (opts: { rate: number; }) => Promise<void>; setDefaultBackgroundColorOverride: (opts: { color?: DOM_RGBA; }) => Promise<void>; setDeviceMetricsOverride: (opts: { width: number; height: number; deviceScaleFactor: number; mobile: boolean; scale?: number; screenWidth?: number; screenHeight?: number; positionX?: number; positionY?: number; dontSetVisibleSize?: boolean; screenOrientation?: Emulation_ScreenOrientation; viewport?: Page_Viewport; displayFeature?: Emulation_DisplayFeature; }) => Promise<void>; setScrollbarsHidden: (opts: { hidden: boolean; }) => Promise<void>; setDocumentCookieDisabled: (opts: { disabled: boolean; }) => Promise<void>; setEmitTouchEventsForMouse: (opts: { enabled: boolean; configuration?: "mobile" | "desktop"; }) => Promise<void>; setEmulatedMedia: (opts: { media?: string; features?: Emulation_MediaFeature[]; }) => Promise<void>; setEmulatedVisionDeficiency: (opts: { type:
| "none"
| "blurredVision"
| "reducedContrast"
| "achromatopsia"
| "deuteranopia"
| "protanopia"
| "tritanopia"
; }
) => Promise<void>; setGeolocationOverride: (opts: { latitude?: number; longitude?: number; accuracy?: number; }) => Promise<void>; setIdleOverride: (opts: { isUserActive: boolean; isScreenUnlocked: boolean; }) => Promise<void>; clearIdleOverride: () => Promise<void>; setNavigatorOverrides: (opts: { platform: string; }) => Promise<void>; setPageScaleFactor: (opts: { pageScaleFactor: number; }) => Promise<void>; setScriptExecutionDisabled: (opts: { value: boolean; }) => Promise<void>; setTouchEmulationEnabled: (opts: { enabled: boolean; maxTouchPoints?: number; }) => Promise<void>; setVirtualTimePolicy: (opts: { policy: Emulation_VirtualTimePolicy; budget?: number; maxVirtualTimeTaskStarvationCount?: number; initialVirtualTime?: Network_TimeSinceEpoch; }) => Promise<{ virtualTimeTicksBase: number; }>; setLocaleOverride: (opts: { locale?: string; }) => Promise<void>; setTimezoneOverride: (opts: { timezoneId: string; }) => Promise<void>; setVisibleSize: (opts: { width: number; height: number; }) => Promise<void>; setDisabledImageTypes: (opts: { imageTypes: Emulation_DisabledImageType[]; }) => Promise<void>; setHardwareConcurrencyOverride: (opts: { hardwareConcurrency: number; }) => Promise<void>; setUserAgentOverride: (opts: { userAgent: string; acceptLanguage?: string; platform?: string; userAgentMetadata?: Emulation_UserAgentMetadata; }) => Promise<void>; setAutomationOverride: (opts: { enabled: boolean; }) => Promise<void>; }

This domain emulates different environments for the page.

EventBreakpoints: { setInstrumentationBreakpoint: (opts: { eventName: string; }) => Promise<void>; removeInstrumentationBreakpoint: (opts: { eventName: string; }) => Promise<void>; }
FedCm: { enable: (opts: { disableRejectionDelay?: boolean; }) => Promise<void>; disable: () => Promise<void>; selectAccount: (opts: { dialogId: string; accountIndex: number; }) => Promise<void>; dismissDialog: (opts: { dialogId: string; triggerCooldown?: boolean; }) => Promise<void>; resetCooldown: () => Promise<void>; }
Fetch: { disable: () => Promise<void>; enable: (opts: { patterns?: Fetch_RequestPattern[]; handleAuthRequests?: boolean; }) => Promise<void>; failRequest: (opts: { requestId: Fetch_RequestId; errorReason: Network_ErrorReason; }) => Promise<void>; fulfillRequest: (opts: { requestId: Fetch_RequestId; responseCode: number; responseHeaders?: Fetch_HeaderEntry[]; binaryResponseHeaders?: string; body?: string; responsePhrase?: string; }) => Promise<void>; continueRequest: (opts: { requestId: Fetch_RequestId; url?: string; method?: string; postData?: string; headers?: Fetch_HeaderEntry[]; interceptResponse?: boolean; }) => Promise<void>; continueWithAuth: (opts: { requestId: Fetch_RequestId; authChallengeResponse: Fetch_AuthChallengeResponse; }) => Promise<void>; continueResponse: (opts: { requestId: Fetch_RequestId; responseCode?: number; responsePhrase?: string; responseHeaders?: Fetch_HeaderEntry[]; binaryResponseHeaders?: string; }) => Promise<void>; getResponseBody: (opts: { requestId: Fetch_RequestId; }) => Promise<{ body: string; base64Encoded: boolean; }>; takeResponseBodyAsStream: (opts: { requestId: Fetch_RequestId; }) => Promise<{ stream: IO_StreamHandle; }>; }

A domain for letting clients substitute browser's network layer with client code.

HeadlessExperimental: { beginFrame: (opts: { frameTimeTicks?: number; interval?: number; noDisplayUpdates?: boolean; screenshot?: HeadlessExperimental_ScreenshotParams; }) => Promise<{ hasDamage: boolean; screenshotData?: string; }>; disable: () => Promise<void>; enable: () => Promise<void>; }
HeapProfiler: { addInspectedHeapObject: (opts: { heapObjectId: HeapProfiler_HeapSnapshotObjectId; }) => Promise<void>; collectGarbage: () => Promise<void>; disable: () => Promise<void>; enable: () => Promise<void>; getHeapObjectId: (opts: { objectId: Runtime_RemoteObjectId; }) => Promise<{ heapSnapshotObjectId: HeapProfiler_HeapSnapshotObjectId; }>; getObjectByHeapObjectId: (opts: { objectId: HeapProfiler_HeapSnapshotObjectId; objectGroup?: string; }) => Promise<{ result: Runtime_RemoteObject; }>; getSamplingProfile: () => Promise<{ profile: HeapProfiler_SamplingHeapProfile; }>; startSampling: (opts: { samplingInterval?: number; includeObjectsCollectedByMajorGC?: boolean; includeObjectsCollectedByMinorGC?: boolean; }) => Promise<void>; startTrackingHeapObjects: (opts: { trackAllocations?: boolean; }) => Promise<void>; stopSampling: () => Promise<{ profile: HeapProfiler_SamplingHeapProfile; }>; stopTrackingHeapObjects: (opts: { reportProgress?: boolean; treatGlobalObjectsAsRoots?: boolean; captureNumericValue?: boolean; exposeInternals?: boolean; }) => Promise<void>; takeHeapSnapshot: (opts: { reportProgress?: boolean; treatGlobalObjectsAsRoots?: boolean; captureNumericValue?: boolean; exposeInternals?: boolean; }) => Promise<void>; }
IndexedDB: { clearObjectStore: (opts: { securityOrigin?: string; storageKey?: string; storageBucket?: Storage_StorageBucket; databaseName: string; objectStoreName: string; }) => Promise<void>; deleteDatabase: (opts: { securityOrigin?: string; storageKey?: string; storageBucket?: Storage_StorageBucket; databaseName: string; }) => Promise<void>; deleteObjectStoreEntries: (opts: { securityOrigin?: string; storageKey?: string; storageBucket?: Storage_StorageBucket; databaseName: string; objectStoreName: string; keyRange: IndexedDB_KeyRange; }) => Promise<void>; disable: () => Promise<void>; enable: () => Promise<void>; requestData: (opts: { securityOrigin?: string; storageKey?: string; storageBucket?: Storage_StorageBucket; databaseName: string; objectStoreName: string; indexName: string; skipCount: number; pageSize: number; keyRange?: IndexedDB_KeyRange; }) => Promise<{ objectStoreDataEntries: IndexedDB_DataEntry[]; hasMore: boolean; }>; getMetadata: (opts: { securityOrigin?: string; storageKey?: string; storageBucket?: Storage_StorageBucket; databaseName: string; objectStoreName: string; }) => Promise<{ entriesCount: number; keyGeneratorValue: number; }>; requestDatabase: (opts: { securityOrigin?: string; storageKey?: string; storageBucket?: Storage_StorageBucket; databaseName: string; }) => Promise<{ databaseWithObjectStores: IndexedDB_DatabaseWithObjectStores; }>; requestDatabaseNames: (opts: { securityOrigin?: string; storageKey?: string; storageBucket?: Storage_StorageBucket; }) => Promise<{ databaseNames: string[]; }>; }
Input: { dispatchDragEvent: (opts: { type:
| "dragEnter"
| "dragOver"
| "drop"
| "dragCancel"
; x: number; y: number; data: Input_DragData; modifiers?: number; }
) => Promise<void>; dispatchKeyEvent: (opts: { type:
| "keyDown"
| "keyUp"
| "rawKeyDown"
| "char"
; modifiers?: number; timestamp?: Input_TimeSinceEpoch; text?: string; unmodifiedText?: string; keyIdentifier?: string; code?: string; key?: string; windowsVirtualKeyCode?: number; nativeVirtualKeyCode?: number; autoRepeat?: boolean; isKeypad?: boolean; isSystemKey?: boolean; location?: number; commands?: string[]; }
) => Promise<void>; insertText: (opts: { text: string; }) => Promise<void>; imeSetComposition: (opts: { text: string; selectionStart: number; selectionEnd: number; replacementStart?: number; replacementEnd?: number; }) => Promise<void>; dispatchMouseEvent: (opts: { type:
| "mousePressed"
| "mouseReleased"
| "mouseMoved"
| "mouseWheel"
; x: number; y: number; modifiers?: number; timestamp?: Input_TimeSinceEpoch; button?: Input_MouseButton; buttons?: number; clickCount?: number; force?: number; tangentialPressure?: number; tiltX?: number; tiltY?: number; twist?: number; deltaX?: number; deltaY?: number; pointerType?: "mouse" | "pen"; }
) => Promise<void>; dispatchTouchEvent: (opts: { type:
| "touchStart"
| "touchEnd"
| "touchMove"
| "touchCancel"
; touchPoints: Input_TouchPoint[]; modifiers?: number; timestamp?: Input_TimeSinceEpoch; }
) => Promise<void>; cancelDragging: () => Promise<void>; emulateTouchFromMouseEvent: (opts: { type:
| "mousePressed"
| "mouseReleased"
| "mouseMoved"
| "mouseWheel"
; x: number; y: number; button: Input_MouseButton; timestamp?: Input_TimeSinceEpoch; deltaX?: number; deltaY?: number; modifiers?: number; clickCount?: number; }
) => Promise<void>; setIgnoreInputEvents: (opts: { ignore: boolean; }) => Promise<void>; setInterceptDrags: (opts: { enabled: boolean; }) => Promise<void>; synthesizePinchGesture: (opts: { x: number; y: number; scaleFactor: number; relativeSpeed?: number; gestureSourceType?: Input_GestureSourceType; }) => Promise<void>; synthesizeScrollGesture: (opts: { x: number; y: number; xDistance?: number; yDistance?: number; xOverscroll?: number; yOverscroll?: number; preventFling?: boolean; speed?: number; gestureSourceType?: Input_GestureSourceType; repeatCount?: number; repeatDelayMs?: number; interactionMarkerName?: string; }) => Promise<void>; synthesizeTapGesture: (opts: { x: number; y: number; duration?: number; tapCount?: number; gestureSourceType?: Input_GestureSourceType; }) => Promise<void>; }
Inspector: { disable: () => Promise<void>; enable: () => Promise<void>; }
IO: { close: (opts: { handle: IO_StreamHandle; }) => Promise<void>; read: (opts: { handle: IO_StreamHandle; offset?: number; size?: number; }) => Promise<{ base64Encoded?: boolean; data: string; eof: boolean; }>; resolveBlob: (opts: { objectId: Runtime_RemoteObjectId; }) => Promise<{ uuid: string; }>; }

Input/Output operations for streams produced by DevTools.

LayerTree: { compositingReasons: (opts: { layerId: LayerTree_LayerId; }) => Promise<{ compositingReasons: string[]; compositingReasonIds: string[]; }>; disable: () => Promise<void>; enable: () => Promise<void>; loadSnapshot: (opts: { tiles: LayerTree_PictureTile[]; }) => Promise<{ snapshotId: LayerTree_SnapshotId; }>; makeSnapshot: (opts: { layerId: LayerTree_LayerId; }) => Promise<{ snapshotId: LayerTree_SnapshotId; }>; profileSnapshot: (opts: { snapshotId: LayerTree_SnapshotId; minRepeatCount?: number; minDuration?: number; clipRect?: DOM_Rect; }) => Promise<{ timings: LayerTree_PaintProfile[]; }>; releaseSnapshot: (opts: { snapshotId: LayerTree_SnapshotId; }) => Promise<void>; replaySnapshot: (opts: { snapshotId: LayerTree_SnapshotId; fromStep?: number; toStep?: number; scale?: number; }) => Promise<{ dataURL: string; }>; snapshotCommandLog: (opts: { snapshotId: LayerTree_SnapshotId; }) => Promise<{ commandLog: object[]; }>; }
Log: { clear: () => Promise<void>; disable: () => Promise<void>; enable: () => Promise<void>; startViolationsReport: (opts: { config: Log_ViolationSetting[]; }) => Promise<void>; stopViolationsReport: () => Promise<void>; }

Provides access to log entries.

Media: { enable: () => Promise<void>; disable: () => Promise<void>; }
Memory: { getDOMCounters: () => Promise<{ documents: number; nodes: number; jsEventListeners: number; }>; prepareForLeakDetection: () => Promise<void>; forciblyPurgeJavaScriptMemory: () => Promise<void>; setPressureNotificationsSuppressed: (opts: { suppressed: boolean; }) => Promise<void>; simulatePressureNotification: (opts: { level: Memory_PressureLevel; }) => Promise<void>; startSampling: (opts: { samplingInterval?: number; suppressRandomness?: boolean; }) => Promise<void>; stopSampling: () => Promise<void>; getAllTimeSamplingProfile: () => Promise<{ profile: Memory_SamplingProfile; }>; getBrowserSamplingProfile: () => Promise<{ profile: Memory_SamplingProfile; }>; getSamplingProfile: () => Promise<{ profile: Memory_SamplingProfile; }>; }
Network: { setAcceptedEncodings: (opts: { encodings: Network_ContentEncoding[]; }) => Promise<void>; clearAcceptedEncodingsOverride: () => Promise<void>; canClearBrowserCache: () => Promise<{ result: boolean; }>; canClearBrowserCookies: () => Promise<{ result: boolean; }>; canEmulateNetworkConditions: () => Promise<{ result: boolean; }>; clearBrowserCache: () => Promise<void>; clearBrowserCookies: () => Promise<void>; continueInterceptedRequest: (opts: { interceptionId: Network_InterceptionId; errorReason?: Network_ErrorReason; rawResponse?: string; url?: string; method?: string; postData?: string; headers?: Network_Headers; authChallengeResponse?: Network_AuthChallengeResponse; }) => Promise<void>; deleteCookies: (opts: { name: string; url?: string; domain?: string; path?: string; }) => Promise<void>; disable: () => Promise<void>; emulateNetworkConditions: (opts: { offline: boolean; latency: number; downloadThroughput: number; uploadThroughput: number; connectionType?: Network_ConnectionType; }) => Promise<void>; enable: (opts: { maxTotalBufferSize?: number; maxResourceBufferSize?: number; maxPostDataSize?: number; }) => Promise<void>; getAllCookies: () => Promise<{ cookies: Network_Cookie[]; }>; getCertificate: (opts: { origin: string; }) => Promise<{ tableNames: string[]; }>; getCookies: (opts: { urls?: string[]; }) => Promise<{ cookies: Network_Cookie[]; }>; getResponseBody: (opts: { requestId: Network_RequestId; }) => Promise<{ body: string; base64Encoded: boolean; }>; getRequestPostData: (opts: { requestId: Network_RequestId; }) => Promise<{ postData: string; }>; getResponseBodyForInterception: (opts: { interceptionId: Network_InterceptionId; }) => Promise<{ body: string; base64Encoded: boolean; }>; takeResponseBodyForInterceptionAsStream: (opts: { interceptionId: Network_InterceptionId; }) => Promise<{ stream: IO_StreamHandle; }>; replayXHR: (opts: { requestId: Network_RequestId; }) => Promise<void>; searchInResponseBody: (opts: { requestId: Network_RequestId; query: string; caseSensitive?: boolean; isRegex?: boolean; }) => Promise<{ result: Debugger_SearchMatch[]; }>; setBlockedURLs: (opts: { urls: string[]; }) => Promise<void>; setBypassServiceWorker: (opts: { bypass: boolean; }) => Promise<void>; setCacheDisabled: (opts: { cacheDisabled: boolean; }) => Promise<void>; setCookie: (opts: { name: string; value: string; url?: string; domain?: string; path?: string; secure?: boolean; httpOnly?: boolean; sameSite?: Network_CookieSameSite; expires?: Network_TimeSinceEpoch; priority?: Network_CookiePriority; sameParty?: boolean; sourceScheme?: Network_CookieSourceScheme; sourcePort?: number; partitionKey?: string; }) => Promise<{ success: boolean; }>; setCookies: (opts: { cookies: Network_CookieParam[]; }) => Promise<void>; setExtraHTTPHeaders: (opts: { headers: Network_Headers; }) => Promise<void>; setAttachDebugStack: (opts: { enabled: boolean; }) => Promise<void>; setRequestInterception: (opts: { patterns: Network_RequestPattern[]; }) => Promise<void>; setUserAgentOverride: (opts: { userAgent: string; acceptLanguage?: string; platform?: string; userAgentMetadata?: Emulation_UserAgentMetadata; }) => Promise<void>; getSecurityIsolationStatus: (opts: { frameId?: Page_FrameId; }) => Promise<{ status: Network_SecurityIsolationStatus; }>; enableReportingApi: (opts: { enable: boolean; }) => Promise<void>; loadNetworkResource: (opts: { frameId?: Page_FrameId; url: string; options: Network_LoadNetworkResourceOptions; }) => Promise<{ resource: Network_LoadNetworkResourcePageResult; }>; }

Network domain allows tracking network activities of the page. It exposes information about http, file, data and other requests and responses, their headers, bodies, timing, etc.

Overlay: { disable: () => Promise<void>; enable: () => Promise<void>; getHighlightObjectForTest: (opts: { nodeId: DOM_NodeId; includeDistance?: boolean; includeStyle?: boolean; colorFormat?: Overlay_ColorFormat; showAccessibilityInfo?: boolean; }) => Promise<{ highlight: object; }>; getGridHighlightObjectsForTest: (opts: { nodeIds: DOM_NodeId[]; }) => Promise<{ highlights: object; }>; getSourceOrderHighlightObjectForTest: (opts: { nodeId: DOM_NodeId; }) => Promise<{ highlight: object; }>; hideHighlight: () => Promise<void>; highlightFrame: (opts: { frameId: Page_FrameId; contentColor?: DOM_RGBA; contentOutlineColor?: DOM_RGBA; }) => Promise<void>; highlightNode: (opts: { highlightConfig: Overlay_HighlightConfig; nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectId?: Runtime_RemoteObjectId; selector?: string; }) => Promise<void>; highlightQuad: (opts: { quad: DOM_Quad; color?: DOM_RGBA; outlineColor?: DOM_RGBA; }) => Promise<void>; highlightRect: (opts: { x: number; y: number; width: number; height: number; color?: DOM_RGBA; outlineColor?: DOM_RGBA; }) => Promise<void>; highlightSourceOrder: (opts: { sourceOrderConfig: Overlay_SourceOrderConfig; nodeId?: DOM_NodeId; backendNodeId?: DOM_BackendNodeId; objectId?: Runtime_RemoteObjectId; }) => Promise<void>; setInspectMode: (opts: { mode: Overlay_InspectMode; highlightConfig?: Overlay_HighlightConfig; }) => Promise<void>; setShowAdHighlights: (opts: { show: boolean; }) => Promise<void>; setPausedInDebuggerMessage: (opts: { message?: string; }) => Promise<void>; setShowDebugBorders: (opts: { show: boolean; }) => Promise<void>; setShowFPSCounter: (opts: { show: boolean; }) => Promise<void>; setShowGridOverlays: (opts: { gridNodeHighlightConfigs: Overlay_GridNodeHighlightConfig[]; }) => Promise<void>; setShowFlexOverlays: (opts: { flexNodeHighlightConfigs: Overlay_FlexNodeHighlightConfig[]; }) => Promise<void>; setShowScrollSnapOverlays: (opts: { scrollSnapHighlightConfigs: Overlay_ScrollSnapHighlightConfig[]; }) => Promise<void>; setShowContainerQueryOverlays: (opts: { containerQueryHighlightConfigs: Overlay_ContainerQueryHighlightConfig[]; }) => Promise<void>; setShowPaintRects: (opts: { result: boolean; }) => Promise<void>; setShowLayoutShiftRegions: (opts: { result: boolean; }) => Promise<void>; setShowScrollBottleneckRects: (opts: { show: boolean; }) => Promise<void>; setShowHitTestBorders: (opts: { show: boolean; }) => Promise<void>; setShowWebVitals: (opts: { show: boolean; }) => Promise<void>; setShowViewportSizeOnResize: (opts: { show: boolean; }) => Promise<void>; setShowHinge: (opts: { hingeConfig?: Overlay_HingeConfig; }) => Promise<void>; setShowIsolatedElements: (opts: { isolatedElementHighlightConfigs: Overlay_IsolatedElementHighlightConfig[]; }) => Promise<void>; }
Page: { addScriptToEvaluateOnLoad: (opts: { scriptSource: string; }) => Promise<{ identifier: Page_ScriptIdentifier; }>; addScriptToEvaluateOnNewDocument: (opts: { source: string; worldName?: string; includeCommandLineAPI?: boolean; runImmediately?: boolean; }) => Promise<{ identifier: Page_ScriptIdentifier; }>; bringToFront: () => Promise<void>; captureScreenshot: (opts: { format?: "jpeg" | "png" | "webp"; quality?: number; clip?: Page_Viewport; fromSurface?: boolean; captureBeyondViewport?: boolean; optimizeForSpeed?: boolean; }) => Promise<{ data: string; }>; captureSnapshot: (opts: { format?: "mhtml"; }) => Promise<{ data: string; }>; clearDeviceMetricsOverride: () => Promise<void>; clearDeviceOrientationOverride: () => Promise<void>; clearGeolocationOverride: () => Promise<void>; createIsolatedWorld: (opts: { frameId: Page_FrameId; worldName?: string; grantUniveralAccess?: boolean; }) => Promise<{ executionContextId: Runtime_ExecutionContextId; }>; deleteCookie: (opts: { cookieName: string; url: string; }) => Promise<void>; disable: () => Promise<void>; enable: () => Promise<void>; getAppManifest: () => Promise<{ url: string; errors: Page_AppManifestError[]; data?: string; parsed?: Page_AppManifestParsedProperties; }>; getInstallabilityErrors: () => Promise<{ installabilityErrors: Page_InstallabilityError[]; }>; getManifestIcons: () => Promise<{ primaryIcon?: string; }>; getAppId: () => Promise<{ appId?: string; recommendedId?: string; }>; getAdScriptId: (opts: { frameId: Page_FrameId; }) => Promise<{ adScriptId?: Page_AdScriptId; }>; getCookies: () => Promise<{ cookies: Network_Cookie[]; }>; getFrameTree: () => Promise<{ frameTree: Page_FrameTree; }>; getLayoutMetrics: () => Promise<{ layoutViewport: Page_LayoutViewport; visualViewport: Page_VisualViewport; contentSize: DOM_Rect; cssLayoutViewport: Page_LayoutViewport; cssVisualViewport: Page_VisualViewport; cssContentSize: DOM_Rect; }>; getNavigationHistory: () => Promise<{ currentIndex: number; entries: Page_NavigationEntry[]; }>; resetNavigationHistory: () => Promise<void>; getResourceContent: (opts: { frameId: Page_FrameId; url: string; }) => Promise<{ content: string; base64Encoded: boolean; }>; getResourceTree: () => Promise<{ frameTree: Page_FrameResourceTree; }>; handleJavaScriptDialog: (opts: { accept: boolean; promptText?: string; }) => Promise<void>; navigate: (opts: { url: string; referrer?: string; transitionType?: Page_TransitionType; frameId?: Page_FrameId; referrerPolicy?: Page_ReferrerPolicy; }) => Promise<{ frameId: Page_FrameId; loaderId?: Network_LoaderId; errorText?: string; }>; navigateToHistoryEntry: (opts: { entryId: number; }) => Promise<void>; printToPDF: (opts: { landscape?: boolean; displayHeaderFooter?: boolean; printBackground?: boolean; scale?: number; paperWidth?: number; paperHeight?: number; marginTop?: number; marginBottom?: number; marginLeft?: number; marginRight?: number; pageRanges?: string; headerTemplate?: string; footerTemplate?: string; preferCSSPageSize?: boolean; transferMode?: "ReturnAsBase64" | "ReturnAsStream"; generateTaggedPDF?: boolean; }) => Promise<{ data: string; stream?: IO_StreamHandle; }>; reload: (opts: { ignoreCache?: boolean; scriptToEvaluateOnLoad?: string; }) => Promise<void>; removeScriptToEvaluateOnLoad: (opts: { identifier: Page_ScriptIdentifier; }) => Promise<void>; removeScriptToEvaluateOnNewDocument: (opts: { identifier: Page_ScriptIdentifier; }) => Promise<void>; screencastFrameAck: (opts: { sessionId: number; }) => Promise<void>; searchInResource: (opts: { frameId: Page_FrameId; url: string; query: string; caseSensitive?: boolean; isRegex?: boolean; }) => Promise<{ result: Debugger_SearchMatch[]; }>; setAdBlockingEnabled: (opts: { enabled: boolean; }) => Promise<void>; setBypassCSP: (opts: { enabled: boolean; }) => Promise<void>; getPermissionsPolicyState: (opts: { frameId: Page_FrameId; }) => Promise<{ states: Page_PermissionsPolicyFeatureState[]; }>; getOriginTrials: (opts: { frameId: Page_FrameId; }) => Promise<{ originTrials: Page_OriginTrial[]; }>; setDeviceMetricsOverride: (opts: { width: number; height: number; deviceScaleFactor: number; mobile: boolean; scale?: number; screenWidth?: number; screenHeight?: number; positionX?: number; positionY?: number; dontSetVisibleSize?: boolean; screenOrientation?: Emulation_ScreenOrientation; viewport?: Page_Viewport; }) => Promise<void>; setDeviceOrientationOverride: (opts: { alpha: number; beta: number; gamma: number; }) => Promise<void>; setFontFamilies: (opts: { fontFamilies: Page_FontFamilies; forScripts?: Page_ScriptFontFamilies[]; }) => Promise<void>; setFontSizes: (opts: { fontSizes: Page_FontSizes; }) => Promise<void>; setDocumentContent: (opts: { frameId: Page_FrameId; html: string; }) => Promise<void>; setDownloadBehavior: (opts: { behavior: "deny" | "allow" | "default"; downloadPath?: string; }) => Promise<void>; setGeolocationOverride: (opts: { latitude?: number; longitude?: number; accuracy?: number; }) => Promise<void>; setLifecycleEventsEnabled: (opts: { enabled: boolean; }) => Promise<void>; setTouchEmulationEnabled: (opts: { enabled: boolean; configuration?: "mobile" | "desktop"; }) => Promise<void>; startScreencast: (opts: { format?: "jpeg" | "png"; quality?: number; maxWidth?: number; maxHeight?: number; everyNthFrame?: number; }) => Promise<void>; stopLoading: () => Promise<void>; crash: () => Promise<void>; close: () => Promise<void>; setWebLifecycleState: (opts: { state: "frozen" | "active"; }) => Promise<void>; stopScreencast: () => Promise<void>; produceCompilationCache: (opts: { scripts: Page_CompilationCacheParams[]; }) => Promise<void>; addCompilationCache: (opts: { url: string; data: string; }) => Promise<void>; clearCompilationCache: () => Promise<void>; setSPCTransactionMode: (opts: { mode: Page_AutoResponseMode; }) => Promise<void>; setRPHRegistrationMode: (opts: { mode: Page_AutoResponseMode; }) => Promise<void>; generateTestReport: (opts: { message: string; group?: string; }) => Promise<void>; waitForDebugger: () => Promise<void>; setInterceptFileChooserDialog: (opts: { enabled: boolean; }) => Promise<void>; setPrerenderingAllowed: (opts: { isAllowed: boolean; }) => Promise<void>; }

Actions and events related to the inspected page belong to the page domain.

Performance: { disable: () => Promise<void>; enable: (opts: { timeDomain?: "timeTicks" | "threadTicks"; }) => Promise<void>; setTimeDomain: (opts: { timeDomain: "timeTicks" | "threadTicks"; }) => Promise<void>; getMetrics: () => Promise<{ metrics: Performance_Metric[]; }>; }
PerformanceTimeline: { enable: (opts: { eventTypes: string[]; }) => Promise<void>; }
Preload: { enable: () => Promise<void>; disable: () => Promise<void>; }
Profiler: { disable: () => Promise<void>; enable: () => Promise<void>; getBestEffortCoverage: () => Promise<{ result: Profiler_ScriptCoverage[]; }>; setSamplingInterval: (opts: { interval: number; }) => Promise<void>; start: () => Promise<void>; startPreciseCoverage: (opts: { callCount?: boolean; detailed?: boolean; allowTriggeredUpdates?: boolean; }) => Promise<{ timestamp: number; }>; stop: () => Promise<{ profile: Profiler_Profile; }>; stopPreciseCoverage: () => Promise<void>; takePreciseCoverage: () => Promise<{ result: Profiler_ScriptCoverage[]; timestamp: number; }>; }
Runtime: { awaitPromise: (opts: { promiseObjectId: Runtime_RemoteObjectId; returnByValue?: boolean; generatePreview?: boolean; }) => Promise<{ result: Runtime_RemoteObject; exceptionDetails?: Runtime_ExceptionDetails; }>; callFunctionOn: (opts: { functionDeclaration: string; objectId?: Runtime_RemoteObjectId; arguments?: Runtime_CallArgument[]; silent?: boolean; returnByValue?: boolean; generatePreview?: boolean; userGesture?: boolean; awaitPromise?: boolean; executionContextId?: Runtime_ExecutionContextId; objectGroup?: string; throwOnSideEffect?: boolean; uniqueContextId?: string; generateWebDriverValue?: boolean; serializationOptions?: Runtime_SerializationOptions; }) => Promise<{ result: Runtime_RemoteObject; exceptionDetails?: Runtime_ExceptionDetails; }>; compileScript: (opts: { expression: string; sourceURL: string; persistScript: boolean; executionContextId?: Runtime_ExecutionContextId; }) => Promise<{ scriptId?: Runtime_ScriptId; exceptionDetails?: Runtime_ExceptionDetails; }>; disable: () => Promise<void>; discardConsoleEntries: () => Promise<void>; enable: () => Promise<void>; evaluate: (opts: { expression: string; objectGroup?: string; includeCommandLineAPI?: boolean; silent?: boolean; contextId?: Runtime_ExecutionContextId; returnByValue?: boolean; generatePreview?: boolean; userGesture?: boolean; awaitPromise?: boolean; throwOnSideEffect?: boolean; timeout?: Runtime_TimeDelta; disableBreaks?: boolean; replMode?: boolean; allowUnsafeEvalBlockedByCSP?: boolean; uniqueContextId?: string; generateWebDriverValue?: boolean; serializationOptions?: Runtime_SerializationOptions; }) => Promise<{ result: Runtime_RemoteObject; exceptionDetails?: Runtime_ExceptionDetails; }>; getIsolateId: () => Promise<{ id: string; }>; getHeapUsage: () => Promise<{ usedSize: number; totalSize: number; }>; getProperties: (opts: { objectId: Runtime_RemoteObjectId; ownProperties?: boolean; accessorPropertiesOnly?: boolean; generatePreview?: boolean; nonIndexedPropertiesOnly?: boolean; }) => Promise<{ result: Runtime_PropertyDescriptor[]; internalProperties?: Runtime_InternalPropertyDescriptor[]; privateProperties?: Runtime_PrivatePropertyDescriptor[]; exceptionDetails?: Runtime_ExceptionDetails; }>; globalLexicalScopeNames: (opts: { executionContextId?: Runtime_ExecutionContextId; }) => Promise<{ names: string[]; }>; queryObjects: (opts: { prototypeObjectId: Runtime_RemoteObjectId; objectGroup?: string; }) => Promise<{ objects: Runtime_RemoteObject; }>; releaseObject: (opts: { objectId: Runtime_RemoteObjectId; }) => Promise<void>; releaseObjectGroup: (opts: { objectGroup: string; }) => Promise<void>; runIfWaitingForDebugger: () => Promise<void>; runScript: (opts: { scriptId: Runtime_ScriptId; executionContextId?: Runtime_ExecutionContextId; objectGroup?: string; silent?: boolean; includeCommandLineAPI?: boolean; returnByValue?: boolean; generatePreview?: boolean; awaitPromise?: boolean; }) => Promise<{ result: Runtime_RemoteObject; exceptionDetails?: Runtime_ExceptionDetails; }>; setAsyncCallStackDepth: (opts: { maxDepth: number; }) => Promise<void>; setCustomObjectFormatterEnabled: (opts: { enabled: boolean; }) => Promise<void>; setMaxCallStackSizeToCapture: (opts: { size: number; }) => Promise<void>; terminateExecution: () => Promise<void>; addBinding: (opts: { name: string; executionContextId?: Runtime_ExecutionContextId; executionContextName?: string; }) => Promise<void>; removeBinding: (opts: { name: string; }) => Promise<void>; getExceptionDetails: (opts: { errorObjectId: Runtime_RemoteObjectId; }) => Promise<{ exceptionDetails?: Runtime_ExceptionDetails; }>; }

Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.

deprecated
Schema: { getDomains: () => Promise<{ domains: Schema_Domain[]; }>; }
Security: { disable: () => Promise<void>; enable: () => Promise<void>; setIgnoreCertificateErrors: (opts: { ignore: boolean; }) => Promise<void>; handleCertificateError: (opts: { eventId: number; action: Security_CertificateErrorAction; }) => Promise<void>; setOverrideCertificateErrors: (opts: { override: boolean; }) => Promise<void>; }

Security

ServiceWorker: { deliverPushMessage: (opts: { origin: string; registrationId: ServiceWorker_RegistrationID; data: string; }) => Promise<void>; disable: () => Promise<void>; dispatchSyncEvent: (opts: { origin: string; registrationId: ServiceWorker_RegistrationID; tag: string; lastChance: boolean; }) => Promise<void>; dispatchPeriodicSyncEvent: (opts: { origin: string; registrationId: ServiceWorker_RegistrationID; tag: string; }) => Promise<void>; enable: () => Promise<void>; inspectWorker: (opts: { versionId: string; }) => Promise<void>; setForceUpdateOnPageLoad: (opts: { forceUpdateOnPageLoad: boolean; }) => Promise<void>; skipWaiting: (opts: { scopeURL: string; }) => Promise<void>; startWorker: (opts: { scopeURL: string; }) => Promise<void>; stopAllWorkers: () => Promise<void>; stopWorker: (opts: { versionId: string; }) => Promise<void>; unregister: (opts: { scopeURL: string; }) => Promise<void>; updateRegistration: (opts: { scopeURL: string; }) => Promise<void>; }
Storage: { getStorageKeyForFrame: (opts: { frameId: Page_FrameId; }) => Promise<{ storageKey: Storage_SerializedStorageKey; }>; clearDataForOrigin: (opts: { origin: string; storageTypes: string; }) => Promise<void>; clearDataForStorageKey: (opts: { storageKey: string; storageTypes: string; }) => Promise<void>; getCookies: (opts: { browserContextId?: Browser_BrowserContextID; }) => Promise<{ cookies: Network_Cookie[]; }>; setCookies: (opts: { cookies: Network_CookieParam[]; browserContextId?: Browser_BrowserContextID; }) => Promise<void>; clearCookies: (opts: { browserContextId?: Browser_BrowserContextID; }) => Promise<void>; getUsageAndQuota: (opts: { origin: string; }) => Promise<{ usage: number; quota: number; overrideActive: boolean; usageBreakdown: Storage_UsageForType[]; }>; overrideQuotaForOrigin: (opts: { origin: string; quotaSize?: number; }) => Promise<void>; trackCacheStorageForOrigin: (opts: { origin: string; }) => Promise<void>; trackCacheStorageForStorageKey: (opts: { storageKey: string; }) => Promise<void>; trackIndexedDBForOrigin: (opts: { origin: string; }) => Promise<void>; trackIndexedDBForStorageKey: (opts: { storageKey: string; }) => Promise<void>; untrackCacheStorageForOrigin: (opts: { origin: string; }) => Promise<void>; untrackCacheStorageForStorageKey: (opts: { storageKey: string; }) => Promise<void>; untrackIndexedDBForOrigin: (opts: { origin: string; }) => Promise<void>; untrackIndexedDBForStorageKey: (opts: { storageKey: string; }) => Promise<void>; getTrustTokens: () => Promise<{ tokens: Storage_TrustTokens[]; }>; clearTrustTokens: (opts: { issuerOrigin: string; }) => Promise<{ didDeleteTokens: boolean; }>; getInterestGroupDetails: (opts: { ownerOrigin: string; name: string; }) => Promise<{ details: Storage_InterestGroupDetails; }>; setInterestGroupTracking: (opts: { enable: boolean; }) => Promise<void>; getSharedStorageMetadata: (opts: { ownerOrigin: string; }) => Promise<{ metadata: Storage_SharedStorageMetadata; }>; getSharedStorageEntries: (opts: { ownerOrigin: string; }) => Promise<{ entries: Storage_SharedStorageEntry[]; }>; setSharedStorageEntry: (opts: { ownerOrigin: string; key: string; value: string; ignoreIfPresent?: boolean; }) => Promise<void>; deleteSharedStorageEntry: (opts: { ownerOrigin: string; key: string; }) => Promise<void>; clearSharedStorageEntries: (opts: { ownerOrigin: string; }) => Promise<void>; resetSharedStorageBudget: (opts: { ownerOrigin: string; }) => Promise<void>; setSharedStorageTracking: (opts: { enable: boolean; }) => Promise<void>; setStorageBucketTracking: (opts: { storageKey: string; enable: boolean; }) => Promise<void>; deleteStorageBucket: (opts: { bucket: Storage_StorageBucket; }) => Promise<void>; runBounceTrackingMitigations: () => Promise<{ deletedSites: string[]; }>; setAttributionReportingLocalTestingMode: (opts: { enabled: boolean; }) => Promise<void>; setAttributionReportingTracking: (opts: { enable: boolean; }) => Promise<void>; }
SystemInfo: { getInfo: () => Promise<{ gpu: SystemInfo_GPUInfo; modelName: string; modelVersion: string; commandLine: string; }>; getFeatureState: (opts: { featureState: string; }) => Promise<{ featureEnabled: boolean; }>; getProcessInfo: () => Promise<{ processInfo: SystemInfo_ProcessInfo[]; }>; }
Target: { activateTarget: (opts: { targetId: Target_TargetID; }) => Promise<void>; attachToTarget: (opts: { targetId: Target_TargetID; flatten?: boolean; }) => Promise<{ sessionId: Target_SessionID; }>; attachToBrowserTarget: () => Promise<{ sessionId: Target_SessionID; }>; closeTarget: (opts: { targetId: Target_TargetID; }) => Promise<{ success: boolean; }>; exposeDevToolsProtocol: (opts: { targetId: Target_TargetID; bindingName?: string; }) => Promise<void>; createBrowserContext: (opts: { disposeOnDetach?: boolean; proxyServer?: string; proxyBypassList?: string; originsWithUniversalNetworkAccess?: string[]; }) => Promise<{ browserContextId: Browser_BrowserContextID; }>; getBrowserContexts: () => Promise<{ browserContextIds: Browser_BrowserContextID[]; }>; createTarget: (opts: { url: string; width?: number; height?: number; browserContextId?: Browser_BrowserContextID; enableBeginFrameControl?: boolean; newWindow?: boolean; background?: boolean; forTab?: boolean; }) => Promise<{ targetId: Target_TargetID; }>; detachFromTarget: (opts: { sessionId?: Target_SessionID; targetId?: Target_TargetID; }) => Promise<void>; disposeBrowserContext: (opts: { browserContextId: Browser_BrowserContextID; }) => Promise<void>; getTargetInfo: (opts: { targetId?: Target_TargetID; }) => Promise<{ targetInfo: Target_TargetInfo; }>; getTargets: (opts: { filter?: Target_TargetFilter; }) => Promise<{ targetInfos: Target_TargetInfo[]; }>; sendMessageToTarget: (opts: { message: string; sessionId?: Target_SessionID; targetId?: Target_TargetID; }) => Promise<void>; setAutoAttach: (opts: { autoAttach: boolean; waitForDebuggerOnStart: boolean; flatten?: boolean; filter?: Target_TargetFilter; }) => Promise<void>; autoAttachRelated: (opts: { targetId: Target_TargetID; waitForDebuggerOnStart: boolean; filter?: Target_TargetFilter; }) => Promise<void>; setDiscoverTargets: (opts: { discover: boolean; filter?: Target_TargetFilter; }) => Promise<void>; setRemoteLocations: (opts: { locations: Target_RemoteLocation[]; }) => Promise<void>; }

Supports additional targets discovery and allows to attach to them.

Tethering: { bind: (opts: { port: number; }) => Promise<void>; unbind: (opts: { port: number; }) => Promise<void>; }
Tracing: { end: () => Promise<void>; getCategories: () => Promise<{ categories: string[]; }>; recordClockSyncMarker: (opts: { syncId: string; }) => Promise<void>; requestMemoryDump: (opts: { deterministic?: boolean; levelOfDetail?: Tracing_MemoryDumpLevelOfDetail; }) => Promise<{ dumpGuid: string; success: boolean; }>; start: (opts: { categories?: string; options?: string; bufferUsageReportingInterval?: number; transferMode?: "ReportEvents" | "ReturnAsStream"; streamFormat?: Tracing_StreamFormat; streamCompression?: Tracing_StreamCompression; traceConfig?: Tracing_TraceConfig; perfettoConfig?: string; tracingBackend?: Tracing_TracingBackend; }) => Promise<void>; }
WebAudio: { enable: () => Promise<void>; disable: () => Promise<void>; getRealtimeData: (opts: { contextId: WebAudio_GraphObjectId; }) => Promise<{ realtimeData: WebAudio_ContextRealtimeData; }>; }
WebAuthn: { enable: (opts: { enableUI?: boolean; }) => Promise<void>; disable: () => Promise<void>; addVirtualAuthenticator: (opts: { options: WebAuthn_VirtualAuthenticatorOptions; }) => Promise<{ authenticatorId: WebAuthn_AuthenticatorId; }>; setResponseOverrideBits: (opts: { authenticatorId: WebAuthn_AuthenticatorId; isBogusSignature?: boolean; isBadUV?: boolean; isBadUP?: boolean; }) => Promise<void>; removeVirtualAuthenticator: (opts: { authenticatorId: WebAuthn_AuthenticatorId; }) => Promise<void>; addCredential: (opts: { authenticatorId: WebAuthn_AuthenticatorId; credential: WebAuthn_Credential; }) => Promise<void>; getCredential: (opts: { authenticatorId: WebAuthn_AuthenticatorId; credentialId: string; }) => Promise<{ credential: WebAuthn_Credential; }>; getCredentials: (opts: { authenticatorId: WebAuthn_AuthenticatorId; }) => Promise<{ credentials: WebAuthn_Credential[]; }>; removeCredential: (opts: { authenticatorId: WebAuthn_AuthenticatorId; credentialId: string; }) => Promise<void>; clearCredentials: (opts: { authenticatorId: WebAuthn_AuthenticatorId; }) => Promise<void>; setUserVerified: (opts: { authenticatorId: WebAuthn_AuthenticatorId; isUserVerified: boolean; }) => Promise<void>; setAutomaticPresenceSimulation: (opts: { authenticatorId: WebAuthn_AuthenticatorId; enabled: boolean; }) => Promise<void>; }

Methods

addEventListener<K extends keyof CelestialEventMap>(
type: K,
listener: (this: Celestial, ev: CelestialEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void

Close the websocket connection, does nothing if already closed.