declare var __registerDomainDispatcher; export function DomainDispatcher(domain: string): ClassDecorator { return klass => __registerDomainDispatcher(domain, klass); } // ApplicationCache export namespace ApplicationCacheDomain { export interface ApplicationCacheResource { // Resource url. url: string; // Resource size. size: number; // Resource type. type: string; } export interface ApplicationCache { // Manifest URL. manifestURL: string; // Application cache size. size: number; // Application cache creation time. creationTime: number; // Application cache update time. updateTime: number; // Application cache resources. resources: ApplicationCacheResource[]; } export interface FrameWithManifest { // Frame identifier. frameId: NetworkDomain.FrameId; // Manifest URL. manifestURL: string; // Application cache status. status: number; } export interface GetManifestForFrameMethodArguments { // Identifier of the frame containing document whose manifest is retrieved. frameId: NetworkDomain.FrameId } export interface GetApplicationCacheForFrameMethodArguments { // Identifier of the frame containing document whose application cache is retrieved. frameId: NetworkDomain.FrameId } export interface ApplicationCacheDomainDispatcher { // Returns array of frame identifiers with manifest urls for each frame containing a document associated with some application cache. getFramesWithManifests(): { frameIds: FrameWithManifest[] }; // Enables application cache domain notifications. enable(): void; // Returns manifest URL for document in the given frame. getManifestForFrame(params: GetManifestForFrameMethodArguments): { manifestURL: string }; // Returns relevant application cache data for the document in given frame. getApplicationCacheForFrame(params: GetApplicationCacheForFrameMethodArguments): { applicationCache: ApplicationCache }; } export class ApplicationCacheFrontend { constructor(private dispatchMessage: (message: String) => void) { } applicationCacheStatusUpdated(frameId: NetworkDomain.FrameId, manifestURL: string, status: number): void { this.dispatchMessage(JSON.stringify( { "method": "ApplicationCache.applicationCacheStatusUpdated", "params": { "frameId": frameId, "manifestURL": manifestURL, "status": status } } )); } networkStateUpdated(isNowOnline: boolean): void { this.dispatchMessage(JSON.stringify( { "method": "ApplicationCache.networkStateUpdated", "params": { "isNowOnline": isNowOnline } } )); } } } // CSS // This domain exposes CSS read/write operations. All CSS objects, like stylesheets, rules, and styles, have an associated id used in subsequent operations on the related object. Each object type has a specific id structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the get*ForNode() calls (which accept a DOM node id). Alternatively, a client can discover all the existing stylesheets with the getAllStyleSheets() method and subsequently load the required stylesheet contents using the getStyleSheet[Text]() methods. export namespace CSSDomain { export type StyleSheetId = string export interface CSSStyleId { // Enclosing stylesheet identifier. styleSheetId: StyleSheetId; // The style ordinal within the stylesheet. ordinal: number; } export interface CSSRuleId { // Enclosing stylesheet identifier. styleSheetId: StyleSheetId; // The rule ordinal within the stylesheet. ordinal: number; } export interface PseudoIdMatches { // Pseudo style identifier (see enum PseudoId in RenderStyleConstants.h). pseudoId: number; // Matches of CSS rules applicable to the pseudo style. matches: RuleMatch[]; } export interface InheritedStyleEntry { // The ancestor node's inline style, if any, in the style inheritance chain. inlineStyle?: CSSStyle; // Matches of CSS rules matching the ancestor node in the style inheritance chain. matchedCSSRules: RuleMatch[]; } export interface RuleMatch { // CSS rule in the match. rule: CSSRule; // Matching selector indices in the rule's selectorList selectors (0-based). matchingSelectors: number[]; } export interface CSSSelector { // Canonicalized selector text. text: string; // Specificity (a, b, c) tuple. Included if the selector is sent in response to CSS.getMatchedStylesForNode which provides a context element. specificity?: number[]; // Whether or not the specificity can be dynamic. Included if the selector is sent in response to CSS.getMatchedStylesForNode which provides a context element. dynamic?: boolean; } export interface SelectorList { // Selectors in the list. selectors: CSSSelector[]; // Rule selector text. text: string; // Rule selector range in the underlying resource (if available). range?: SourceRange; } export interface CSSStyleAttribute { // DOM attribute name (e.g. "width"). name: string; // CSS style generated by the respective DOM attribute. style: CSSStyle; } export interface CSSStyleSheetHeader { // The stylesheet identifier. styleSheetId: StyleSheetId; // Owner frame identifier. frameId: NetworkDomain.FrameId; // Stylesheet resource URL. sourceURL: string; // Stylesheet origin. origin: StyleSheetOrigin; // Stylesheet title. title: string; // Denotes whether the stylesheet is disabled. disabled: boolean; } export interface CSSStyleSheetBody { // The stylesheet identifier. styleSheetId: StyleSheetId; // Stylesheet resource URL. rules: CSSRule[]; // Stylesheet resource contents (if available). text?: string; } export interface CSSRule { // The CSS rule identifier (absent for user agent stylesheet and user-specified stylesheet rules). ruleId?: CSSRuleId; // Rule selector data. selectorList: SelectorList; // Parent stylesheet resource URL (for regular rules). sourceURL?: string; // Line ordinal of the rule selector start character in the resource. sourceLine: number; // Parent stylesheet's origin. origin: StyleSheetOrigin; // Associated style declaration. style: CSSStyle; // Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards. media?: CSSMedia[]; } export interface SourceRange { // Start line of range. startLine: number; // Start column of range (inclusive). startColumn: number; // End line of range endLine: number; // End column of range (exclusive). endColumn: number; } export interface ShorthandEntry { // Shorthand name. name: string; // Shorthand value. value: string; } export interface CSSPropertyInfo { // Property name. name: string; // Longhand property names. longhands?: string[]; // Supported values for this property. values?: string[]; } export interface CSSComputedStyleProperty { // Computed style property name. name: string; // Computed style property value. value: string; } export interface CSSStyle { // The CSS style identifier (absent for attribute styles). styleId?: CSSStyleId; // CSS properties in the style. cssProperties: CSSProperty[]; // Computed values for all shorthands found in the style. shorthandEntries: ShorthandEntry[]; // Style declaration text (if available). cssText?: string; // Style declaration range in the enclosing stylesheet (if available). range?: SourceRange; // The effective "width" property value from this style. width?: string; // The effective "height" property value from this style. height?: string; } export interface CSSProperty { // The property name. name: string; // The property value. value: string; // The property priority (implies "" if absent). priority?: string; // Whether the property is implicit (implies false if absent). implicit?: boolean; // The full property text as specified in the style. text?: string; // Whether the property is understood by the browser (implies true if absent). parsedOk?: boolean; // Whether the property is active or disabled. status?: CSSPropertyStatus; // The entire property range in the enclosing style declaration (if available). range?: SourceRange; } export interface CSSMedia { // Media query text. text: string; // Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline stylesheet's STYLE tag. source: any /* mediaRule,importRule,linkedSheet,inlineSheet */; // URL of the document containing the media query description. sourceURL?: string; // Line in the document containing the media query (not defined for the "stylesheet" source). sourceLine?: number; } export interface Region { // The "overset" attribute of a Named Flow. regionOverset: any /* overset,fit,empty */; // The corresponding DOM node id. nodeId: DOMDomain.NodeId; } export interface NamedFlow { // The document node id. documentNodeId: DOMDomain.NodeId; // Named Flow identifier. name: string; // The "overset" attribute of a Named Flow. overset: boolean; // An array of nodes that flow into the Named Flow. content: DOMDomain.NodeId[]; // An array of regions associated with the Named Flow. regions: Region[]; } export const enum StyleSheetOrigin { User, UserAgent, Inspector, Regular }; export const enum CSSPropertyStatus { Active, Inactive, Disabled, Style }; export interface GetMatchedStylesForNodeMethodArguments { nodeId: DOMDomain.NodeId, // Whether to include pseudo styles (default: true). includePseudo?: boolean, // Whether to include inherited styles (default: true). includeInherited?: boolean } export interface GetInlineStylesForNodeMethodArguments { nodeId: DOMDomain.NodeId } export interface GetComputedStyleForNodeMethodArguments { nodeId: DOMDomain.NodeId } export interface GetStyleSheetMethodArguments { styleSheetId: StyleSheetId } export interface GetStyleSheetTextMethodArguments { styleSheetId: StyleSheetId } export interface SetStyleSheetTextMethodArguments { styleSheetId: StyleSheetId, text: string } export interface SetStyleTextMethodArguments { styleId: CSSStyleId, text: string } export interface SetRuleSelectorMethodArguments { ruleId: CSSRuleId, selector: string } export interface AddRuleMethodArguments { contextNodeId: DOMDomain.NodeId, selector: string } export interface ForcePseudoStateMethodArguments { // The element id for which to force the pseudo state. nodeId: DOMDomain.NodeId, // Element pseudo classes to force when computing the element's style. forcedPseudoClasses: any /* active,focus,hover,visited */[] } export interface GetNamedFlowCollectionMethodArguments { // The document node id for which to get the Named Flow Collection. documentNodeId: DOMDomain.NodeId } export interface CSSDomainDispatcher { // Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been enabled until the result of this command is received. enable(): void; // Disables the CSS agent for the given page. disable(): void; // Returns requested styles for a DOM node identified by nodeId. getMatchedStylesForNode(params: GetMatchedStylesForNodeMethodArguments): { matchedCSSRules?: RuleMatch[], pseudoElements?: PseudoIdMatches[], inherited?: InheritedStyleEntry[] }; // Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId. getInlineStylesForNode(params: GetInlineStylesForNodeMethodArguments): { inlineStyle?: CSSStyle, attributesStyle?: CSSStyle }; // Returns the computed style for a DOM node identified by nodeId. getComputedStyleForNode(params: GetComputedStyleForNodeMethodArguments): { computedStyle: CSSComputedStyleProperty[] }; // Returns metainfo entries for all known stylesheets. getAllStyleSheets(): { headers: CSSStyleSheetHeader[] }; // Returns stylesheet data for the specified styleSheetId. getStyleSheet(params: GetStyleSheetMethodArguments): { styleSheet: CSSStyleSheetBody }; // Returns the current textual content and the URL for a stylesheet. getStyleSheetText(params: GetStyleSheetTextMethodArguments): { text: string }; // Sets the new stylesheet text, thereby invalidating all existing CSSStyleId's and CSSRuleId's contained by this stylesheet. setStyleSheetText(params: SetStyleSheetTextMethodArguments): void; // Sets the new text for the respective style. setStyleText(params: SetStyleTextMethodArguments): { style: CSSStyle }; // Modifies the rule selector. setRuleSelector(params: SetRuleSelectorMethodArguments): { rule: CSSRule }; // Creates a new empty rule with the given selector in a special "inspector" stylesheet in the owner document of the context node. addRule(params: AddRuleMethodArguments): { rule: CSSRule }; // Returns all supported CSS property names. getSupportedCSSProperties(): { cssProperties: CSSPropertyInfo[] }; // Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser. forcePseudoState(params: ForcePseudoStateMethodArguments): void; // Returns the Named Flows from the document. getNamedFlowCollection(params: GetNamedFlowCollectionMethodArguments): { namedFlows: NamedFlow[] }; } export class CSSFrontend { constructor(private dispatchMessage: (message: String) => void) { } // Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features. mediaQueryResultChanged(): void { this.dispatchMessage(JSON.stringify( { "method": "CSS.mediaQueryResultChanged", "params": { } } )); } // Fired whenever a stylesheet is changed as a result of the client operation. styleSheetChanged(styleSheetId: StyleSheetId): void { this.dispatchMessage(JSON.stringify( { "method": "CSS.styleSheetChanged", "params": { "styleSheetId": styleSheetId } } )); } // Fires when a Named Flow is created. namedFlowCreated(namedFlow: NamedFlow): void { this.dispatchMessage(JSON.stringify( { "method": "CSS.namedFlowCreated", "params": { "namedFlow": namedFlow } } )); } // Fires when a Named Flow is removed: has no associated content nodes and regions. namedFlowRemoved(documentNodeId: DOMDomain.NodeId, flowName: string): void { this.dispatchMessage(JSON.stringify( { "method": "CSS.namedFlowRemoved", "params": { "documentNodeId": documentNodeId, "flowName": flowName } } )); } // Fires if any of the regionOverset values changed in a Named Flow's region chain. regionOversetChanged(namedFlow: NamedFlow): void { this.dispatchMessage(JSON.stringify( { "method": "CSS.regionOversetChanged", "params": { "namedFlow": namedFlow } } )); } // Fires when a Named Flow's has been registered with a new content node. registeredNamedFlowContentElement(documentNodeId: DOMDomain.NodeId, flowName: string, contentNodeId: DOMDomain.NodeId, nextContentNodeId: DOMDomain.NodeId): void { this.dispatchMessage(JSON.stringify( { "method": "CSS.registeredNamedFlowContentElement", "params": { "documentNodeId": documentNodeId, "flowName": flowName, "contentNodeId": contentNodeId, "nextContentNodeId": nextContentNodeId } } )); } // Fires when a Named Flow's has been registered with a new content node. unregisteredNamedFlowContentElement(documentNodeId: DOMDomain.NodeId, flowName: string, contentNodeId: DOMDomain.NodeId): void { this.dispatchMessage(JSON.stringify( { "method": "CSS.unregisteredNamedFlowContentElement", "params": { "documentNodeId": documentNodeId, "flowName": flowName, "contentNodeId": contentNodeId } } )); } } } // Console // Console domain defines methods and events for interaction with the JavaScript console. Console collects messages created by means of the JavaScript Console API. One needs to enable this domain using enable command in order to start receiving the console messages. Browser collects messages issued while console domain is not enabled as well and reports them using messageAdded notification upon enabling. export namespace ConsoleDomain { export interface ConsoleMessage { // Message source. source: any /* xml,javascript,network,console-api,storage,appcache,rendering,css,security,content-blocker,other */; // Message severity. level: any /* log,info,warning,error,debug */; // Message text. text: string; // Console message type. type?: any /* log,dir,dirxml,table,trace,clear,startGroup,startGroupCollapsed,endGroup,assert,timing,profile,profileEnd */; // URL of the message origin. url?: string; // Line number in the resource that generated this message. line?: number; // Column number on the line in the resource that generated this message. column?: number; // Repeat count for repeated messages. repeatCount?: number; // Message parameters in case of the formatted message. parameters?: RuntimeDomain.RemoteObject[]; // JavaScript stack trace for assertions and error messages. stackTrace?: CallFrame[]; // Identifier of the network request associated with this message. networkRequestId?: NetworkDomain.RequestId; } export interface CallFrame { // JavaScript function name. functionName: string; // JavaScript script name or url. url: string; // JavaScript script line number. lineNumber: number; // JavaScript script column number. columnNumber: number; } export interface SetMonitoringXHREnabledMethodArguments { // Monitoring enabled state. enabled: boolean } export interface AddInspectedNodeMethodArguments { // DOM node id to be accessible by means of $x command line API. nodeId: DOMDomain.NodeId } export interface ConsoleDomainDispatcher { // Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. enable(): void; // Disables console domain, prevents further console messages from being reported to the client. disable(): void; // Clears console messages collected in the browser. clearMessages(): void; // Toggles monitoring of XMLHttpRequest. If true, console will receive messages upon each XHR issued. setMonitoringXHREnabled(params: SetMonitoringXHREnabledMethodArguments): void; // Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). addInspectedNode(params: AddInspectedNodeMethodArguments): void; } export class ConsoleFrontend { constructor(private dispatchMessage: (message: String) => void) { } // Issued when new console message is added. messageAdded(message: ConsoleMessage): void { this.dispatchMessage(JSON.stringify( { "method": "Console.messageAdded", "params": { "message": message } } )); } // Issued when subsequent message(s) are equal to the previous one(s). messageRepeatCountUpdated(count: number): void { this.dispatchMessage(JSON.stringify( { "method": "Console.messageRepeatCountUpdated", "params": { "count": count } } )); } // Issued when console is cleared. This happens either upon clearMessages command or after page navigation. messagesCleared(): void { this.dispatchMessage(JSON.stringify( { "method": "Console.messagesCleared", "params": { } } )); } } } // DOM // 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.

export namespace DOMDomain { // Unique DOM node identifier. export type NodeId = number // Unique DOM node identifier used to reference a node that may not have been pushed to the front-end. export type BackendNodeId = number export interface Node { // Node identifier that is passed into the rest of the DOM messages as the nodeId. Backend will only push node with given id once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client. nodeId: NodeId; // Node's nodeType. nodeType: number; // Node's nodeName. nodeName: string; // Node's localName. localName: string; // Node's nodeValue. nodeValue: string; // Child count for Container nodes. childNodeCount?: number; // Child nodes of this node when requested with children. children?: Node[]; // Attributes of the Element node in the form of flat array [name1, value1, name2, value2]. attributes?: string[]; // Document URL that Document or FrameOwner node points to. documentURL?: string; // Base URL that Document or FrameOwner node uses for URL completion. baseURL?: string; // DocumentType's publicId. publicId?: string; // DocumentType's systemId. systemId?: string; // DocumentType's internalSubset. internalSubset?: string; // Document's XML version in case of XML documents. xmlVersion?: string; // Attr's name. name?: string; // Attr's value. value?: string; // Frame ID for frame owner elements. frameId?: NetworkDomain.FrameId; // Content document for frame owner elements. contentDocument?: Node; // Shadow root list for given element host. shadowRoots?: Node[]; // Content document fragment for template elements templateContent?: Node; // Computed value for first recognized role token, default role per element, or overridden role. role?: string; } export interface EventListener { // EventListener's type. type: string; // EventListener's useCapture. useCapture: boolean; // EventListener's isAttribute. isAttribute: boolean; // Target DOMNode id. nodeId: NodeId; // Event handler function body. handlerBody: string; // Handler code location. location?: DebuggerDomain.Location; // Source script URL. sourceName?: string; // Event handler function value. handler?: RuntimeDomain.RemoteObject; } export interface AccessibilityProperties { // DOMNode id of the accessibility object referenced by aria-activedescendant. activeDescendantNodeId?: NodeId; // Value of @aria-busy on current or ancestor node. busy?: boolean; // Checked state of certain form controls. checked?: any /* true,false,mixed */; // Array of DOMNode ids of the accessibility tree children if available. childNodeIds?: NodeId[]; // Array of DOMNode ids of any nodes referenced via @aria-controls. controlledNodeIds?: NodeId[]; // Disabled state of form controls. disabled?: boolean; // Indicates whether there is an existing AX object for the DOM node. If this is false, all the other properties will be default values. exists: boolean; // Expanded state. expanded?: boolean; // Array of DOMNode ids of any nodes referenced via @aria-flowto. flowedNodeIds?: NodeId[]; // Focused state. Only defined on focusable elements. focused?: boolean; // Indicates whether the accessibility of the associated AX object node is ignored, whether heuristically or explicitly. ignored?: boolean; // State indicating whether the accessibility of the associated AX object node is ignored by default for node type. ignoredByDefault?: boolean; // Invalid status of form controls. invalid?: any /* true,false,grammar,spelling */; // Hidden state. True if node or an ancestor is hidden via CSS or explicit @aria-hidden, to clarify why the element is ignored. hidden?: boolean; // Computed label value for the node, sometimes calculated by referencing other nodes. label: string; // Value of @aria-atomic. liveRegionAtomic?: boolean; // Token value(s) of element's @aria-relevant attribute. Array of string values matching $ref LiveRegionRelevant. FIXME: Enum values blocked by http://webkit.org/b/133711 liveRegionRelevant?: string[]; // Value of element's @aria-live attribute. liveRegionStatus?: any /* assertive,polite,off */; // DOMNode id of node or closest ancestor node that has a mousedown, mouseup, or click event handler. mouseEventNodeId?: NodeId; // Target DOMNode id. nodeId: NodeId; // Array of DOMNode ids of any nodes referenced via @aria-owns. ownedNodeIds?: NodeId[]; // DOMNode id of the accessibility tree parent object if available. parentNodeId?: NodeId; // Pressed state for toggle buttons. pressed?: boolean; // Readonly state of text controls. readonly?: boolean; // Required state of form controls. required?: boolean; // Computed value for first recognized role token, default role per element, or overridden role. role: string; // Selected state of certain form controls. selected?: boolean; // Array of DOMNode ids of any children marked as selected. selectedChildNodeIds?: NodeId[]; } export interface RGBAColor { // The red component, in the [0-255] range. r: number; // The green component, in the [0-255] range. g: number; // The blue component, in the [0-255] range. b: number; // The alpha component, in the [0-1] range (default: 1). a?: number; } export interface HighlightConfig { // Whether the node info tooltip should be shown (default: false). showInfo?: boolean; // The content box highlight fill color (default: transparent). contentColor?: RGBAColor; // The padding highlight fill color (default: transparent). paddingColor?: RGBAColor; // The border highlight fill color (default: transparent). borderColor?: RGBAColor; // The margin highlight fill color (default: transparent). marginColor?: RGBAColor; } export const enum LiveRegionRelevant { Additions, Removals, Text }; export interface RequestChildNodesMethodArguments { // Id of the node to get children for. nodeId: NodeId, // The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. depth?: number } export interface QuerySelectorMethodArguments { // Id of the node to query upon. nodeId: NodeId, // Selector string. selector: string } export interface QuerySelectorAllMethodArguments { // Id of the node to query upon. nodeId: NodeId, // Selector string. selector: string } export interface SetNodeNameMethodArguments { // Id of the node to set name for. nodeId: NodeId, // New node's name. name: string } export interface SetNodeValueMethodArguments { // Id of the node to set value for. nodeId: NodeId, // New node's value. value: string } export interface RemoveNodeMethodArguments { // Id of the node to remove. nodeId: NodeId } export interface SetAttributeValueMethodArguments { // Id of the element to set attribute for. nodeId: NodeId, // Attribute name. name: string, // Attribute value. value: string } export interface SetAttributesAsTextMethodArguments { // Id of the element to set attributes for. nodeId: NodeId, // Text with a number of attributes. Will parse this text using HTML parser. text: string, // Attribute name to replace with new attributes derived from text in case text parsed successfully. name?: string } export interface RemoveAttributeMethodArguments { // Id of the element to remove attribute from. nodeId: NodeId, // Name of the attribute to remove. name: string } export interface GetEventListenersForNodeMethodArguments { // Id of the node to get listeners for. nodeId: NodeId, // Symbolic group name for handler value. Handler value is not returned without this parameter specified. objectGroup?: string } export interface GetAccessibilityPropertiesForNodeMethodArguments { // Id of the node for which to get accessibility properties. nodeId: NodeId } export interface GetOuterHTMLMethodArguments { // Id of the node to get markup for. nodeId: NodeId } export interface SetOuterHTMLMethodArguments { // Id of the node to set markup for. nodeId: NodeId, // Outer HTML markup to set. outerHTML: string } export interface PerformSearchMethodArguments { // Plain text or query selector or XPath search query. query: string, // Ids of nodes to use as starting points for the search. nodeIds?: NodeId[] } export interface GetSearchResultsMethodArguments { // Unique search session identifier. searchId: string, // Start index of the search result to be returned. fromIndex: number, // End index of the search result to be returned. toIndex: number } export interface DiscardSearchResultsMethodArguments { // Unique search session identifier. searchId: string } export interface RequestNodeMethodArguments { // JavaScript object id to convert into node. objectId: RuntimeDomain.RemoteObjectId } export interface SetInspectModeEnabledMethodArguments { // True to enable inspection mode, false to disable it. enabled: boolean, // A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false. highlightConfig?: HighlightConfig } export interface HighlightRectMethodArguments { // X coordinate x: number, // Y coordinate y: number, // Rectangle width width: number, // Rectangle height height: number, // The highlight fill color (default: transparent). color?: RGBAColor, // The highlight outline color (default: transparent). outlineColor?: RGBAColor, // Indicates whether the provided parameters are in page coordinates or in viewport coordinates (the default). usePageCoordinates?: boolean } export interface HighlightQuadMethodArguments { // Quad to highlight quad: number[], // The highlight fill color (default: transparent). color?: RGBAColor, // The highlight outline color (default: transparent). outlineColor?: RGBAColor, // Indicates whether the provided parameters are in page coordinates or in viewport coordinates (the default). usePageCoordinates?: boolean } export interface HighlightSelectorMethodArguments { // A descriptor for the highlight appearance. highlightConfig: HighlightConfig, // A CSS selector for finding matching nodes to highlight. selectorString: string, // Identifier of the frame which will be searched using the selector. If not provided, the main frame will be used. frameId?: string } export interface HighlightNodeMethodArguments { // A descriptor for the highlight appearance. highlightConfig: HighlightConfig, // Identifier of the node to highlight. nodeId?: NodeId, // JavaScript object id of the node to be highlighted. objectId?: RuntimeDomain.RemoteObjectId } export interface HighlightFrameMethodArguments { // Identifier of the frame to highlight. frameId: NetworkDomain.FrameId, // The content box highlight fill color (default: transparent). contentColor?: RGBAColor, // The content box highlight outline color (default: transparent). contentOutlineColor?: RGBAColor } export interface PushNodeByPathToFrontendMethodArguments { // Path to node in the proprietary format. path: string } export interface PushNodeByBackendIdToFrontendMethodArguments { // The backend node id of the node. backendNodeId: BackendNodeId } export interface ReleaseBackendNodeIdsMethodArguments { // The backend node ids group name. nodeGroup: string } export interface ResolveNodeMethodArguments { // Id of the node to resolve. nodeId: NodeId, // Symbolic group name that can be used to release multiple objects. objectGroup?: string } export interface GetAttributesMethodArguments { // Id of the node to retrieve attibutes for. nodeId: NodeId } export interface MoveToMethodArguments { // Id of the node to drop. nodeId: NodeId, // Id of the element to drop into. targetNodeId: NodeId, // Drop node before given one. insertBeforeNodeId?: NodeId } export interface FocusMethodArguments { // Id of the node to focus. nodeId: NodeId } export interface DOMDomainDispatcher { // Returns the root DOM node to the caller. getDocument(): { root: Node }; // Requests that children of the node with given id are returned to the caller in form of setChildNodes events where not only immediate children are retrieved, but all children down to the specified depth. requestChildNodes(params: RequestChildNodesMethodArguments): void; // Executes querySelector on a given node. querySelector(params: QuerySelectorMethodArguments): { nodeId: NodeId }; // Executes querySelectorAll on a given node. querySelectorAll(params: QuerySelectorAllMethodArguments): { nodeIds: NodeId[] }; // Sets node name for a node with given id. setNodeName(params: SetNodeNameMethodArguments): { nodeId: NodeId }; // Sets node value for a node with given id. setNodeValue(params: SetNodeValueMethodArguments): void; // Removes node with given id. removeNode(params: RemoveNodeMethodArguments): void; // Sets attribute for an element with given id. setAttributeValue(params: SetAttributeValueMethodArguments): void; // Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs. setAttributesAsText(params: SetAttributesAsTextMethodArguments): void; // Removes attribute with given name from an element with given id. removeAttribute(params: RemoveAttributeMethodArguments): void; // Returns event listeners relevant to the node. getEventListenersForNode(params: GetEventListenersForNodeMethodArguments): { listeners: EventListener[] }; // Returns a dictionary of accessibility properties for the node. getAccessibilityPropertiesForNode(params: GetAccessibilityPropertiesForNodeMethodArguments): { properties: AccessibilityProperties }; // Returns node's HTML markup. getOuterHTML(params: GetOuterHTMLMethodArguments): { outerHTML: string }; // Sets node HTML markup, returns new node id. setOuterHTML(params: SetOuterHTMLMethodArguments): void; // Searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session. performSearch(params: PerformSearchMethodArguments): { searchId: string, resultCount: number }; // Returns search results from given fromIndex to given toIndex from the sarch with the given identifier. getSearchResults(params: GetSearchResultsMethodArguments): { nodeIds: NodeId[] }; // Discards search results from the session with the given id. getSearchResults should no longer be called for that search. discardSearchResults(params: DiscardSearchResultsMethodArguments): void; // Requests that the node is sent to the caller given the JavaScript node object reference. All nodes that form the path from the node to the root are also sent to the client as a series of setChildNodes notifications. requestNode(params: RequestNodeMethodArguments): { nodeId: NodeId }; // Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspect' command upon element selection. setInspectModeEnabled(params: SetInspectModeEnabledMethodArguments): void; // Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport. highlightRect(params: HighlightRectMethodArguments): void; // Highlights given quad. Coordinates are absolute with respect to the main frame viewport. highlightQuad(params: HighlightQuadMethodArguments): void; // Highlights all DOM nodes that match a given selector. A string containing a CSS selector must be specified. highlightSelector(params: HighlightSelectorMethodArguments): void; // Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified. highlightNode(params: HighlightNodeMethodArguments): void; // Hides DOM node highlight. hideHighlight(): void; // Highlights owner element of the frame with given id. highlightFrame(params: HighlightFrameMethodArguments): void; // Requests that the node is sent to the caller given its path. // FIXME, use XPath pushNodeByPathToFrontend(params: PushNodeByPathToFrontendMethodArguments): { nodeId: NodeId }; // Requests that the node is sent to the caller given its backend node id. pushNodeByBackendIdToFrontend(params: PushNodeByBackendIdToFrontendMethodArguments): { nodeId: NodeId }; // Requests that group of BackendNodeIds is released. releaseBackendNodeIds(params: ReleaseBackendNodeIdsMethodArguments): void; // Resolves JavaScript node object for given node id. resolveNode(params: ResolveNodeMethodArguments): { object: RuntimeDomain.RemoteObject }; // Returns attributes for the specified node. getAttributes(params: GetAttributesMethodArguments): { attributes: string[] }; // Moves node into the new container, places it before the given anchor. moveTo(params: MoveToMethodArguments): { nodeId: NodeId }; // Undoes the last performed action. undo(): void; // Re-does the last undone action. redo(): void; // Marks last undoable state. markUndoableState(): void; // Focuses the given element. focus(params: FocusMethodArguments): void; } export class DOMFrontend { constructor(private dispatchMessage: (message: String) => void) { } // Fired when Document has been totally updated. Node ids are no longer valid. documentUpdated(): void { this.dispatchMessage(JSON.stringify( { "method": "DOM.documentUpdated", "params": { } } )); } // Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids. setChildNodes(parentId: NodeId, nodes: Node[]): void { this.dispatchMessage(JSON.stringify( { "method": "DOM.setChildNodes", "params": { "parentId": parentId, "nodes": nodes } } )); } // Fired when Element's attribute is modified. attributeModified(nodeId: NodeId, name: string, value: string): void { this.dispatchMessage(JSON.stringify( { "method": "DOM.attributeModified", "params": { "nodeId": nodeId, "name": name, "value": value } } )); } // Fired when Element's attribute is removed. attributeRemoved(nodeId: NodeId, name: string): void { this.dispatchMessage(JSON.stringify( { "method": "DOM.attributeRemoved", "params": { "nodeId": nodeId, "name": name } } )); } // Fired when Element's inline style is modified via a CSS property modification. inlineStyleInvalidated(nodeIds: NodeId[]): void { this.dispatchMessage(JSON.stringify( { "method": "DOM.inlineStyleInvalidated", "params": { "nodeIds": nodeIds } } )); } // Mirrors DOMCharacterDataModified event. characterDataModified(nodeId: NodeId, characterData: string): void { this.dispatchMessage(JSON.stringify( { "method": "DOM.characterDataModified", "params": { "nodeId": nodeId, "characterData": characterData } } )); } // Fired when Container's child node count has changed. childNodeCountUpdated(nodeId: NodeId, childNodeCount: number): void { this.dispatchMessage(JSON.stringify( { "method": "DOM.childNodeCountUpdated", "params": { "nodeId": nodeId, "childNodeCount": childNodeCount } } )); } // Mirrors DOMNodeInserted event. childNodeInserted(parentNodeId: NodeId, previousNodeId: NodeId, node: Node): void { this.dispatchMessage(JSON.stringify( { "method": "DOM.childNodeInserted", "params": { "parentNodeId": parentNodeId, "previousNodeId": previousNodeId, "node": node } } )); } // Mirrors DOMNodeRemoved event. childNodeRemoved(parentNodeId: NodeId, nodeId: NodeId): void { this.dispatchMessage(JSON.stringify( { "method": "DOM.childNodeRemoved", "params": { "parentNodeId": parentNodeId, "nodeId": nodeId } } )); } // Called when shadow root is pushed into the element. shadowRootPushed(hostId: NodeId, root: Node): void { this.dispatchMessage(JSON.stringify( { "method": "DOM.shadowRootPushed", "params": { "hostId": hostId, "root": root } } )); } // Called when shadow root is popped from the element. shadowRootPopped(hostId: NodeId, rootId: NodeId): void { this.dispatchMessage(JSON.stringify( { "method": "DOM.shadowRootPopped", "params": { "hostId": hostId, "rootId": rootId } } )); } } } // DOMDebugger // 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. export namespace DOMDebuggerDomain { export const enum DOMBreakpointType { SubtreeModified, AttributeModified, NodeRemoved }; export interface SetDOMBreakpointMethodArguments { // Identifier of the node to set breakpoint on. nodeId: DOMDomain.NodeId, // Type of the operation to stop upon. type: DOMBreakpointType } export interface RemoveDOMBreakpointMethodArguments { // Identifier of the node to remove breakpoint from. nodeId: DOMDomain.NodeId, // Type of the breakpoint to remove. type: DOMBreakpointType } export interface SetEventListenerBreakpointMethodArguments { // DOM Event name to stop on (any DOM event will do). eventName: string } export interface RemoveEventListenerBreakpointMethodArguments { // Event name. eventName: string } export interface SetInstrumentationBreakpointMethodArguments { // Instrumentation name to stop on. eventName: string } export interface RemoveInstrumentationBreakpointMethodArguments { // Instrumentation name to stop on. eventName: string } export interface SetXHRBreakpointMethodArguments { // Resource URL substring. All XHRs having this substring in the URL will get stopped upon. url: string } export interface RemoveXHRBreakpointMethodArguments { // Resource URL substring. url: string } export interface DOMDebuggerDomainDispatcher { // Sets breakpoint on particular operation with DOM. setDOMBreakpoint(params: SetDOMBreakpointMethodArguments): void; // Removes DOM breakpoint that was set using setDOMBreakpoint. removeDOMBreakpoint(params: RemoveDOMBreakpointMethodArguments): void; // Sets breakpoint on particular DOM event. setEventListenerBreakpoint(params: SetEventListenerBreakpointMethodArguments): void; // Removes breakpoint on particular DOM event. removeEventListenerBreakpoint(params: RemoveEventListenerBreakpointMethodArguments): void; // Sets breakpoint on particular native event. setInstrumentationBreakpoint(params: SetInstrumentationBreakpointMethodArguments): void; // Sets breakpoint on particular native event. removeInstrumentationBreakpoint(params: RemoveInstrumentationBreakpointMethodArguments): void; // Sets breakpoint on XMLHttpRequest. setXHRBreakpoint(params: SetXHRBreakpointMethodArguments): void; // Removes breakpoint from XMLHttpRequest. removeXHRBreakpoint(params: RemoveXHRBreakpointMethodArguments): void; } } // DOMStorage // Query and modify DOM storage. export namespace DOMStorageDomain { export interface StorageId { // Security origin for the storage. securityOrigin: string; // Whether the storage is local storage (not session storage). isLocalStorage: boolean; } export interface GetDOMStorageItemsMethodArguments { storageId: StorageId } export interface SetDOMStorageItemMethodArguments { storageId: StorageId, key: string, value: string } export interface RemoveDOMStorageItemMethodArguments { storageId: StorageId, key: string } export interface DOMStorageDomainDispatcher { // Enables storage tracking, storage events will now be delivered to the client. enable(): void; // Disables storage tracking, prevents storage events from being sent to the client. disable(): void; getDOMStorageItems(params: GetDOMStorageItemsMethodArguments): { entries: string[][] }; setDOMStorageItem(params: SetDOMStorageItemMethodArguments): void; removeDOMStorageItem(params: RemoveDOMStorageItemMethodArguments): void; } export class DOMStorageFrontend { constructor(private dispatchMessage: (message: String) => void) { } domStorageItemsCleared(storageId: StorageId): void { this.dispatchMessage(JSON.stringify( { "method": "DOMStorage.domStorageItemsCleared", "params": { "storageId": storageId } } )); } domStorageItemRemoved(storageId: StorageId, key: string): void { this.dispatchMessage(JSON.stringify( { "method": "DOMStorage.domStorageItemRemoved", "params": { "storageId": storageId, "key": key } } )); } domStorageItemAdded(storageId: StorageId, key: string, newValue: string): void { this.dispatchMessage(JSON.stringify( { "method": "DOMStorage.domStorageItemAdded", "params": { "storageId": storageId, "key": key, "newValue": newValue } } )); } domStorageItemUpdated(storageId: StorageId, key: string, oldValue: string, newValue: string): void { this.dispatchMessage(JSON.stringify( { "method": "DOMStorage.domStorageItemUpdated", "params": { "storageId": storageId, "key": key, "oldValue": oldValue, "newValue": newValue } } )); } } } // Database export namespace DatabaseDomain { // Unique identifier of Database object. export type DatabaseId = string export interface Database { // Database ID. id: DatabaseId; // Database domain. domain: string; // Database name. name: string; // Database version. version: string; } export interface Error { // Error message. message: string; // Error code. code: number; } export interface GetDatabaseTableNamesMethodArguments { databaseId: DatabaseId } export interface ExecuteSQLMethodArguments { databaseId: DatabaseId, query: string } export interface DatabaseDomainDispatcher { // Enables database tracking, database events will now be delivered to the client. enable(): void; // Disables database tracking, prevents database events from being sent to the client. disable(): void; getDatabaseTableNames(params: GetDatabaseTableNamesMethodArguments): { tableNames: string[] }; executeSQL(params: ExecuteSQLMethodArguments): { columnNames?: string[], values?: any[], sqlError?: Error }; } export class DatabaseFrontend { constructor(private dispatchMessage: (message: String) => void) { } addDatabase(database: Database): void { this.dispatchMessage(JSON.stringify( { "method": "Database.addDatabase", "params": { "database": database } } )); } } } // Debugger // Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc. export namespace DebuggerDomain { // Breakpoint identifier. export type BreakpointId = string // Breakpoint action identifier. export type BreakpointActionIdentifier = number // Unique script identifier. export type ScriptId = string // Call frame identifier. export type CallFrameId = string export interface Location { // Script identifier as reported in the Debugger.scriptParsed. scriptId: ScriptId; // Line number in the script. lineNumber: number; // Column number in the script. columnNumber?: number; } export interface BreakpointAction { // Different kinds of breakpoint actions. type: any /* log,evaluate,sound,probe */; // Data associated with this breakpoint type (e.g. for type "eval" this is the JavaScript string to evalulate). data?: string; // A frontend-assigned identifier for this breakpoint action. id?: BreakpointActionIdentifier; } export interface BreakpointOptions { // Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. condition?: string; // Actions to perform automatically when the breakpoint is triggered. actions?: BreakpointAction[]; // Automatically continue after hitting this breakpoint and running actions. autoContinue?: boolean; } export interface FunctionDetails { // Location of the function. location: Location; // Name of the function. Not present for anonymous functions. name?: string; // Display name of the function(specified in 'displayName' property on the function object). displayName?: string; // Name of the function inferred from its initial assignment. inferredName?: string; // Scope chain for this closure. scopeChain?: Scope[]; } export interface CallFrame { // Call frame identifier. This identifier is only valid while the virtual machine is paused. callFrameId: CallFrameId; // Name of the JavaScript function called on this call frame. functionName: string; // Location in the source code. location: Location; // Scope chain for this call frame. scopeChain: Scope[]; // this object for this call frame. this: RuntimeDomain.RemoteObject; } export interface Scope { // Scope type. type: any /* global,local,with,closure,catch,functionName */; // Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. object: RuntimeDomain.RemoteObject; } export interface ProbeSample { // Identifier of the probe breakpoint action that created the sample. probeId: BreakpointActionIdentifier; // Unique identifier for this sample. sampleId: number; // A batch identifier which is the same for all samples taken at the same breakpoint hit. batchId: number; // Timestamp of when the sample was taken. timestamp: number; // Contents of the sample. payload: RuntimeDomain.RemoteObject; } export interface AssertPauseReason { // The console.assert message string if provided. message?: string; } export interface BreakpointPauseReason { // The identifier of the breakpoint causing the pause. breakpointId: string; } export interface CSPViolationPauseReason { // The CSP directive that blocked script execution. directive: string; } export interface SetBreakpointsActiveMethodArguments { // New value for breakpoints active state. active: boolean } export interface SetBreakpointByUrlMethodArguments { // Line number to set breakpoint at. lineNumber: number, // URL of the resources to set breakpoint on. url?: string, // Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. urlRegex?: string, // Offset in the line to set breakpoint at. columnNumber?: number, // Options to apply to this breakpoint to modify its behavior. options?: BreakpointOptions } export interface SetBreakpointMethodArguments { // Location to set breakpoint in. location: Location, // Options to apply to this breakpoint to modify its behavior. options?: BreakpointOptions } export interface RemoveBreakpointMethodArguments { breakpointId: BreakpointId } export interface ContinueToLocationMethodArguments { // Location to continue to. location: Location } export interface SearchInContentMethodArguments { // Id of the script to search in. scriptId: ScriptId, // String to search for. query: string, // If true, search is case sensitive. caseSensitive?: boolean, // If true, treats string parameter as regex. isRegex?: boolean } export interface GetScriptSourceMethodArguments { // Id of the script to get source for. scriptId: ScriptId } export interface GetFunctionDetailsMethodArguments { // Id of the function to get location for. functionId: RuntimeDomain.RemoteObjectId } export interface SetPauseOnExceptionsMethodArguments { // Pause on exceptions mode. state: any /* none,uncaught,all */ } export interface EvaluateOnCallFrameMethodArguments { // Call frame identifier to evaluate on. callFrameId: CallFrameId, // Expression to evaluate. expression: string, // String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). objectGroup?: string, // Specifies whether command line API should be available to the evaluated expression, defaults to false. includeCommandLineAPI?: boolean, // Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state. doNotPauseOnExceptionsAndMuteConsole?: boolean, // Whether the result is expected to be a JSON object that should be sent by value. returnByValue?: boolean, // Whether preview should be generated for the result. generatePreview?: boolean, // Whether the resulting value should be considered for saving in the $n history. saveResult?: boolean } export interface SetOverlayMessageMethodArguments { // Overlay message to display when paused in debugger. message?: string } export interface DebuggerDomainDispatcher { // Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. enable(): void; // Disables debugger for given page. disable(): void; // Activates / deactivates all breakpoints on the page. setBreakpointsActive(params: SetBreakpointsActiveMethodArguments): void; // Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. setBreakpointByUrl(params: SetBreakpointByUrlMethodArguments): { breakpointId: BreakpointId, locations: Location[] }; // Sets JavaScript breakpoint at a given location. setBreakpoint(params: SetBreakpointMethodArguments): { breakpointId: BreakpointId, actualLocation: Location }; // Removes JavaScript breakpoint. removeBreakpoint(params: RemoveBreakpointMethodArguments): void; // Continues execution until specific location is reached. continueToLocation(params: ContinueToLocationMethodArguments): void; // Steps over the statement. stepOver(): void; // Steps into the function call. stepInto(): void; // Steps out of the function call. stepOut(): void; // Stops on the next JavaScript statement. pause(): void; // Resumes JavaScript execution. resume(): void; // Searches for given string in script content. searchInContent(params: SearchInContentMethodArguments): { result: GenericTypesDomain.SearchMatch[] }; // Returns source for the script with given id. getScriptSource(params: GetScriptSourceMethodArguments): { scriptSource: string }; // Returns detailed information on given function. getFunctionDetails(params: GetFunctionDetailsMethodArguments): { details: FunctionDetails }; // Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. setPauseOnExceptions(params: SetPauseOnExceptionsMethodArguments): void; // Evaluates expression on a given call frame. evaluateOnCallFrame(params: EvaluateOnCallFrameMethodArguments): { result: RuntimeDomain.RemoteObject, wasThrown?: boolean, savedResultIndex?: number }; // Sets overlay message. setOverlayMessage(params: SetOverlayMessageMethodArguments): void; } export class DebuggerFrontend { constructor(private dispatchMessage: (message: String) => void) { } // Called when global has been cleared and debugger client should reset its state. Happens upon navigation or reload. globalObjectCleared(): void { this.dispatchMessage(JSON.stringify( { "method": "Debugger.globalObjectCleared", "params": { } } )); } // Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. scriptParsed(scriptId: ScriptId, url: string, startLine: number, startColumn: number, endLine: number, endColumn: number, isContentScript?: boolean, sourceMapURL?: string, hasSourceURL?: boolean): void { this.dispatchMessage(JSON.stringify( { "method": "Debugger.scriptParsed", "params": { "scriptId": scriptId, "url": url, "startLine": startLine, "startColumn": startColumn, "endLine": endLine, "endColumn": endColumn, "isContentScript": isContentScript, "sourceMapURL": sourceMapURL, "hasSourceURL": hasSourceURL } } )); } // Fired when virtual machine fails to parse the script. scriptFailedToParse(url: string, scriptSource: string, startLine: number, errorLine: number, errorMessage: string): void { this.dispatchMessage(JSON.stringify( { "method": "Debugger.scriptFailedToParse", "params": { "url": url, "scriptSource": scriptSource, "startLine": startLine, "errorLine": errorLine, "errorMessage": errorMessage } } )); } // Fired when breakpoint is resolved to an actual script and location. breakpointResolved(breakpointId: BreakpointId, location: Location): void { this.dispatchMessage(JSON.stringify( { "method": "Debugger.breakpointResolved", "params": { "breakpointId": breakpointId, "location": location } } )); } // Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. paused(callFrames: CallFrame[], reason: any /* XHR,DOM,EventListener,exception,assert,CSPViolation,DebuggerStatement,Breakpoint,PauseOnNextStatement,other */, data?: Object): void { this.dispatchMessage(JSON.stringify( { "method": "Debugger.paused", "params": { "callFrames": callFrames, "reason": reason, "data": data } } )); } // Fired when the virtual machine resumed execution. resumed(): void { this.dispatchMessage(JSON.stringify( { "method": "Debugger.resumed", "params": { } } )); } // Fires when a new probe sample is collected. didSampleProbe(sample: ProbeSample): void { this.dispatchMessage(JSON.stringify( { "method": "Debugger.didSampleProbe", "params": { "sample": sample } } )); } // Fired when a "sound" breakpoint action is triggered on a breakpoint. playBreakpointActionSound(breakpointActionId: BreakpointActionIdentifier): void { this.dispatchMessage(JSON.stringify( { "method": "Debugger.playBreakpointActionSound", "params": { "breakpointActionId": breakpointActionId } } )); } } } // GenericTypes // Exposes generic types to be used by any domain. export namespace GenericTypesDomain { export interface SearchMatch { // Line number in resource content. lineNumber: number; // Line with match content. lineContent: string; } } // IndexedDB export namespace IndexedDBDomain { export interface DatabaseWithObjectStores { // Database name. name: string; // Database version. version: number; // Object stores in this database. objectStores: ObjectStore[]; } export interface ObjectStore { // Object store name. name: string; // Object store key path. keyPath: KeyPath; // If true, object store has auto increment flag set. autoIncrement: boolean; // Indexes in this object store. indexes: ObjectStoreIndex[]; } export interface ObjectStoreIndex { // Index name. name: string; // Index key path. keyPath: KeyPath; // If true, index is unique. unique: boolean; // If true, index allows multiple entries for a key. multiEntry: boolean; } export interface Key { // Key type. type: any /* number,string,date,array */; // Number value. number?: number; // String value. string?: string; // Date value. date?: number; // Array value. array?: Key[]; } export interface KeyRange { // Lower bound. lower?: Key; // Upper bound. upper?: Key; // If true lower bound is open. lowerOpen: boolean; // If true upper bound is open. upperOpen: boolean; } export interface DataEntry { // Key. key: RuntimeDomain.RemoteObject; // Primary key. primaryKey: RuntimeDomain.RemoteObject; // Value. value: RuntimeDomain.RemoteObject; } export interface KeyPath { // Key path type. type: any /* null,string,array */; // String value. string?: string; // Array value. array?: string[]; } export interface RequestDatabaseNamesMethodArguments { // Security origin. securityOrigin: string } export interface RequestDatabaseMethodArguments { // Security origin. securityOrigin: string, // Database name. databaseName: string } export interface RequestDataMethodArguments { // Security origin. securityOrigin: string, // Database name. databaseName: string, // Object store name. objectStoreName: string, // Index name, empty string for object store data requests. indexName: string, // Number of records to skip. skipCount: number, // Number of records to fetch. pageSize: number, // Key range. keyRange?: KeyRange } export interface ClearObjectStoreMethodArguments { // Security origin. securityOrigin: string, // Database name. databaseName: string, // Object store name. objectStoreName: string } export interface IndexedDBDomainDispatcher { // Enables events from backend. enable(): void; // Disables events from backend. disable(): void; // Requests database names for given security origin. requestDatabaseNames(params: RequestDatabaseNamesMethodArguments): { databaseNames: string[] }; // Requests database with given name in given frame. requestDatabase(params: RequestDatabaseMethodArguments): { databaseWithObjectStores: DatabaseWithObjectStores }; // Requests data from object store or index. requestData(params: RequestDataMethodArguments): { objectStoreDataEntries: DataEntry[], hasMore: boolean }; // Clears all entries from an object store. clearObjectStore(params: ClearObjectStoreMethodArguments): void; } } // Inspector export namespace InspectorDomain { export interface InspectorDomainDispatcher { // Enables inspector domain notifications. enable(): void; // Disables inspector domain notifications. disable(): void; // Sent by the frontend after all initialization messages have been sent. initialized(): void; } export class InspectorFrontend { constructor(private dispatchMessage: (message: String) => void) { } evaluateForTestInFrontend(script: string): void { this.dispatchMessage(JSON.stringify( { "method": "Inspector.evaluateForTestInFrontend", "params": { "script": script } } )); } inspect(object: RuntimeDomain.RemoteObject, hints: Object): void { this.dispatchMessage(JSON.stringify( { "method": "Inspector.inspect", "params": { "object": object, "hints": hints } } )); } // Fired when remote debugging connection is about to be terminated. Contains detach reason. detached(reason: string): void { this.dispatchMessage(JSON.stringify( { "method": "Inspector.detached", "params": { "reason": reason } } )); } // Fired when the backend has alternate domains that need to be activated. activateExtraDomains(domains: string[]): void { this.dispatchMessage(JSON.stringify( { "method": "Inspector.activateExtraDomains", "params": { "domains": domains } } )); } // Fired when debugging target has crashed targetCrashed(): void { this.dispatchMessage(JSON.stringify( { "method": "Inspector.targetCrashed", "params": { } } )); } } } // LayerTree export namespace LayerTreeDomain { // Unique RenderLayer identifier. export type LayerId = string // Unique PseudoElement identifier. export type PseudoElementId = string export interface IntRect { // The x position. x: number; // The y position. y: number; // The width metric. width: number; // The height metric. height: number; } export interface Layer { // The unique id for this layer. layerId: LayerId; // The id for the node associated with this layer. nodeId: DOMDomain.NodeId; // Bounds of the layer in absolute page coordinates. bounds: IntRect; // Indicates how many time this layer has painted. paintCount: number; // Estimated memory used by this layer. memory: number; // The bounds of the composited layer. compositedBounds: IntRect; // Indicates whether this layer is associated with an element hosted in a shadow tree. isInShadowTree?: boolean; // Indicates whether this layer was used to provide a reflection for the element. isReflection?: boolean; // Indicates whether the layer is attached to a pseudo element that is CSS generated content. isGeneratedContent?: boolean; // Indicates whether the layer was created for a CSS anonymous block or box. isAnonymous?: boolean; // The id for the pseudo element associated with this layer. pseudoElementId?: PseudoElementId; // The name of the CSS pseudo-element that prompted the layer to be generated. pseudoElement?: string; } export interface CompositingReasons { // Composition due to association with an element with a CSS 3D transform. transform3D?: boolean; // Composition due to association with a