src/LiveDevelopment/Inspector/inspector.html
Type
Command
Event
Type
Command
Event
Type
Command
Event
Type
Command
Event
Type
Command
Event
Type
Command
Type
Command
Event
Type
Command
Event
Type
Command
Event
Type
Command
Type
Command
Event
Type
Command
Type
Command
Command
Event
Type
Command
Event
Type
Command
Event
Type
Command
Event
Type
Command
Event
Type
Command
Event
Type
Command
Event
Type
Command
Event
Command
Event
Command
Event
Type
Command
Event
Detailed application cache resource information.
urlString Resource url.sizeInteger Resource size.typeString Resource type.
Detailed application cache information.
manifestURLString Manifest URL.sizeNumber Application cache size.creationTimeNumber Application cache creation time.updateTimeNumber Application cache update time.resources[ApplicationCache.ApplicationCacheResource] Application cache resources.
Frame identifier - manifest URL pair.
frameIdPage.FrameId Frame identifier.manifestURLString Manifest URL.statusInteger Application cache status.
Returns array of frame identifiers with manifest urls for each frame containing a document associated with some application cache.
frameIds[ApplicationCache.FrameWithManifest] Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache.
// WebInspector Command: ApplicationCache.getFramesWithManifests
ApplicationCache.getFramesWithManifests(function callback(res) {
// res = {frameIds}
});
Enables application cache domain notifications.
// WebInspector Command: ApplicationCache.enable
ApplicationCache.enable();
Returns manifest URL for document in the given frame.
frameIdPage.FrameId Identifier of the frame containing document whose manifest is retrieved.
manifestURLString Manifest URL for document in the given frame.
// WebInspector Command: ApplicationCache.getManifestForFrame
ApplicationCache.getManifestForFrame(frameId, function callback(res) {
// res = {manifestURL}
});
Returns relevant application cache data for the document in given frame.
frameIdPage.FrameId Identifier of the frame containing document whose application cache is retrieved.
applicationCacheApplicationCache.ApplicationCache Relevant application cache data for the document in given frame.
// WebInspector Command: ApplicationCache.getApplicationCacheForFrame
ApplicationCache.getApplicationCacheForFrame(frameId, function callback(res) {
// res = {applicationCache}
});
frameIdPage.FrameId Identifier of the frame containing document whose application cache updated status.manifestURLString Manifest URL.statusInteger Updated application cache status.
// WebInspector Event: ApplicationCache.applicationCacheStatusUpdated
function onApplicationCacheStatusUpdated(res) {
// res = {frameId, manifestURL, status}
}
isNowOnlineBoolean
// WebInspector Event: ApplicationCache.networkStateUpdated
function onNetworkStateUpdated(res) {
// res = {isNowOnline}
}
This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) have an associated id used in subsequent operations on the related object. Each object type has a specific id structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the get*ForNode() calls (which accept a DOM node id). A client can also discover all the existing stylesheets with the getAllStyleSheets() method (or keeping track of the styleSheetAdded/styleSheetRemoved events) and subsequently load the required stylesheet contents using the getStyleSheetText methods.
Type
Command
Event
String
This object identifies a CSS style in a unique way.
styleSheetIdCSS.StyleSheetId Enclosing stylesheet identifier.ordinalInteger The style ordinal within the stylesheet.
Stylesheet type: "user" for user stylesheets, "user-agent" for user-agent stylesheets, "inspector" for stylesheets created by the inspector (i.e. those holding the "via inspector" rules), "regular" for regular stylesheets.
( user | user-agent | inspector | regular )
This object identifies a CSS rule in a unique way.
styleSheetIdCSS.StyleSheetId Enclosing stylesheet identifier.ordinalInteger The rule ordinal within the stylesheet.
CSS rule collection for a single pseudo style.
pseudoIdInteger Pseudo style identifier (see enum PseudoId in RenderStyleConstants.h).matches[CSS.RuleMatch] Matches of CSS rules applicable to the pseudo style.
CSS rule collection for a single pseudo style.
inlineStyle (optional)CSS.CSSStyle The ancestor node's inline style, if any, in the style inheritance chain.matchedCSSRules[CSS.RuleMatch] Matches of CSS rules matching the ancestor node in the style inheritance chain.
Match data for a CSS rule.
ruleCSS.CSSRule CSS rule in the match.matchingSelectors[Integer] Matching selector indices in the rule's selectorList selectors (0-based).
Selector list data.
selectors[String] Selectors in the list.textString Rule selector text.range (optional)CSS.SourceRange Rule selector range in the underlying resource (if available).
CSS style information for a DOM style attribute.
nameString DOM attribute name (e.g. "width").styleCSS.CSSStyle CSS style generated by the respective DOM attribute.
CSS stylesheet metainformation.
styleSheetIdCSS.StyleSheetId The stylesheet identifier.frameIdPage.FrameId Owner frame identifier.sourceURLString Stylesheet resource URL.sourceMapURL (optional)String URL of source map associated with the stylesheet (if any).originCSS.StyleSheetOrigin Stylesheet origin.titleString Stylesheet title.disabledBoolean Denotes whether the stylesheet is disabled.hasSourceURL (optional)Boolean Whether the sourceURL field value comes from the sourceURL comment.isInlineBoolean Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags.startLineNumber Line offset of the stylesheet within the resource (zero based).startColumnNumber Column offset of the stylesheet within the resource (zero based).
CSS stylesheet contents.
styleSheetIdCSS.StyleSheetId The stylesheet identifier.rules[CSS.CSSRule] Stylesheet resource URL.text (optional)String Stylesheet resource contents (if available).
CSS rule representation.
ruleId (optional)CSS.CSSRuleId The CSS rule identifier (absent for user agent stylesheet and user-specified stylesheet rules).selectorListCSS.SelectorList Rule selector data.sourceURL (optional)String Parent stylesheet resource URL (for regular rules).originCSS.StyleSheetOrigin Parent stylesheet's origin.styleCSS.CSSStyle Associated style declaration.media (optional)[CSS.CSSMedia] Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards.
Text range within a resource. All numbers are zero-based.
startLineInteger Start line of range.startColumnInteger Start column of range (inclusive).endLineInteger End line of rangeendColumnInteger End column of range (exclusive).
nameString Shorthand name.valueString Shorthand value.
nameString Property name.longhands (optional)[String] Longhand property names.
nameString Computed style property name.valueString Computed style property value.
CSS style representation.
styleId (optional)CSS.CSSStyleId The CSS style identifier (absent for attribute styles).cssProperties[CSS.CSSProperty] CSS properties in the style.shorthandEntries[CSS.ShorthandEntry] Computed values for all shorthands found in the style.cssText (optional)String Style declaration text (if available).range (optional)CSS.SourceRange Style declaration range in the enclosing stylesheet (if available).width (optional)String The effective "width" property value from this style.height (optional)String The effective "height" property value from this style.
CSS property declaration data.
nameString The property name.valueString The property value.priority (optional)String The property priority (implies "" if absent).implicit (optional)Boolean Whether the property is implicit (implies false if absent).text (optional)String The full property text as specified in the style.parsedOk (optional)Boolean Whether the property is understood by the browser (implies true if absent).status (optional)( active | inactive | disabled | style ) The property status: "active" if the property is effective in the style, "inactive" if the property is overridden by a same-named property in this style later on, "disabled" if the property is disabled by the user, "style" (implied if absent) if the property is reported by the browser rather than by the CSS source parser.range (optional)CSS.SourceRange The entire property range in the enclosing style declaration (if available).
CSS media query descriptor.
textString Media query text.source( mediaRule | importRule | linkedSheet | inlineSheet ) 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.sourceURL (optional)String URL of the document containing the media query description.range (optional)CSS.SourceRange The associated rule (@media or @import) header range in the enclosing stylesheet (if available).parentStyleSheetId (optional)CSS.StyleSheetId Identifier of the stylesheet containing this object (if exists).
CSS selector profile entry.
selectorString CSS selector of the corresponding rule.urlString URL of the resource containing the corresponding rule.lineNumberInteger Selector line number in the resource for the corresponding rule.timeNumber Total time this rule handling contributed to the browser running time during profiling (in milliseconds).hitCountInteger Number of times this rule was considered a candidate for matching against DOM elements.matchCountInteger Number of times this rule actually matched a DOM element.
totalTimeNumber Total processing time for all selectors in the profile (in milliseconds).data[CSS.SelectorProfileEntry] CSS selector profile entries.
This object represents a region that flows from a Named Flow.
regionOverset( overset | fit | empty ) The "overset" attribute of a Named Flow.nodeIdDOM.NodeId The corresponding DOM node id.
This object represents a Named Flow.
documentNodeIdDOM.NodeId The document node id.nameString Named Flow identifier.oversetBoolean The "overset" attribute of a Named Flow.content[DOM.NodeId] An array of nodes that flow into the Named Flow.regions[CSS.Region] An array of regions associated with the Named Flow.
Information about amount of glyphs that were rendered with given font.
familyNameString Font's family name reported by platform.glyphCountNumber Amount of glyphs that were rendered with this font.
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.
// WebInspector Command: CSS.enable
CSS.enable();
Disables the CSS agent for the given page.
// WebInspector Command: CSS.disable
CSS.disable();
Returns requested styles for a DOM node identified by nodeId.
nodeIdDOM.NodeIdincludePseudo (optional)Boolean Whether to include pseudo styles (default: true).includeInherited (optional)Boolean Whether to include inherited styles (default: true).
matchedCSSRules (optional)[CSS.RuleMatch] CSS rules matching this node, from all applicable stylesheets.pseudoElements (optional)[CSS.PseudoIdMatches] Pseudo style matches for this node.inherited (optional)[CSS.InheritedStyleEntry] A chain of inherited styles (from the immediate node parent up to the DOM tree root).
// WebInspector Command: CSS.getMatchedStylesForNode
CSS.getMatchedStylesForNode(nodeId, includePseudo, includeInherited, function callback(res) {
// res = {matchedCSSRules, pseudoElements, inherited}
});
Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId.
nodeIdDOM.NodeId
inlineStyle (optional)CSS.CSSStyle Inline style for the specified DOM node.attributesStyle (optional)CSS.CSSStyle Attribute-defined element style (e.g. resulting from "width=20 height=100%").
// WebInspector Command: CSS.getInlineStylesForNode
CSS.getInlineStylesForNode(nodeId, function callback(res) {
// res = {inlineStyle, attributesStyle}
});
Returns the computed style for a DOM node identified by nodeId.
nodeIdDOM.NodeId
computedStyle[CSS.CSSComputedStyleProperty] Computed style for the specified DOM node.
// WebInspector Command: CSS.getComputedStyleForNode
CSS.getComputedStyleForNode(nodeId, function callback(res) {
// res = {computedStyle}
});
Requests information about platform fonts which we used to render child TextNodes in the given node.
nodeIdDOM.NodeId
cssFamilyNameString Font family name which is determined by computed style.fonts[CSS.PlatformFontUsage] Usage statistics for every employed platform font.
// WebInspector Command: CSS.getPlatformFontsForNode
CSS.getPlatformFontsForNode(nodeId, function callback(res) {
// res = {cssFamilyName, fonts}
});
Returns metainfo entries for all known stylesheets.
headers[CSS.CSSStyleSheetHeader] Descriptor entries for all available stylesheets.
// WebInspector Command: CSS.getAllStyleSheets
CSS.getAllStyleSheets(function callback(res) {
// res = {headers}
});
Returns stylesheet data for the specified styleSheetId.
styleSheetIdCSS.StyleSheetId
styleSheetCSS.CSSStyleSheetBody Stylesheet contents for the specified styleSheetId.
// WebInspector Command: CSS.getStyleSheet
CSS.getStyleSheet(styleSheetId, function callback(res) {
// res = {styleSheet}
});
Returns the current textual content and the URL for a stylesheet.
styleSheetIdCSS.StyleSheetId
textString The stylesheet text.
// WebInspector Command: CSS.getStyleSheetText
CSS.getStyleSheetText(styleSheetId, function callback(res) {
// res = {text}
});
Sets the new stylesheet text, thereby invalidating all existing CSSStyleId's and CSSRuleId's contained by this stylesheet.
styleSheetIdCSS.StyleSheetIdtextString
// WebInspector Command: CSS.setStyleSheetText
CSS.setStyleSheetText(styleSheetId, text);
Updates the CSSStyleDeclaration text.
styleIdCSS.CSSStyleIdtextString
styleCSS.CSSStyle The resulting style after the text modification.
// WebInspector Command: CSS.setStyleText
CSS.setStyleText(styleId, text, function callback(res) {
// res = {style}
});
Sets the new text for a property in the respective style, at offset propertyIndex. If overwrite is true, a property at the given offset is overwritten, otherwise inserted. text entirely replaces the property name: value.
styleIdCSS.CSSStyleIdpropertyIndexIntegertextStringoverwriteBoolean
styleCSS.CSSStyle The resulting style after the property text modification.
// WebInspector Command: CSS.setPropertyText
CSS.setPropertyText(styleId, propertyIndex, text, overwrite, function callback(res) {
// res = {style}
});
Toggles the property in the respective style, at offset propertyIndex. The disable parameter denotes whether the property should be disabled (i.e. removed from the style declaration). If disable == false, the property gets put back into its original place in the style declaration.
styleIdCSS.CSSStyleIdpropertyIndexIntegerdisableBoolean
styleCSS.CSSStyle The resulting style after the property toggling.
// WebInspector Command: CSS.toggleProperty
CSS.toggleProperty(styleId, propertyIndex, disable, function callback(res) {
// res = {style}
});
Modifies the rule selector.
ruleIdCSS.CSSRuleIdselectorString
ruleCSS.CSSRule The resulting rule after the selector modification.
// WebInspector Command: CSS.setRuleSelector
CSS.setRuleSelector(ruleId, selector, function callback(res) {
// res = {rule}
});
Creates a new empty rule with the given selector in a special "inspector" stylesheet in the owner document of the context node.
contextNodeIdDOM.NodeIdselectorString
ruleCSS.CSSRule The newly created rule.
// WebInspector Command: CSS.addRule
CSS.addRule(contextNodeId, selector, function callback(res) {
// res = {rule}
});
Returns all supported CSS property names.
cssProperties[CSS.CSSPropertyInfo] Supported property metainfo.
// WebInspector Command: CSS.getSupportedCSSProperties
CSS.getSupportedCSSProperties(function callback(res) {
// res = {cssProperties}
});
Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.
nodeIdDOM.NodeId The element id for which to force the pseudo state.forcedPseudoClasses[( active | focus | hover | visited )] Element pseudo classes to force when computing the element's style.
// WebInspector Command: CSS.forcePseudoState
CSS.forcePseudoState(nodeId, forcedPseudoClasses);
Returns the Named Flows from the document.
documentNodeIdDOM.NodeId The document node id for which to get the Named Flow Collection.
namedFlows[CSS.NamedFlow] An array containing the Named Flows in the document.
// WebInspector Command: CSS.getNamedFlowCollection
CSS.getNamedFlowCollection(documentNodeId, function callback(res) {
// res = {namedFlows}
});
Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features.
// WebInspector Event: CSS.mediaQueryResultChanged
function onMediaQueryResultChanged(res) {
// res = {}
}
Fired whenever a stylesheet is changed as a result of the client operation.
styleSheetIdCSS.StyleSheetId
// WebInspector Event: CSS.styleSheetChanged
function onStyleSheetChanged(res) {
// res = {styleSheetId}
}
Fired whenever an active document stylesheet is added.
headerCSS.CSSStyleSheetHeader Added stylesheet metainfo.
// WebInspector Event: CSS.styleSheetAdded
function onStyleSheetAdded(res) {
// res = {header}
}
Fired whenever an active document stylesheet is removed.
styleSheetIdCSS.StyleSheetId Identifier of the removed stylesheet.
// WebInspector Event: CSS.styleSheetRemoved
function onStyleSheetRemoved(res) {
// res = {styleSheetId}
}
Fires when a Named Flow is created.
namedFlowCSS.NamedFlow The new Named Flow.
// WebInspector Event: CSS.namedFlowCreated
function onNamedFlowCreated(res) {
// res = {namedFlow}
}
Fires when a Named Flow is removed: has no associated content nodes and regions.
documentNodeIdDOM.NodeId The document node id.flowNameString Identifier of the removed Named Flow.
// WebInspector Event: CSS.namedFlowRemoved
function onNamedFlowRemoved(res) {
// res = {documentNodeId, flowName}
}
Fires when a Named Flow's layout may have changed.
namedFlowCSS.NamedFlow The Named Flow whose layout may have changed.
// WebInspector Event: CSS.regionLayoutUpdated
function onRegionLayoutUpdated(res) {
// res = {namedFlow}
}
Fires if any of the regionOverset values changed in a Named Flow's region chain.
namedFlowCSS.NamedFlow The Named Flow containing the regions whose regionOverset values changed.
// WebInspector Event: CSS.regionOversetChanged
function onRegionOversetChanged(res) {
// res = {namedFlow}
}
Type
Command
Event
Unique resource identifier.
String
Resource state descriptor.
nameString State name.enumValueForName (optional)String String representation of the enum value, if name stands for an enum.value (optional)Canvas.CallArgument The value associated with the particular state.values (optional)[Canvas.ResourceStateDescriptor] Array of values associated with the particular state. Either value or values will be specified.isArray (optional)Boolean True iff the given values items stand for an array rather than a list of grouped states.
Resource state.
idCanvas.ResourceIdtraceLogIdCanvas.TraceLogIddescriptors (optional)[Canvas.ResourceStateDescriptor] Describes current Resource state.imageURL (optional)String Screenshot image data URL.
descriptionString String representation of the object.enumName (optional)String Enum name, if any, that stands for the value (for example, a WebGL enum name).resourceId (optional)Canvas.ResourceId Resource identifier. Specified for Resource objects only.type (optional)( object | function | undefined | string | number | boolean ) Object type. Specified for non Resource objects only.subtype (optional)( array | null | node | regexp | date ) Object subtype hint. Specified for object type values only.remoteObject (optional)Runtime.RemoteObject The RemoteObject, if requested.
contextIdCanvas.ResourceIdfunctionName (optional)Stringarguments (optional)[Canvas.CallArgument]result (optional)Canvas.CallArgumentisDrawingCall (optional)BooleanisFrameEndCall (optional)Booleanproperty (optional)Stringvalue (optional)Canvas.CallArgumentsourceURL (optional)StringlineNumber (optional)IntegercolumnNumber (optional)Integer
Unique trace log identifier.
String
idCanvas.TraceLogIdcalls[Canvas.Call]contexts[Canvas.CallArgument]startOffsetIntegeraliveBooleantotalAvailableCallsNumber
Enables Canvas inspection.
// WebInspector Command: Canvas.enable
Canvas.enable();
Disables Canvas inspection.
// WebInspector Command: Canvas.disable
Canvas.disable();
traceLogIdCanvas.TraceLogId
// WebInspector Command: Canvas.dropTraceLog
Canvas.dropTraceLog(traceLogId);
Checks if there is any uninstrumented canvas in the inspected page.
resultBoolean
// WebInspector Command: Canvas.hasUninstrumentedCanvases
Canvas.hasUninstrumentedCanvases(function callback(res) {
// res = {result}
});
Starts (or continues) a canvas frame capturing which will be stopped automatically after the next frame is prepared.
frameId (optional)Page.FrameId Identifier of the frame containing document whose canvases are to be captured. If omitted, main frame is assumed.
traceLogIdCanvas.TraceLogId Identifier of the trace log containing captured canvas calls.
// WebInspector Command: Canvas.captureFrame
Canvas.captureFrame(frameId, function callback(res) {
// res = {traceLogId}
});
Starts (or continues) consecutive canvas frames capturing. The capturing is stopped by the corresponding stopCapturing command.
frameId (optional)Page.FrameId Identifier of the frame containing document whose canvases are to be captured. If omitted, main frame is assumed.
traceLogIdCanvas.TraceLogId Identifier of the trace log containing captured canvas calls.
// WebInspector Command: Canvas.startCapturing
Canvas.startCapturing(frameId, function callback(res) {
// res = {traceLogId}
});
traceLogIdCanvas.TraceLogId
// WebInspector Command: Canvas.stopCapturing
Canvas.stopCapturing(traceLogId);
traceLogIdCanvas.TraceLogIdstartOffset (optional)IntegermaxLength (optional)Integer
traceLogCanvas.TraceLog
// WebInspector Command: Canvas.getTraceLog
Canvas.getTraceLog(traceLogId, startOffset, maxLength, function callback(res) {
// res = {traceLog}
});
traceLogIdCanvas.TraceLogIdstepNoInteger Last call index in the trace log to replay (zero based).
resourceStateCanvas.ResourceStatereplayTimeNumber Replay time (in milliseconds).
// WebInspector Command: Canvas.replayTraceLog
Canvas.replayTraceLog(traceLogId, stepNo, function callback(res) {
// res = {resourceState, replayTime}
});
traceLogIdCanvas.TraceLogIdresourceIdCanvas.ResourceId
resourceStateCanvas.ResourceState
// WebInspector Command: Canvas.getResourceState
Canvas.getResourceState(traceLogId, resourceId, function callback(res) {
// res = {resourceState}
});
Evaluates a given trace call argument or its result.
traceLogIdCanvas.TraceLogIdcallIndexInteger Index of the call to evaluate on (zero based).argumentIndexInteger Index of the argument to evaluate (zero based). Provide -1 to evaluate call result.objectGroup (optional)String String object group name to put result into (allows rapid releasing resulting object handles using Runtime.releaseObjectGroup).
result (optional)Runtime.RemoteObject Object wrapper for the evaluation result.resourceState (optional)Canvas.ResourceState State of the Resource object.
// WebInspector Command: Canvas.evaluateTraceLogCallArgument
Canvas.evaluateTraceLogCallArgument(traceLogId, callIndex, argumentIndex, objectGroup, function callback(res) {
// res = {result, resourceState}
});
Fired when a canvas context has been created in the given frame. The context may not be instrumented (see hasUninstrumentedCanvases command).
frameIdPage.FrameId Identifier of the frame containing a canvas with a context.
// WebInspector Event: Canvas.contextCreated
function onContextCreated(res) {
// res = {frameId}
}
Fired when a set of trace logs were removed from the backend. If no parameters are given, all trace logs were removed.
frameId (optional)Page.FrameId If given, trace logs from the given frame were removed.traceLogId (optional)Canvas.TraceLogId If given, trace log with the given ID was removed.
// WebInspector Event: Canvas.traceLogsRemoved
function onTraceLogsRemoved(res) {
// res = {frameId, traceLogId}
}
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.
Type
Command
Event
Number of seconds since epoch.
Number
Console message.
source( xml | javascript | network | console-api | storage | appcache | rendering | css | security | other | deprecation ) Message source.level( log | warning | error | debug ) Message severity.textString Message text.type (optional)( log | dir | dirxml | table | trace | clear | startGroup | startGroupCollapsed | endGroup | assert | profile | profileEnd ) Console message type.url (optional)String URL of the message origin.line (optional)Integer Line number in the resource that generated this message.column (optional)Integer Column number in the resource that generated this message.repeatCount (optional)Integer Repeat count for repeated messages.parameters (optional)[Runtime.RemoteObject] Message parameters in case of the formatted message.stackTrace (optional)Console.StackTrace JavaScript stack trace for assertions and error messages.networkRequestId (optional)Network.RequestId Identifier of the network request associated with this message.timestampConsole.Timestamp Timestamp, when this message was fired.
Stack entry for console errors and assertions.
functionNameString JavaScript function name.scriptIdString JavaScript script id.urlString JavaScript script name or url.lineNumberInteger JavaScript script line number.columnNumberInteger JavaScript script column number.
Call frames for assertions or error messages.
Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification.
// WebInspector Command: Console.enable
Console.enable();
Disables console domain, prevents further console messages from being reported to the client.
// WebInspector Command: Console.disable
Console.disable();
Clears console messages collected in the browser.
// WebInspector Command: Console.clearMessages
Console.clearMessages();
Toggles monitoring of XMLHttpRequest. If true, console will receive messages upon each XHR issued.
enabledBoolean Monitoring enabled state.
// WebInspector Command: Console.setMonitoringXHREnabled
Console.setMonitoringXHREnabled(enabled);
Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
nodeIdDOM.NodeId DOM node id to be accessible by means of $x command line API.
// WebInspector Command: Console.addInspectedNode
Console.addInspectedNode(nodeId);
heapObjectIdInteger
// WebInspector Command: Console.addInspectedHeapObject
Console.addInspectedHeapObject(heapObjectId);
Issued when new console message is added.
messageConsole.ConsoleMessage Console message that has been added.
// WebInspector Event: Console.messageAdded
function onMessageAdded(res) {
// res = {message}
}
Issued when subsequent message(s) are equal to the previous one(s).
countInteger New repeat count value.timestampConsole.Timestamp Timestamp of most recent message in batch.
// WebInspector Event: Console.messageRepeatCountUpdated
function onMessageRepeatCountUpdated(res) {
// res = {count, timestamp}
}
Issued when console is cleared. This happens either upon clearMessages command or after page navigation.
// WebInspector Event: Console.messagesCleared
function onMessagesCleared(res) {
// res = {}
}
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.
Type
Command
Event
Unique DOM node identifier.
Integer
Unique DOM node identifier used to reference a node that may not have been pushed to the front-end.
Integer
Pseudo element type.
( before | after )
DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
nodeIdDOM.NodeId 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.nodeTypeInteger Node's nodeType.nodeNameString Node's nodeName.localNameString Node's localName.nodeValueString Node's nodeValue.childNodeCount (optional)Integer Child count for Container nodes.children (optional)[DOM.Node] Child nodes of this node when requested with children.attributes (optional)[String] Attributes of the Element node in the form of flat array [name1, value1, name2, value2].documentURL (optional)String Document URL that Document or FrameOwner node points to.baseURL (optional)String Base URL that Document or FrameOwner node uses for URL completion.publicId (optional)String DocumentType's publicId.systemId (optional)String DocumentType's systemId.internalSubset (optional)String DocumentType's internalSubset.xmlVersion (optional)String Document's XML version in case of XML documents.name (optional)String Attr's name.value (optional)String Attr's value.pseudoType (optional)DOM.PseudoType Pseudo element type for this node.frameId (optional)Page.FrameId Frame ID for frame owner elements.contentDocument (optional)DOM.Node Content document for frame owner elements.shadowRoots (optional)[DOM.Node] Shadow root list for given element host.templateContent (optional)DOM.Node Content document fragment for template elements.pseudoElements (optional)[DOM.Node] Pseudo elements associated with this node.
DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
typeString EventListener's type.useCaptureBoolean EventListener's useCapture.isAttributeBoolean EventListener's isAttribute.nodeIdDOM.NodeId Target DOMNode id.handlerBodyString Event handler function body.location (optional)Debugger.Location Handler code location.sourceName (optional)String Source script URL.handler (optional)Runtime.RemoteObject Event handler function value.
A structure holding an RGBA color.
rInteger The red component, in the [0-255] range.gInteger The green component, in the [0-255] range.bInteger The blue component, in the [0-255] range.a (optional)Number The alpha component, in the [0-1] range (default: 1).
An array of quad vertices, x immediately followed by y for each point, points clock-wise.
[Number]
Box model.
contentDOM.Quad Content boxpaddingDOM.Quad Padding boxborderDOM.Quad Border boxmarginDOM.Quad Margin boxwidthInteger Node widthheightInteger Node height
Rectangle.
xNumber X coordinateyNumber Y coordinatewidthNumber Rectangle widthheightNumber Rectangle height
Configuration data for the highlighting of page elements.
showInfo (optional)Boolean Whether the node info tooltip should be shown (default: false).contentColor (optional)DOM.RGBA The content box highlight fill color (default: transparent).paddingColor (optional)DOM.RGBA The padding highlight fill color (default: transparent).borderColor (optional)DOM.RGBA The border highlight fill color (default: transparent).marginColor (optional)DOM.RGBA The margin highlight fill color (default: transparent).eventTargetColor (optional)DOM.RGBA The event target element highlight fill color (default: transparent).
Enables DOM agent for the given page.
// WebInspector Command: DOM.enable
DOM.enable();
Disables DOM agent for the given page.
// WebInspector Command: DOM.disable
DOM.disable();
Returns the root DOM node to the caller.
rootDOM.Node Resulting node.
// WebInspector Command: DOM.getDocument
DOM.getDocument(function callback(res) {
// res = {root}
});
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.
nodeIdDOM.NodeId Id of the node to get children for.depth (optional)Integer 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.
// WebInspector Command: DOM.requestChildNodes
DOM.requestChildNodes(nodeId, depth);
Executes querySelector on a given node.
nodeIdDOM.NodeId Id of the node to query upon.selectorString Selector string.
nodeIdDOM.NodeId Query selector result.
// WebInspector Command: DOM.querySelector
DOM.querySelector(nodeId, selector, function callback(res) {
// res = {nodeId}
});
Executes querySelectorAll on a given node.
nodeIdDOM.NodeId Id of the node to query upon.selectorString Selector string.
nodeIds[DOM.NodeId] Query selector result.
// WebInspector Command: DOM.querySelectorAll
DOM.querySelectorAll(nodeId, selector, function callback(res) {
// res = {nodeIds}
});
Sets node name for a node with given id.
nodeIdDOM.NodeId Id of the node to set name for.nameString New node's name.
nodeIdDOM.NodeId New node's id.
// WebInspector Command: DOM.setNodeName
DOM.setNodeName(nodeId, name, function callback(res) {
// res = {nodeId}
});
Sets node value for a node with given id.
nodeIdDOM.NodeId Id of the node to set value for.valueString New node's value.
// WebInspector Command: DOM.setNodeValue
DOM.setNodeValue(nodeId, value);
Removes node with given id.
nodeIdDOM.NodeId Id of the node to remove.
// WebInspector Command: DOM.removeNode
DOM.removeNode(nodeId);
Sets attribute for an element with given id.
nodeIdDOM.NodeId Id of the element to set attribute for.nameString Attribute name.valueString Attribute value.
// WebInspector Command: DOM.setAttributeValue
DOM.setAttributeValue(nodeId, name, value);
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.
nodeIdDOM.NodeId Id of the element to set attributes for.textString Text with a number of attributes. Will parse this text using HTML parser.name (optional)String Attribute name to replace with new attributes derived from text in case text parsed successfully.
// WebInspector Command: DOM.setAttributesAsText
DOM.setAttributesAsText(nodeId, text, name);
Removes attribute with given name from an element with given id.
nodeIdDOM.NodeId Id of the element to remove attribute from.nameString Name of the attribute to remove.
// WebInspector Command: DOM.removeAttribute
DOM.removeAttribute(nodeId, name);
Returns event listeners relevant to the node.
nodeIdDOM.NodeId Id of the node to get listeners for.objectGroup (optional)String Symbolic group name for handler value. Handler value is not returned without this parameter specified.
listeners[DOM.EventListener] Array of relevant listeners.
// WebInspector Command: DOM.getEventListenersForNode
DOM.getEventListenersForNode(nodeId, objectGroup, function callback(res) {
// res = {listeners}
});
Returns node's HTML markup.
nodeIdDOM.NodeId Id of the node to get markup for.
outerHTMLString Outer HTML markup.
// WebInspector Command: DOM.getOuterHTML
DOM.getOuterHTML(nodeId, function callback(res) {
// res = {outerHTML}
});
Sets node HTML markup, returns new node id.
nodeIdDOM.NodeId Id of the node to set markup for.outerHTMLString Outer HTML markup to set.
// WebInspector Command: DOM.setOuterHTML
DOM.setOuterHTML(nodeId, outerHTML);
Searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.
queryString Plain text or query selector or XPath search query.
searchIdString Unique search session identifier.resultCountInteger Number of search results.
// WebInspector Command: DOM.performSearch
DOM.performSearch(query, function callback(res) {
// res = {searchId, resultCount}
});
Returns search results from given fromIndex to given toIndex from the sarch with the given identifier.
searchIdString Unique search session identifier.fromIndexInteger Start index of the search result to be returned.toIndexInteger End index of the search result to be returned.
nodeIds[DOM.NodeId] Ids of the search result nodes.
// WebInspector Command: DOM.getSearchResults
DOM.getSearchResults(searchId, fromIndex, toIndex, function callback(res) {
// res = {nodeIds}
});
Discards search results from the session with the given id. getSearchResults should no longer be called for that search.
searchIdString Unique search session identifier.
// WebInspector Command: DOM.discardSearchResults
DOM.discardSearchResults(searchId);
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.
objectIdRuntime.RemoteObjectId JavaScript object id to convert into node.
nodeIdDOM.NodeId Node id for given object.
// WebInspector Command: DOM.requestNode
DOM.requestNode(objectId, function callback(res) {
// res = {nodeId}
});
Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection.
enabledBoolean True to enable inspection mode, false to disable it.inspectShadowDOM (optional)Boolean True to enable inspection mode for shadow DOM.highlightConfig (optional)DOM.HighlightConfig A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false.
// WebInspector Command: DOM.setInspectModeEnabled
DOM.setInspectModeEnabled(enabled, inspectShadowDOM, highlightConfig);
Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.
xInteger X coordinateyInteger Y coordinatewidthInteger Rectangle widthheightInteger Rectangle heightcolor (optional)DOM.RGBA The highlight fill color (default: transparent).outlineColor (optional)DOM.RGBA The highlight outline color (default: transparent).
// WebInspector Command: DOM.highlightRect
DOM.highlightRect(x, y, width, height, color, outlineColor);
Highlights given quad. Coordinates are absolute with respect to the main frame viewport.
quadDOM.Quad Quad to highlightcolor (optional)DOM.RGBA The highlight fill color (default: transparent).outlineColor (optional)DOM.RGBA The highlight outline color (default: transparent).
// WebInspector Command: DOM.highlightQuad
DOM.highlightQuad(quad, color, outlineColor);
Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.
highlightConfigDOM.HighlightConfig A descriptor for the highlight appearance.nodeId (optional)DOM.NodeId Identifier of the node to highlight.objectId (optional)Runtime.RemoteObjectId JavaScript object id of the node to be highlighted.
// WebInspector Command: DOM.highlightNode
DOM.highlightNode(highlightConfig, nodeId, objectId);
Hides DOM node highlight.
// WebInspector Command: DOM.hideHighlight
DOM.hideHighlight();
Highlights owner element of the frame with given id.
frameIdPage.FrameId Identifier of the frame to highlight.contentColor (optional)DOM.RGBA The content box highlight fill color (default: transparent).contentOutlineColor (optional)DOM.RGBA The content box highlight outline color (default: transparent).
// WebInspector Command: DOM.highlightFrame
DOM.highlightFrame(frameId, contentColor, contentOutlineColor);
Requests that the node is sent to the caller given its path. // FIXME, use XPath
pathString Path to node in the proprietary format.
nodeIdDOM.NodeId Id of the node for given path.
// WebInspector Command: DOM.pushNodeByPathToFrontend
DOM.pushNodeByPathToFrontend(path, function callback(res) {
// res = {nodeId}
});
Requests that the node is sent to the caller given its backend node id.
backendNodeIdDOM.BackendNodeId The backend node id of the node.
nodeIdDOM.NodeId The pushed node's id.
// WebInspector Command: DOM.pushNodeByBackendIdToFrontend
DOM.pushNodeByBackendIdToFrontend(backendNodeId, function callback(res) {
// res = {nodeId}
});
Requests that group of BackendNodeIds is released.
nodeGroupString The backend node ids group name.
// WebInspector Command: DOM.releaseBackendNodeIds
DOM.releaseBackendNodeIds(nodeGroup);
Resolves JavaScript node object for given node id.
nodeIdDOM.NodeId Id of the node to resolve.objectGroup (optional)String Symbolic group name that can be used to release multiple objects.
objectRuntime.RemoteObject JavaScript object wrapper for given node.
// WebInspector Command: DOM.resolveNode
DOM.resolveNode(nodeId, objectGroup, function callback(res) {
// res = {object}
});
Returns attributes for the specified node.
nodeIdDOM.NodeId Id of the node to retrieve attibutes for.
attributes[String] An interleaved array of node attribute names and values.
// WebInspector Command: DOM.getAttributes
DOM.getAttributes(nodeId, function callback(res) {
// res = {attributes}
});
Moves node into the new container, places it before the given anchor.
nodeIdDOM.NodeId Id of the node to drop.targetNodeIdDOM.NodeId Id of the element to drop into.insertBeforeNodeId (optional)DOM.NodeId Drop node before given one.
nodeIdDOM.NodeId New id of the moved node.
// WebInspector Command: DOM.moveTo
DOM.moveTo(nodeId, targetNodeId, insertBeforeNodeId, function callback(res) {
// res = {nodeId}
});
Undoes the last performed action.
// WebInspector Command: DOM.undo
DOM.undo();
Re-does the last undone action.
// WebInspector Command: DOM.redo
DOM.redo();
Marks last undoable state.
// WebInspector Command: DOM.markUndoableState
DOM.markUndoableState();
Focuses the given element.
nodeIdDOM.NodeId Id of the node to focus.
// WebInspector Command: DOM.focus
DOM.focus(nodeId);
Sets files for the given file input element.
nodeIdDOM.NodeId Id of the file input node to set files for.files[String] Array of file paths to set.
// WebInspector Command: DOM.setFileInputFiles
DOM.setFileInputFiles(nodeId, files);
Returns boxes for the currently selected nodes.
nodeIdDOM.NodeId Id of the node to get box model for.
modelDOM.BoxModel Box model for the node.
// WebInspector Command: DOM.getBoxModel
DOM.getBoxModel(nodeId, function callback(res) {
// res = {model}
});
Returns node id at given location.
xInteger X coordinate.yInteger Y coordinate.
nodeIdDOM.NodeId Id of the node at given coordinates.
// WebInspector Command: DOM.getNodeForLocation
DOM.getNodeForLocation(x, y, function callback(res) {
// res = {nodeId}
});
Fired when Document has been totally updated. Node ids are no longer valid.
// WebInspector Event: DOM.documentUpdated
function onDocumentUpdated(res) {
// res = {}
}
Fired when the node should be inspected. This happens after call to setInspectModeEnabled.
nodeIdDOM.NodeId Id of the node to inspect.
// WebInspector Event: DOM.inspectNodeRequested
function onInspectNodeRequested(res) {
// res = {nodeId}
}
Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.
parentIdDOM.NodeId Parent node id to populate with children.nodes[DOM.Node] Child nodes array.
// WebInspector Event: DOM.setChildNodes
function onSetChildNodes(res) {
// res = {parentId, nodes}
}
Fired when Element's attribute is modified.
nodeIdDOM.NodeId Id of the node that has changed.nameString Attribute name.valueString Attribute value.
// WebInspector Event: DOM.attributeModified
function onAttributeModified(res) {
// res = {nodeId, name, value}
}
Fired when Element's attribute is removed.
nodeIdDOM.NodeId Id of the node that has changed.nameString A ttribute name.
// WebInspector Event: DOM.attributeRemoved
function onAttributeRemoved(res) {
// res = {nodeId, name}
}
Fired when Element's inline style is modified via a CSS property modification.
nodeIds[DOM.NodeId] Ids of the nodes for which the inline styles have been invalidated.
// WebInspector Event: DOM.inlineStyleInvalidated
function onInlineStyleInvalidated(res) {
// res = {nodeIds}
}
Mirrors DOMCharacterDataModified event.
nodeIdDOM.NodeId Id of the node that has changed.characterDataString New text value.
// WebInspector Event: DOM.characterDataModified
function onCharacterDataModified(res) {
// res = {nodeId, characterData}
}
Fired when Container's child node count has changed.
nodeIdDOM.NodeId Id of the node that has changed.childNodeCountInteger New node count.
// WebInspector Event: DOM.childNodeCountUpdated
function onChildNodeCountUpdated(res) {
// res = {nodeId, childNodeCount}
}
Mirrors DOMNodeInserted event.
parentNodeIdDOM.NodeId Id of the node that has changed.previousNodeIdDOM.NodeId If of the previous siblint.nodeDOM.Node Inserted node data.
// WebInspector Event: DOM.childNodeInserted
function onChildNodeInserted(res) {
// res = {parentNodeId, previousNodeId, node}
}
Mirrors DOMNodeRemoved event.
parentNodeIdDOM.NodeId Parent id.nodeIdDOM.NodeId Id of the node that has been removed.
// WebInspector Event: DOM.childNodeRemoved
function onChildNodeRemoved(res) {
// res = {parentNodeId, nodeId}
}
Called when shadow root is pushed into the element.
hostIdDOM.NodeId Host element id.rootDOM.Node Shadow root.
// WebInspector Event: DOM.shadowRootPushed
function onShadowRootPushed(res) {
// res = {hostId, root}
}
Called when shadow root is popped from the element.
hostIdDOM.NodeId Host element id.rootIdDOM.NodeId Shadow root id.
// WebInspector Event: DOM.shadowRootPopped
function onShadowRootPopped(res) {
// res = {hostId, rootId}
}
Called when a pseudo element is added to an element.
parentIdDOM.NodeId Pseudo element's parent element id.pseudoElementDOM.Node The added pseudo element.
// WebInspector Event: DOM.pseudoElementAdded
function onPseudoElementAdded(res) {
// res = {parentId, pseudoElement}
}
Called when a pseudo element is removed from an element.
parentIdDOM.NodeId Pseudo element's parent element id.pseudoElementIdDOM.NodeId The removed pseudo element id.
// WebInspector Event: DOM.pseudoElementRemoved
function onPseudoElementRemoved(res) {
// res = {parentId, pseudoElementId}
}
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.
Type
Command
DOM breakpoint type.
( subtree-modified | attribute-modified | node-removed )
Sets breakpoint on particular operation with DOM.
nodeIdDOM.NodeId Identifier of the node to set breakpoint on.typeDOMDebugger.DOMBreakpointType Type of the operation to stop upon.
// WebInspector Command: DOMDebugger.setDOMBreakpoint
DOMDebugger.setDOMBreakpoint(nodeId, type);
Removes DOM breakpoint that was set using setDOMBreakpoint.
nodeIdDOM.NodeId Identifier of the node to remove breakpoint from.typeDOMDebugger.DOMBreakpointType Type of the breakpoint to remove.
// WebInspector Command: DOMDebugger.removeDOMBreakpoint
DOMDebugger.removeDOMBreakpoint(nodeId, type);
Sets breakpoint on particular DOM event.
eventNameString DOM Event name to stop on (any DOM event will do).
// WebInspector Command: DOMDebugger.setEventListenerBreakpoint
DOMDebugger.setEventListenerBreakpoint(eventName);
Removes breakpoint on particular DOM event.
eventNameString Event name.
// WebInspector Command: DOMDebugger.removeEventListenerBreakpoint
DOMDebugger.removeEventListenerBreakpoint(eventName);
Sets breakpoint on particular native event.
eventNameString Instrumentation name to stop on.
// WebInspector Command: DOMDebugger.setInstrumentationBreakpoint
DOMDebugger.setInstrumentationBreakpoint(eventName);
Removes breakpoint on particular native event.
eventNameString Instrumentation name to stop on.
// WebInspector Command: DOMDebugger.removeInstrumentationBreakpoint
DOMDebugger.removeInstrumentationBreakpoint(eventName);
Sets breakpoint on XMLHttpRequest.
urlString Resource URL substring. All XHRs having this substring in the URL will get stopped upon.
// WebInspector Command: DOMDebugger.setXHRBreakpoint
DOMDebugger.setXHRBreakpoint(url);
Removes breakpoint from XMLHttpRequest.
urlString Resource URL substring.
// WebInspector Command: DOMDebugger.removeXHRBreakpoint
DOMDebugger.removeXHRBreakpoint(url);
Query and modify DOM storage.
Type
Command
Event
DOM Storage identifier.
securityOriginString Security origin for the storage.isLocalStorageBoolean Whether the storage is local storage (not session storage).
DOM Storage item.
[String]
Enables storage tracking, storage events will now be delivered to the client.
// WebInspector Command: DOMStorage.enable
DOMStorage.enable();
Disables storage tracking, prevents storage events from being sent to the client.
// WebInspector Command: DOMStorage.disable
DOMStorage.disable();
storageIdDOMStorage.StorageId
entries[DOMStorage.Item]
// WebInspector Command: DOMStorage.getDOMStorageItems
DOMStorage.getDOMStorageItems(storageId, function callback(res) {
// res = {entries}
});
storageIdDOMStorage.StorageIdkeyStringvalueString
// WebInspector Command: DOMStorage.setDOMStorageItem
DOMStorage.setDOMStorageItem(storageId, key, value);
storageIdDOMStorage.StorageIdkeyString
// WebInspector Command: DOMStorage.removeDOMStorageItem
DOMStorage.removeDOMStorageItem(storageId, key);
storageIdDOMStorage.StorageId
// WebInspector Event: DOMStorage.domStorageItemsCleared
function onDomStorageItemsCleared(res) {
// res = {storageId}
}
storageIdDOMStorage.StorageIdkeyString
// WebInspector Event: DOMStorage.domStorageItemRemoved
function onDomStorageItemRemoved(res) {
// res = {storageId, key}
}
storageIdDOMStorage.StorageIdkeyStringnewValueString
// WebInspector Event: DOMStorage.domStorageItemAdded
function onDomStorageItemAdded(res) {
// res = {storageId, key, newValue}
}
storageIdDOMStorage.StorageIdkeyStringoldValueStringnewValueString
// WebInspector Event: DOMStorage.domStorageItemUpdated
function onDomStorageItemUpdated(res) {
// res = {storageId, key, oldValue, newValue}
}
Type
Command
Event
Unique identifier of Database object.
String
Database object.
idDatabase.DatabaseId Database ID.domainString Database domain.nameString Database name.versionString Database version.
Database error.
messageString Error message.codeInteger Error code.
Enables database tracking, database events will now be delivered to the client.
// WebInspector Command: Database.enable
Database.enable();
Disables database tracking, prevents database events from being sent to the client.
// WebInspector Command: Database.disable
Database.disable();
databaseIdDatabase.DatabaseId
tableNames[String]
// WebInspector Command: Database.getDatabaseTableNames
Database.getDatabaseTableNames(databaseId, function callback(res) {
// res = {tableNames}
});
databaseIdDatabase.DatabaseIdqueryString
columnNames (optional)[String]values (optional)[Any]sqlError (optional)Database.Error
// WebInspector Command: Database.executeSQL
Database.executeSQL(databaseId, query, function callback(res) {
// res = {columnNames, values, sqlError}
});
databaseDatabase.Database
// WebInspector Event: Database.addDatabase
function onAddDatabase(res) {
// res = {database}
}
Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.
Type
Command
Event
Breakpoint identifier.
String
Unique script identifier.
String
Call frame identifier.
String
Location in the source code.
scriptIdDebugger.ScriptId Script identifier as reported in the Debugger.scriptParsed.lineNumberInteger Line number in the script (0-based).columnNumber (optional)Integer Column number in the script (0-based).
Information about the function.
locationDebugger.Location Location of the function.name (optional)String Name of the function. Not present for anonymous functions.displayName (optional)String Display name of the function(specified in 'displayName' property on the function object).inferredName (optional)String Name of the function inferred from its initial assignment.scopeChain (optional)[Debugger.Scope] Scope chain for this closure.
JavaScript call frame. Array of call frames form the call stack.
callFrameIdDebugger.CallFrameId Call frame identifier. This identifier is only valid while the virtual machine is paused.functionNameString Name of the JavaScript function called on this call frame.locationDebugger.Location Location in the source code.scopeChain[Debugger.Scope] Scope chain for this call frame.thisRuntime.RemoteObject this object for this call frame.
Scope description.
type( global | local | with | closure | catch ) Scope type.objectRuntime.RemoteObject 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.
Error data for setScriptSource command. compileError is a case type for uncompilable script source error.
compileError (optional)Object
Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
// WebInspector Command: Debugger.enable
Debugger.enable();
Disables debugger for given page.
// WebInspector Command: Debugger.disable
Debugger.disable();
Activates / deactivates all breakpoints on the page.
activeBoolean New value for breakpoints active state.
// WebInspector Command: Debugger.setBreakpointsActive
Debugger.setBreakpointsActive(active);
Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
skippedBoolean New value for skip pauses state.untilReload (optional)Boolean Whether page reload should set skipped to false.
// WebInspector Command: Debugger.setSkipAllPauses
Debugger.setSkipAllPauses(skipped, untilReload);
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.
lineNumberInteger Line number to set breakpoint at.url (optional)String URL of the resources to set breakpoint on.urlRegex (optional)String Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified.columnNumber (optional)Integer Offset in the line to set breakpoint at.condition (optional)String Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.isAntibreakpoint (optional)Boolean Creates pseudo-breakpoint that prevents debugger from pausing on exception at this location.
breakpointIdDebugger.BreakpointId Id of the created breakpoint for further reference.locations[Debugger.Location] List of the locations this breakpoint resolved into upon addition.
// WebInspector Command: Debugger.setBreakpointByUrl
Debugger.setBreakpointByUrl(lineNumber, url, urlRegex, columnNumber, condition, isAntibreakpoint, function callback(res) {
// res = {breakpointId, locations}
});
Sets JavaScript breakpoint at a given location.
locationDebugger.Location Location to set breakpoint in.condition (optional)String Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
breakpointIdDebugger.BreakpointId Id of the created breakpoint for further reference.actualLocationDebugger.Location Location this breakpoint resolved into.
// WebInspector Command: Debugger.setBreakpoint
Debugger.setBreakpoint(location, condition, function callback(res) {
// res = {breakpointId, actualLocation}
});
Removes JavaScript breakpoint.
breakpointIdDebugger.BreakpointId
// WebInspector Command: Debugger.removeBreakpoint
Debugger.removeBreakpoint(breakpointId);
Continues execution until specific location is reached.
locationDebugger.Location Location to continue to.interstatementLocation (optional)Boolean Allows breakpoints at the intemediate positions inside statements.
// WebInspector Command: Debugger.continueToLocation
Debugger.continueToLocation(location, interstatementLocation);
Steps over the statement.
// WebInspector Command: Debugger.stepOver
Debugger.stepOver();
Steps into the function call.
// WebInspector Command: Debugger.stepInto
Debugger.stepInto();
Steps out of the function call.
// WebInspector Command: Debugger.stepOut
Debugger.stepOut();
Stops on the next JavaScript statement.
// WebInspector Command: Debugger.pause
Debugger.pause();
Resumes JavaScript execution.
// WebInspector Command: Debugger.resume
Debugger.resume();
Searches for given string in script content.
scriptIdDebugger.ScriptId Id of the script to search in.queryString String to search for.caseSensitive (optional)Boolean If true, search is case sensitive.isRegex (optional)Boolean If true, treats string parameter as regex.
result[Page.SearchMatch] List of search matches.
// WebInspector Command: Debugger.searchInContent
Debugger.searchInContent(scriptId, query, caseSensitive, isRegex, function callback(res) {
// res = {result}
});
Always returns true.
resultBoolean True if setScriptSource is supported.
// WebInspector Command: Debugger.canSetScriptSource
Debugger.canSetScriptSource(function callback(res) {
// res = {result}
});
Edits JavaScript source live.
scriptIdDebugger.ScriptId Id of the script to edit.scriptSourceString New content of the script.preview (optional)Boolean If true the change will not actually be applied. Preview mode may be used to get result description without actually modifying the code.
callFrames (optional)[Debugger.CallFrame] New stack trace in case editing has happened while VM was stopped.result (optional)Object VM-specific description of the changes applied.
// WebInspector Command: Debugger.setScriptSource
Debugger.setScriptSource(scriptId, scriptSource, preview, function callback(res) {
// res = {callFrames, result}
});
Restarts particular call frame from the beginning.
callFrameIdDebugger.CallFrameId Call frame identifier to evaluate on.
callFrames[Debugger.CallFrame] New stack trace.resultObject VM-specific description.
// WebInspector Command: Debugger.restartFrame
Debugger.restartFrame(callFrameId, function callback(res) {
// res = {callFrames, result}
});
Returns source for the script with given id.
scriptIdDebugger.ScriptId Id of the script to get source for.
scriptSourceString Script source.
// WebInspector Command: Debugger.getScriptSource
Debugger.getScriptSource(scriptId, function callback(res) {
// res = {scriptSource}
});
Returns detailed informtation on given function.
functionIdRuntime.RemoteObjectId Id of the function to get location for.
detailsDebugger.FunctionDetails Information about the function.
// WebInspector Command: Debugger.getFunctionDetails
Debugger.getFunctionDetails(functionId, function callback(res) {
// res = {details}
});
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.
state( none | uncaught | all ) Pause on exceptions mode.
// WebInspector Command: Debugger.setPauseOnExceptions
Debugger.setPauseOnExceptions(state);
Evaluates expression on a given call frame.
callFrameIdDebugger.CallFrameId Call frame identifier to evaluate on.expressionString Expression to evaluate.objectGroup (optional)String String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup).includeCommandLineAPI (optional)Boolean Specifies whether command line API should be available to the evaluated expression, defaults to false.doNotPauseOnExceptionsAndMuteConsole (optional)Boolean Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state.returnByValue (optional)Boolean Whether the result is expected to be a JSON object that should be sent by value.generatePreview (optional)Boolean Whether preview should be generated for the result.
resultRuntime.RemoteObject Object wrapper for the evaluation result.wasThrown (optional)Boolean True if the result was thrown during the evaluation.
// WebInspector Command: Debugger.evaluateOnCallFrame
Debugger.evaluateOnCallFrame(callFrameId, expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, function callback(res) {
// res = {result, wasThrown}
});
Compiles expression.
expressionString Expression to compile.sourceURLString Source url to be set for the script.
scriptId (optional)Debugger.ScriptId Id of the script.syntaxErrorMessage (optional)String Syntax error message if compilation failed.
// WebInspector Command: Debugger.compileScript
Debugger.compileScript(expression, sourceURL, function callback(res) {
// res = {scriptId, syntaxErrorMessage}
});
Runs script with given id in a given context.
scriptIdDebugger.ScriptId Id of the script to run.contextId (optional)Runtime.ExecutionContextId Specifies in which isolated context to perform script run. Each content script lives in an isolated context and this parameter may be used to specify one of those contexts. If the parameter is omitted or 0 the evaluation will be performed in the context of the inspected page.objectGroup (optional)String Symbolic group name that can be used to release multiple objects.doNotPauseOnExceptionsAndMuteConsole (optional)Boolean Specifies whether script run should stop on exceptions and mute console. Overrides setPauseOnException state.
resultRuntime.RemoteObject Run result.wasThrown (optional)Boolean True if the result was thrown during the script run.
// WebInspector Command: Debugger.runScript
Debugger.runScript(scriptId, contextId, objectGroup, doNotPauseOnExceptionsAndMuteConsole, function callback(res) {
// res = {result, wasThrown}
});
Sets overlay message.
message (optional)String Overlay message to display when paused in debugger.
// WebInspector Command: Debugger.setOverlayMessage
Debugger.setOverlayMessage(message);
Changes value of variable in a callframe or a closure. Either callframe or function must be specified. Object-based scopes are not supported and must be mutated manually.
scopeNumberInteger 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.variableNameString Variable name.newValueRuntime.CallArgument New variable value.callFrameId (optional)Debugger.CallFrameId Id of callframe that holds variable.functionObjectId (optional)Runtime.RemoteObjectId Object id of closure (function) that holds variable.
// WebInspector Command: Debugger.setVariableValue
Debugger.setVariableValue(scopeNumber, variableName, newValue, callFrameId, functionObjectId);
Lists all positions where step-in is possible for a current statement in a specified call frame
callFrameIdDebugger.CallFrameId Id of a call frame where the current statement should be analized
stepInPositions (optional)[Debugger.Location] experimental
// WebInspector Command: Debugger.getStepInPositions
Debugger.getStepInPositions(callFrameId, function callback(res) {
// res = {stepInPositions}
});
Returns call stack including variables changed since VM was paused. VM must be paused.
callFrames[Debugger.CallFrame] Call stack the virtual machine stopped on.
// WebInspector Command: Debugger.getBacktrace
Debugger.getBacktrace(function callback(res) {
// res = {callFrames}
});
Makes backend skip steps in the sources with names matching given pattern. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
script (optional)String Regular expression defining the scripts to ignore while stepping.
// WebInspector Command: Debugger.skipStackFrames
Debugger.skipStackFrames(script);
Called when global has been cleared and debugger client should reset its state. Happens upon navigation or reload.
// WebInspector Event: Debugger.globalObjectCleared
function onGlobalObjectCleared(res) {
// res = {}
}
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
scriptIdDebugger.ScriptId Identifier of the script parsed.urlString URL or name of the script parsed (if any).startLineInteger Line offset of the script within the resource with given URL (for script tags).startColumnInteger Column offset of the script within the resource with given URL.endLineInteger Last line of the script.endColumnInteger Length of the last line of the script.isContentScript (optional)Boolean Determines whether this script is a user extension script.sourceMapURL (optional)String URL of source map associated with script (if any).hasSourceURL (optional)Boolean True, if this script has sourceURL.
// WebInspector Event: Debugger.scriptParsed
function onScriptParsed(res) {
// res = {scriptId, url, startLine, startColumn, endLine, endColumn, isContentScript, sourceMapURL, hasSourceURL}
}
Fired when virtual machine fails to parse the script.
urlString URL of the script that failed to parse.scriptSourceString Source text of the script that failed to parse.startLineInteger Line offset of the script within the resource.errorLineInteger Line with error.errorMessageString Parse error message.
// WebInspector Event: Debugger.scriptFailedToParse
function onScriptFailedToParse(res) {
// res = {url, scriptSource, startLine, errorLine, errorMessage}
}
Fired when breakpoint is resolved to an actual script and location.
breakpointIdDebugger.BreakpointId Breakpoint unique identifier.locationDebugger.Location Actual breakpoint location.
// WebInspector Event: Debugger.breakpointResolved
function onBreakpointResolved(res) {
// res = {breakpointId, location}
}
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
callFrames[Debugger.CallFrame] Call stack the virtual machine stopped on.reason( XHR | DOM | EventListener | exception | assert | CSPViolation | debugCommand | other ) Pause reason.data (optional)Object Object containing break-specific auxiliary properties.hitBreakpoints (optional)[String] Hit breakpoints IDs
// WebInspector Event: Debugger.paused
function onPaused(res) {
// res = {callFrames, reason, data, hitBreakpoints}
}
Fired when the virtual machine resumed execution.
// WebInspector Event: Debugger.resumed
function onResumed(res) {
// res = {}
}
Type
Command
Represents a browser side file or directory.
urlString filesystem: URL for the entry.nameString The name of the file or directory.isDirectoryBoolean True if the entry is a directory.mimeType (optional)String MIME type of the entry, available for a file only.resourceType (optional)Page.ResourceType ResourceType of the entry, available for a file only.isTextFile (optional)Boolean True if the entry is a text file.
Represents metadata of a file or entry.
modificationTimeNumber Modification time.sizeNumber File size. This field is always zero for directories.
Enables events from backend.
// WebInspector Command: FileSystem.enable
FileSystem.enable();
Disables events from backend.
// WebInspector Command: FileSystem.disable
FileSystem.disable();
Returns root directory of the FileSystem, if exists.
originString Security origin of requesting FileSystem. One of frames in current page needs to have this security origin.type( temporary | persistent ) FileSystem type of requesting FileSystem.
errorCodeInteger 0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value.root (optional)FileSystem.Entry Contains root of the requested FileSystem if the command completed successfully.
// WebInspector Command: FileSystem.requestFileSystemRoot
FileSystem.requestFileSystemRoot(origin, type, function callback(res) {
// res = {errorCode, root}
});
Returns content of the directory.
urlString URL of the directory that the frontend is requesting to read from.
errorCodeInteger 0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value.entries (optional)[FileSystem.Entry] Contains all entries on directory if the command completed successfully.
// WebInspector Command: FileSystem.requestDirectoryContent
FileSystem.requestDirectoryContent(url, function callback(res) {
// res = {errorCode, entries}
});
Returns metadata of the entry.
urlString URL of the entry that the frontend is requesting to get metadata from.
errorCodeInteger 0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value.metadata (optional)FileSystem.Metadata Contains metadata of the entry if the command completed successfully.
// WebInspector Command: FileSystem.requestMetadata
FileSystem.requestMetadata(url, function callback(res) {
// res = {errorCode, metadata}
});
Returns content of the file. Result should be sliced into [start, end).
urlString URL of the file that the frontend is requesting to read from.readAsTextBoolean True if the content should be read as text, otherwise the result will be returned as base64 encoded text.start (optional)Integer Specifies the start of range to read.end (optional)Integer Specifies the end of range to read exclusively.charset (optional)String Overrides charset of the content when content is served as text.
errorCodeInteger 0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value.content (optional)String Content of the file.charset (optional)String Charset of the content if it is served as text.
// WebInspector Command: FileSystem.requestFileContent
FileSystem.requestFileContent(url, readAsText, start, end, charset, function callback(res) {
// res = {errorCode, content, charset}
});
Deletes specified entry. If the entry is a directory, the agent deletes children recursively.
urlString URL of the entry to delete.
errorCodeInteger 0, if no error. Otherwise errorCode is set to FileError::ErrorCode value.
// WebInspector Command: FileSystem.deleteEntry
FileSystem.deleteEntry(url, function callback(res) {
// res = {errorCode}
});
Type
Command
Event
Profile header.
titleString Profile title.uidInteger Unique identifier of the profile.maxJSObjectId (optional)Integer Last seen JS object Id.
Heap snashot object id.
String
headers[HeapProfiler.ProfileHeader]
// WebInspector Command: HeapProfiler.getProfileHeaders
HeapProfiler.getProfileHeaders(function callback(res) {
// res = {headers}
});
// WebInspector Command: HeapProfiler.startTrackingHeapObjects
HeapProfiler.startTrackingHeapObjects();
// WebInspector Command: HeapProfiler.stopTrackingHeapObjects
HeapProfiler.stopTrackingHeapObjects();
uidInteger
// WebInspector Command: HeapProfiler.getHeapSnapshot
HeapProfiler.getHeapSnapshot(uid);
uidInteger
// WebInspector Command: HeapProfiler.removeProfile
HeapProfiler.removeProfile(uid);
// WebInspector Command: HeapProfiler.clearProfiles
HeapProfiler.clearProfiles();
reportProgress (optional)Boolean If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
// WebInspector Command: HeapProfiler.takeHeapSnapshot
HeapProfiler.takeHeapSnapshot(reportProgress);
// WebInspector Command: HeapProfiler.collectGarbage
HeapProfiler.collectGarbage();
objectIdHeapProfiler.HeapSnapshotObjectIdobjectGroup (optional)String Symbolic group name that can be used to release multiple objects.
resultRuntime.RemoteObject Evaluation result.
// WebInspector Command: HeapProfiler.getObjectByHeapObjectId
HeapProfiler.getObjectByHeapObjectId(objectId, objectGroup, function callback(res) {
// res = {result}
});
objectIdRuntime.RemoteObjectId Identifier of the object to get heap object id for.
heapSnapshotObjectIdHeapProfiler.HeapSnapshotObjectId Id of the heap snapshot object corresponding to the passed remote object id.
// WebInspector Command: HeapProfiler.getHeapObjectId
HeapProfiler.getHeapObjectId(objectId, function callback(res) {
// res = {heapSnapshotObjectId}
});
headerHeapProfiler.ProfileHeader
// WebInspector Event: HeapProfiler.addProfileHeader
function onAddProfileHeader(res) {
// res = {header}
}
uidIntegerchunkString
// WebInspector Event: HeapProfiler.addHeapSnapshotChunk
function onAddHeapSnapshotChunk(res) {
// res = {uid, chunk}
}
uidInteger
// WebInspector Event: HeapProfiler.finishHeapSnapshot
function onFinishHeapSnapshot(res) {
// res = {uid}
}
// WebInspector Event: HeapProfiler.resetProfiles
function onResetProfiles(res) {
// res = {}
}
doneIntegertotalInteger
// WebInspector Event: HeapProfiler.reportHeapSnapshotProgress
function onReportHeapSnapshotProgress(res) {
// res = {done, total}
}
If heap objects tracking has been started then backend regulary sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
lastSeenObjectIdIntegertimestampNumber
// WebInspector Event: HeapProfiler.lastSeenObjectId
function onLastSeenObjectId(res) {
// res = {lastSeenObjectId, timestamp}
}
If heap objects tracking has been started then backend may send update for one or more fragments
statsUpdate[Integer] An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment.
// WebInspector Event: HeapProfiler.heapStatsUpdate
function onHeapStatsUpdate(res) {
// res = {statsUpdate}
}
Type
Command
Database with an array of object stores.
nameString Database name.versionString Deprecated string database version.intVersionInteger Integer database version.objectStores[IndexedDB.ObjectStore] Object stores in this database.
Object store.
nameString Object store name.keyPathIndexedDB.KeyPath Object store key path.autoIncrementBoolean If true, object store has auto increment flag set.indexes[IndexedDB.ObjectStoreIndex] Indexes in this object store.
Object store index.
nameString Index name.keyPathIndexedDB.KeyPath Index key path.uniqueBoolean If true, index is unique.multiEntryBoolean If true, index allows multiple entries for a key.
Key.
type( number | string | date | array ) Key type.number (optional)Number Number value.string (optional)String String value.date (optional)Number Date value.array (optional)[IndexedDB.Key] Array value.
Key range.
lower (optional)IndexedDB.Key Lower bound.upper (optional)IndexedDB.Key Upper bound.lowerOpenBoolean If true lower bound is open.upperOpenBoolean If true upper bound is open.
Data entry.
keyRuntime.RemoteObject Key.primaryKeyRuntime.RemoteObject Primary key.valueRuntime.RemoteObject Value.
Key path.
type( null | string | array ) Key path type.string (optional)String String value.array (optional)[String] Array value.
Enables events from backend.
// WebInspector Command: IndexedDB.enable
IndexedDB.enable();
Disables events from backend.
// WebInspector Command: IndexedDB.disable
IndexedDB.disable();
Requests database names for given security origin.
securityOriginString Security origin.
databaseNames[String] Database names for origin.
// WebInspector Command: IndexedDB.requestDatabaseNames
IndexedDB.requestDatabaseNames(securityOrigin, function callback(res) {
// res = {databaseNames}
});
Requests database with given name in given frame.
securityOriginString Security origin.databaseNameString Database name.
databaseWithObjectStoresIndexedDB.DatabaseWithObjectStores Database with an array of object stores.
// WebInspector Command: IndexedDB.requestDatabase
IndexedDB.requestDatabase(securityOrigin, databaseName, function callback(res) {
// res = {databaseWithObjectStores}
});
Requests data from object store or index.
securityOriginString Security origin.databaseNameString Database name.objectStoreNameString Object store name.indexNameString Index name, empty string for object store data requests.skipCountInteger Number of records to skip.pageSizeInteger Number of records to fetch.keyRange (optional)IndexedDB.KeyRange Key range.
objectStoreDataEntries[IndexedDB.DataEntry] Array of object store data entries.hasMoreBoolean If true, there are more entries to fetch in the given range.
// WebInspector Command: IndexedDB.requestData
IndexedDB.requestData(securityOrigin, databaseName, objectStoreName, indexName, skipCount, pageSize, keyRange, function callback(res) {
// res = {objectStoreDataEntries, hasMore}
});
Clears all entries from an object store.
securityOriginString Security origin.databaseNameString Database name.objectStoreNameString Object store name.
// WebInspector Command: IndexedDB.clearObjectStore
IndexedDB.clearObjectStore(securityOrigin, databaseName, objectStoreName, function callback(res) {
// res = {}
});
Type
Command
state( touchPressed | touchReleased | touchMoved | touchStationary | touchCancelled ) State of the touch point.xInteger X coordinate of the event relative to the main frame's viewport.yInteger Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.radiusX (optional)Integer X radius of the touch area (default: 1).radiusY (optional)Integer Y radius of the touch area (default: 1).rotationAngle (optional)Number Rotation angle (default: 0.0).force (optional)Number Force (default: 1.0).id (optional)Number Identifier used to track touch sources between events, must be unique within an event.
Dispatches a key event to the page.
type( keyDown | keyUp | rawKeyDown | char ) Type of the key event.modifiers (optional)Integer Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).timestamp (optional)Number Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).text (optional)String Text as generated by processing a virtual key code with a keyboard layout. Not needed for for keyUp and rawKeyDown events (default: "")unmodifiedText (optional)String Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").keyIdentifier (optional)String Unique key identifier (e.g., 'U+0041') (default: "").windowsVirtualKeyCode (optional)Integer Windows virtual key code (default: 0).nativeVirtualKeyCode (optional)Integer Native virtual key code (default: 0).macCharCode (optional)Integer Mac character code (default: 0).autoRepeat (optional)Boolean Whether the event was generated from auto repeat (default: false).isKeypad (optional)Boolean Whether the event was generated from the keypad (default: false).isSystemKey (optional)Boolean Whether the event was a system key event (default: false).
// WebInspector Command: Input.dispatchKeyEvent
Input.dispatchKeyEvent(type, modifiers, timestamp, text, unmodifiedText, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, macCharCode, autoRepeat, isKeypad, isSystemKey);
Dispatches a mouse event to the page.
type( mousePressed | mouseReleased | mouseMoved ) Type of the mouse event.xInteger X coordinate of the event relative to the main frame's viewport.yInteger Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.modifiers (optional)Integer Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).timestamp (optional)Number Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).button (optional)( none | left | middle | right ) Mouse button (default: "none").clickCount (optional)Integer Number of times the mouse button was clicked (default: 0).deviceSpace (optional)Boolean If true, x and y are given in dip wrt current viewport.
// WebInspector Command: Input.dispatchMouseEvent
Input.dispatchMouseEvent(type, x, y, modifiers, timestamp, button, clickCount, deviceSpace);
Dispatches a touch event to the page.
type( touchStart | touchEnd | touchMove ) Type of the touch event.touchPoints[Input.TouchPoint] Touch points.modifiers (optional)Integer Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).timestamp (optional)Number Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).
// WebInspector Command: Input.dispatchTouchEvent
Input.dispatchTouchEvent(type, touchPoints, modifiers, timestamp);
Dispatches a gesture event to the page.
type( scrollBegin | scrollEnd | scrollUpdate | tapDown | tap | pinchBegin | pinchEnd | pinchUpdate ) Type of the gesture event.xInteger X coordinate relative to the screen's viewport.yInteger Y coordinate relative to the screen's viewport.timestamp (optional)Number Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).deltaX (optional)Integer Delta X where apllies.deltaY (optional)Integer Delta Y where apllies.pinchScale (optional)Number Pinch scale.
// WebInspector Command: Input.dispatchGestureEvent
Input.dispatchGestureEvent(type, x, y, timestamp, deltaX, deltaY, pinchScale);
Command
Event
Enables inspector domain notifications.
// WebInspector Command: Inspector.enable
Inspector.enable();
Disables inspector domain notifications.
// WebInspector Command: Inspector.disable
Inspector.disable();
Resets all domains.
// WebInspector Command: Inspector.reset
Inspector.reset();
testCallIdIntegerscriptString
// WebInspector Event: Inspector.evaluateForTestInFrontend
function onEvaluateForTestInFrontend(res) {
// res = {testCallId, script}
}
objectRuntime.RemoteObjecthintsObject
// WebInspector Event: Inspector.inspect
function onInspect(res) {
// res = {object, hints}
}
Fired when remote debugging connection is about to be terminated. Contains detach reason.
reasonString The reason why connection has been terminated.
// WebInspector Event: Inspector.detached
function onDetached(res) {
// res = {reason}
}
Fired when debugging target has crashed
// WebInspector Event: Inspector.targetCrashed
function onTargetCrashed(res) {
// res = {}
}
Type
Command
Event
Unique RenderLayer identifier.
String
Information about a compositing layer.
layerIdLayerTree.LayerId The unique id for this layer.parentLayerId (optional)LayerTree.LayerId The id of parent (not present for root).nodeId (optional)DOM.NodeId The id for the node associated with this layer.offsetXNumber Offset from parent layer, X coordinate.offsetYNumber Offset from parent layer, X coordinate.widthNumber Layer width.heightNumber Layer height.transform (optional)[Number] Transformation matrix for layer, default is identity matrixanchorX (optional)Number Transform anchor point X, absent if no transform specifiedanchorY (optional)Number Transform anchor point Y, absent if no transform specifiedanchorZ (optional)Number Transform anchor point Z, absent if no transform specifiedpaintCountInteger Indicates how many time this layer has painted.invisible (optional)Boolean Set if layer is not visible.
Enables compositing tree inspection.
// WebInspector Command: LayerTree.enable
LayerTree.enable();
Disables compositing tree inspection.
// WebInspector Command: LayerTree.disable
LayerTree.disable();
Returns the layer tree structure of the current page.
nodeId (optional)DOM.NodeId Root of the subtree for which we want to gather layers (return entire tree if not specified)
layers[LayerTree.Layer] Child layers.
// WebInspector Command: LayerTree.getLayers
LayerTree.getLayers(nodeId, function callback(res) {
// res = {layers}
});
Provides the reasons why the given layer was composited.
layerIdLayerTree.LayerId The id of the layer for which we want to get the reasons it was composited.
compositingReasons[String] A list of strings specifying reasons for the given layer to become composited.
// WebInspector Command: LayerTree.compositingReasons
LayerTree.compositingReasons(layerId, function callback(res) {
// res = {compositingReasons}
});
// WebInspector Event: LayerTree.layerTreeDidChange
function onLayerTreeDidChange(res) {
// res = {}
}
Type
Command
Event
size (optional)Number Size of the block in bytes if availablenameString Unique name used to identify the component that allocated this blockchildren (optional)[Memory.MemoryBlock]
strings[String] An array of strings that were found since last update.nodes[Integer] An array of nodes that were found since last update.edges[Integer] An array of edges that were found since last update.baseToRealNodeId[Integer] An array of integers for nodeId remapping. Even nodeId has to be mapped to the following odd nodeId.
documentsIntegernodesIntegerjsEventListenersInteger
// WebInspector Command: Memory.getDOMCounters
Memory.getDOMCounters(function callback(res) {
// res = {documents, nodes, jsEventListeners}
});
chunkMemory.HeapSnapshotChunk A chunk of the serialized the snapshot.
// WebInspector Event: Memory.addNativeSnapshotChunk
function onAddNativeSnapshotChunk(res) {
// res = {chunk}
}
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.
Type
Command
Event
Unique loader identifier.
String
Unique request identifier.
String
Number of seconds since epoch.
Number
Request / response headers as keys / values of JSON object.
Timing information for the request.
requestTimeNumber Timing's requestTime is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this requestTime.proxyStartNumber Started resolving proxy.proxyEndNumber Finished resolving proxy.dnsStartNumber Started DNS address resolve.dnsEndNumber Finished DNS address resolve.connectStartNumber Started connecting to the remote host.connectEndNumber Connected to the remote host.sslStartNumber Started SSL handshake.sslEndNumber Finished SSL handshake.sendStartNumber Started sending request.sendEndNumber Finished sending request.receiveHeadersEndNumber Finished receiving response headers.
HTTP request data.
urlString Request URL.methodString HTTP request method.headersNetwork.Headers HTTP request headers.postData (optional)String HTTP POST request data.
HTTP response data.
urlString Response URL. This URL can be different from CachedResource.url in case of redirect.statusNumber HTTP response status code.statusTextString HTTP response status text.headersNetwork.Headers HTTP response headers.headersText (optional)String HTTP response headers text.mimeTypeString Resource mimeType as determined by the browser.requestHeaders (optional)Network.Headers Refined HTTP request headers that were actually transmitted over the network.requestHeadersText (optional)String HTTP request headers text.connectionReusedBoolean Specifies whether physical connection was actually reused for this request.connectionIdNumber Physical connection id that was actually used for this request.fromDiskCache (optional)Boolean Specifies that the request was served from the disk cache.timing (optional)Network.ResourceTiming Timing information for the given request.
WebSocket request data.
headersNetwork.Headers HTTP response headers.
WebSocket response data.
statusNumber HTTP response status code.statusTextString HTTP response status text.headersNetwork.Headers HTTP response headers.
WebSocket frame data.
opcodeNumber WebSocket frame opcode.maskBoolean WebSocke frame mask.payloadDataString WebSocke frame payload data.
Information about the cached resource.
urlString Resource URL. This is the url of the original network request.typePage.ResourceType Type of this resource.response (optional)Network.Response Cached response data.bodySizeNumber Cached response body size.
Information about the request initiator.
type( parser | script | other ) Type of this initiator.stackTrace (optional)Console.StackTrace Initiator JavaScript stack trace, set for Script only.url (optional)String Initiator URL, set for Parser type only.lineNumber (optional)Number Initiator line number, set for Parser type only.
Enables network tracking, network events will now be delivered to the client.
// WebInspector Command: Network.enable
Network.enable();
Disables network tracking, prevents network events from being sent to the client.
// WebInspector Command: Network.disable
Network.disable();
Allows overriding user agent with the given string.
userAgentString User agent to use.
// WebInspector Command: Network.setUserAgentOverride
Network.setUserAgentOverride(userAgent);
Specifies whether to always send extra HTTP headers with the requests from this page.
headersNetwork.Headers Map with extra HTTP headers.
// WebInspector Command: Network.setExtraHTTPHeaders
Network.setExtraHTTPHeaders(headers);
Returns content served for the given request.
requestIdNetwork.RequestId Identifier of the network request to get content for.
bodyString Response body.base64EncodedBoolean True, if content was sent as base64.
// WebInspector Command: Network.getResponseBody
Network.getResponseBody(requestId, function callback(res) {
// res = {body, base64Encoded}
});
This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.
requestIdNetwork.RequestId Identifier of XHR to replay.
// WebInspector Command: Network.replayXHR
Network.replayXHR(requestId);
Tells whether clearing browser cache is supported.
resultBoolean True if browser cache can be cleared.
// WebInspector Command: Network.canClearBrowserCache
Network.canClearBrowserCache(function callback(res) {
// res = {result}
});
Clears browser cache.
// WebInspector Command: Network.clearBrowserCache
Network.clearBrowserCache();
Tells whether clearing browser cookies is supported.
resultBoolean True if browser cookies can be cleared.
// WebInspector Command: Network.canClearBrowserCookies
Network.canClearBrowserCookies(function callback(res) {
// res = {result}
});
Clears browser cookies.
// WebInspector Command: Network.clearBrowserCookies
Network.clearBrowserCookies();
Toggles ignoring cache for each request. If true, cache will not be used.
cacheDisabledBoolean Cache disabled state.
// WebInspector Command: Network.setCacheDisabled
Network.setCacheDisabled(cacheDisabled);
Loads a resource in the context of a frame on the inspected page without cross origin checks.
frameIdPage.FrameId Frame to load the resource from.urlString URL of the resource to load.requestHeaders (optional)Network.Headers Request headers.
statusCodeNumber HTTP status code.responseHeadersNetwork.Headers Response headers.contentString Resource content.
// WebInspector Command: Network.loadResourceForFrontend
Network.loadResourceForFrontend(frameId, url, requestHeaders, function callback(res) {
// res = {statusCode, responseHeaders, content}
});
Fired when page is about to send HTTP request.
requestIdNetwork.RequestId Request identifier.frameIdPage.FrameId Frame identifier.loaderIdNetwork.LoaderId Loader identifier.documentURLString URL of the document this request is loaded for.requestNetwork.Request Request data.timestampNetwork.Timestamp Timestamp.initiatorNetwork.Initiator Request initiator.redirectResponse (optional)Network.Response Redirect response data.
// WebInspector Event: Network.requestWillBeSent
function onRequestWillBeSent(res) {
// res = {requestId, frameId, loaderId, documentURL, request, timestamp, initiator, redirectResponse}
}
Fired if request ended up loading from cache.
requestIdNetwork.RequestId Request identifier.
// WebInspector Event: Network.requestServedFromCache
function onRequestServedFromCache(res) {
// res = {requestId}
}
Fired when HTTP response is available.
requestIdNetwork.RequestId Request identifier.frameIdPage.FrameId Frame identifier.loaderIdNetwork.LoaderId Loader identifier.timestampNetwork.Timestamp Timestamp.typePage.ResourceType Resource type.responseNetwork.Response Response data.
// WebInspector Event: Network.responseReceived
function onResponseReceived(res) {
// res = {requestId, frameId, loaderId, timestamp, type, response}
}
Fired when data chunk was received over the network.
requestIdNetwork.RequestId Request identifier.timestampNetwork.Timestamp Timestamp.dataLengthInteger Data chunk length.encodedDataLengthInteger Actual bytes received (might be less than dataLength for compressed encodings).
// WebInspector Event: Network.dataReceived
function onDataReceived(res) {
// res = {requestId, timestamp, dataLength, encodedDataLength}
}
Fired when HTTP request has finished loading.
requestIdNetwork.RequestId Request identifier.timestampNetwork.Timestamp Timestamp.
// WebInspector Event: Network.loadingFinished
function onLoadingFinished(res) {
// res = {requestId, timestamp}
}
Fired when HTTP request has failed to load.
requestIdNetwork.RequestId Request identifier.timestampNetwork.Timestamp Timestamp.errorTextString User friendly error message.canceled (optional)Boolean True if loading was canceled.
// WebInspector Event: Network.loadingFailed
function onLoadingFailed(res) {
// res = {requestId, timestamp, errorText, canceled}
}
Fired when WebSocket is about to initiate handshake.
requestIdNetwork.RequestId Request identifier.timestampNetwork.Timestamp Timestamp.requestNetwork.WebSocketRequest WebSocket request data.
// WebInspector Event: Network.webSocketWillSendHandshakeRequest
function onWebSocketWillSendHandshakeRequest(res) {
// res = {requestId, timestamp, request}
}
Fired when WebSocket handshake response becomes available.
requestIdNetwork.RequestId Request identifier.timestampNetwork.Timestamp Timestamp.responseNetwork.WebSocketResponse WebSocket response data.
// WebInspector Event: Network.webSocketHandshakeResponseReceived
function onWebSocketHandshakeResponseReceived(res) {
// res = {requestId, timestamp, response}
}
Fired upon WebSocket creation.
requestIdNetwork.RequestId Request identifier.urlString WebSocket request URL.
// WebInspector Event: Network.webSocketCreated
function onWebSocketCreated(res) {
// res = {requestId, url}
}
Fired when WebSocket is closed.
requestIdNetwork.RequestId Request identifier.timestampNetwork.Timestamp Timestamp.
// WebInspector Event: Network.webSocketClosed
function onWebSocketClosed(res) {
// res = {requestId, timestamp}
}
Fired when WebSocket frame is received.
requestIdNetwork.RequestId Request identifier.timestampNetwork.Timestamp Timestamp.responseNetwork.WebSocketFrame WebSocket response data.
// WebInspector Event: Network.webSocketFrameReceived
function onWebSocketFrameReceived(res) {
// res = {requestId, timestamp, response}
}
Fired when WebSocket frame error occurs.
requestIdNetwork.RequestId Request identifier.timestampNetwork.Timestamp Timestamp.errorMessageString WebSocket frame error message.
// WebInspector Event: Network.webSocketFrameError
function onWebSocketFrameError(res) {
// res = {requestId, timestamp, errorMessage}
}
Fired when WebSocket frame is sent.
requestIdNetwork.RequestId Request identifier.timestampNetwork.Timestamp Timestamp.responseNetwork.WebSocketFrame WebSocket response data.
// WebInspector Event: Network.webSocketFrameSent
function onWebSocketFrameSent(res) {
// res = {requestId, timestamp, response}
}
Actions and events related to the inspected page belong to the page domain.
Type
Command
Event
Resource type as it was perceived by the rendering engine.
( Document | Stylesheet | Image | Font | Script | XHR | WebSocket | Other )
Unique frame identifier.
String
Information about the Frame on the page.
idString Frame unique identifier.parentId (optional)String Parent frame identifier.loaderIdNetwork.LoaderId Identifier of the loader associated with this frame.name (optional)String Frame's name as specified in the tag.urlString Frame document's URL.securityOriginString Frame document's security origin.mimeTypeString Frame document's mimeType as determined by the browser.
Information about the Frame hierarchy along with their cached resources.
framePage.Frame Frame information for this tree item.childFrames (optional)[Page.FrameResourceTree] Child frames.resources[Object] Information about frame resources.
Search match for resource.
lineNumberNumber Line number in resource content.lineContentString Line with match content.
Search result for resource.
urlString Resource URL.frameIdPage.FrameId Resource frame id.matchesCountNumber Number of matches in the resource content.
Cookie object
nameString Cookie name.valueString Cookie value.domainString Cookie domain.pathString Cookie path.expiresNumber Cookie expires.sizeInteger Cookie size.httpOnlyBoolean True if cookie is http-only.secureBoolean True if cookie is secure.sessionBoolean True in case of session cookie.
Unique script identifier.
String
Navigation history entry.
idInteger Unique id of the navigation history entry.urlString URL of the navigation history entry.titleString Title of the navigation history entry.
Enables page domain notifications.
// WebInspector Command: Page.enable
Page.enable();
Disables page domain notifications.
// WebInspector Command: Page.disable
Page.disable();
scriptSourceString
identifierPage.ScriptIdentifier Identifier of the added script.
// WebInspector Command: Page.addScriptToEvaluateOnLoad
Page.addScriptToEvaluateOnLoad(scriptSource, function callback(res) {
// res = {identifier}
});
identifierPage.ScriptIdentifier
// WebInspector Command: Page.removeScriptToEvaluateOnLoad
Page.removeScriptToEvaluateOnLoad(identifier);
Reloads given page optionally ignoring the cache.
ignoreCache (optional)Boolean If true, browser cache is ignored (as if the user pressed Shift+refresh).scriptToEvaluateOnLoad (optional)String If set, the script will be injected into all frames of the inspected page after reload.scriptPreprocessor (optional)String Script body that should evaluate to function that will preprocess all the scripts before their compilation.
// WebInspector Command: Page.reload
Page.reload(ignoreCache, scriptToEvaluateOnLoad, scriptPreprocessor);
Navigates current page to the given URL.
urlString URL to navigate the page to.
// WebInspector Command: Page.navigate
Page.navigate(url);
Returns navigation history for the current page.
currentIndexInteger Index of the current navigation history entry.entries[Page.NavigationEntry] Array of navigation history entries.
// WebInspector Command: Page.getNavigationHistory
Page.getNavigationHistory(function callback(res) {
// res = {currentIndex, entries}
});
Navigates current page to the given history entry.
entryIdInteger Unique id of the entry to navigate to.
// WebInspector Command: Page.navigateToHistoryEntry
Page.navigateToHistoryEntry(entryId);
Returns all browser cookies. Depending on the backend support, will either return detailed cookie information in the cookie field or string cookie representation using cookieString.
cookies[Page.Cookie] Array of cookie objects.cookiesStringString document.cookie string representation of the cookies.
// WebInspector Command: Page.getCookies
Page.getCookies(function callback(res) {
// res = {cookies, cookiesString}
});
Deletes browser cookie with given name, domain and path.
cookieNameString Name of the cookie to remove.urlString URL to match cooke domain and path.
// WebInspector Command: Page.deleteCookie
Page.deleteCookie(cookieName, url);
Returns present frame / resource tree structure.
frameTreePage.FrameResourceTree Present frame / resource tree structure.
// WebInspector Command: Page.getResourceTree
Page.getResourceTree(function callback(res) {
// res = {frameTree}
});
Returns content of the given resource.
frameIdPage.FrameId Frame id to get resource for.urlString URL of the resource to get content for.
contentString Resource content.base64EncodedBoolean True, if content was served as base64.
// WebInspector Command: Page.getResourceContent
Page.getResourceContent(frameId, url, function callback(res) {
// res = {content, base64Encoded}
});
Searches for given string in resource content.
frameIdPage.FrameId Frame id for resource to search in.urlString URL of the resource to search in.queryString String to search for.caseSensitive (optional)Boolean If true, search is case sensitive.isRegex (optional)Boolean If true, treats string parameter as regex.
result[Page.SearchMatch] List of search matches.
// WebInspector Command: Page.searchInResource
Page.searchInResource(frameId, url, query, caseSensitive, isRegex, function callback(res) {
// res = {result}
});
Searches for given string in frame / resource tree structure.
textString String to search for.caseSensitive (optional)Boolean If true, search is case sensitive.isRegex (optional)Boolean If true, treats string parameter as regex.
result[Page.SearchResult] List of search results.
// WebInspector Command: Page.searchInResources
Page.searchInResources(text, caseSensitive, isRegex, function callback(res) {
// res = {result}
});
Sets given markup as the document's HTML.
frameIdPage.FrameId Frame id to set HTML for.htmlString HTML content to set.
// WebInspector Command: Page.setDocumentContent
Page.setDocumentContent(frameId, html);
Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results) and the font scale factor.
widthInteger Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.heightInteger Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.fontScaleFactorNumber Overriding font scale factor value (must be positive). 1 disables the override.fitWindowBoolean Whether a view that exceeds the available browser window area should be scaled down to fit.
// WebInspector Command: Page.setDeviceMetricsOverride
Page.setDeviceMetricsOverride(width, height, fontScaleFactor, fitWindow);
Requests that backend shows paint rectangles
resultBoolean True for showing paint rectangles
// WebInspector Command: Page.setShowPaintRects
Page.setShowPaintRects(result);
Requests that backend shows debug borders on layers
showBoolean True for showing debug borders
// WebInspector Command: Page.setShowDebugBorders
Page.setShowDebugBorders(show);
Requests that backend shows the FPS counter
showBoolean True for showing the FPS counter
// WebInspector Command: Page.setShowFPSCounter
Page.setShowFPSCounter(show);
Requests that backend enables continuous painting
enabledBoolean True for enabling cointinuous painting
// WebInspector Command: Page.setContinuousPaintingEnabled
Page.setContinuousPaintingEnabled(enabled);
Requests that backend shows scroll bottleneck rects
showBoolean True for showing scroll bottleneck rects
// WebInspector Command: Page.setShowScrollBottleneckRects
Page.setShowScrollBottleneckRects(show);
Determines if scripts can be executed in the page.
result( allowed | disabled | forbidden ) Script execution status: "allowed" if scripts can be executed, "disabled" if script execution has been disabled through page settings, "forbidden" if script execution for the given page is not possible for other reasons.
// WebInspector Command: Page.getScriptExecutionStatus
Page.getScriptExecutionStatus(function callback(res) {
// res = {result}
});
Switches script execution in the page.
valueBoolean Whether script execution should be disabled in the page.
// WebInspector Command: Page.setScriptExecutionDisabled
Page.setScriptExecutionDisabled(value);
Overrides the Geolocation Position or Error.
latitude (optional)Number Mock longitudelongitude (optional)Number Mock latitudeaccuracy (optional)Number Mock accuracy
// WebInspector Command: Page.setGeolocationOverride
Page.setGeolocationOverride(latitude, longitude, accuracy);
Clears the overriden Geolocation Position and Error.
// WebInspector Command: Page.clearGeolocationOverride
Page.clearGeolocationOverride();
Overrides the Device Orientation.
alphaNumber Mock alphabetaNumber Mock betagammaNumber Mock gamma
// WebInspector Command: Page.setDeviceOrientationOverride
Page.setDeviceOrientationOverride(alpha, beta, gamma);
Clears the overridden Device Orientation.
// WebInspector Command: Page.clearDeviceOrientationOverride
Page.clearDeviceOrientationOverride();
Toggles mouse event-based touch event emulation.
enabledBoolean Whether the touch event emulation should be enabled.
// WebInspector Command: Page.setTouchEmulationEnabled
Page.setTouchEmulationEnabled(enabled);
Emulates the given media for CSS media queries.
mediaString Media type to emulate. Empty string disables the override.
// WebInspector Command: Page.setEmulatedMedia
Page.setEmulatedMedia(media);
Capture page screenshot.
format (optional)( jpeg | png ) Image compression format.quality (optional)Integer Compression quality from range [0..100].maxWidth (optional)Integer Maximum screenshot width.maxHeight (optional)Integer Maximum screenshot height.
dataString Base64-encoded image data (PNG).deviceScaleFactorNumber Device scale factor.pageScaleFactorNumber Page scale factor.viewportDOM.Rect Viewport in CSS pixels.
// WebInspector Command: Page.captureScreenshot
Page.captureScreenshot(format, quality, maxWidth, maxHeight, function callback(res) {
// res = {data, deviceScaleFactor, pageScaleFactor, viewport}
});
Starts sending each frame using the screencastFrame event.
format (optional)( jpeg | png ) Image compression format.quality (optional)Integer Compression quality from range [0..100].maxWidth (optional)Integer Maximum screenshot width.maxHeight (optional)Integer Maximum screenshot height.
// WebInspector Command: Page.startScreencast
Page.startScreencast(format, quality, maxWidth, maxHeight);
Stops sending each frame in the screencastFrame.
// WebInspector Command: Page.stopScreencast
Page.stopScreencast();
Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).
acceptBoolean Whether to accept or dismiss the dialog.promptText (optional)String The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.
// WebInspector Command: Page.handleJavaScriptDialog
Page.handleJavaScriptDialog(accept, promptText);
Paints viewport size upon main frame resize.
showBoolean Whether to paint size or not.showGrid (optional)Boolean Whether to paint grid as well.
// WebInspector Command: Page.setShowViewportSizeOnResize
Page.setShowViewportSizeOnResize(show, showGrid);
Force accelerated compositing mode for inspected page.
forceBoolean Whether to force accelerated compositing or not.
// WebInspector Command: Page.setForceCompositingMode
Page.setForceCompositingMode(force);
timestampNumber
// WebInspector Event: Page.domContentEventFired
function onDomContentEventFired(res) {
// res = {timestamp}
}
timestampNumber
// WebInspector Event: Page.loadEventFired
function onLoadEventFired(res) {
// res = {timestamp}
}
Fired when frame has been attached to its parent.
frameIdPage.FrameId Id of the frame that has been attached.
// WebInspector Event: Page.frameAttached
function onFrameAttached(res) {
// res = {frameId}
}
Fired once navigation of the frame has completed. Frame is now associated with the new loader.
framePage.Frame Frame object.
// WebInspector Event: Page.frameNavigated
function onFrameNavigated(res) {
// res = {frame}
}
Fired when frame has been detached from its parent.
frameIdPage.FrameId Id of the frame that has been detached.
// WebInspector Event: Page.frameDetached
function onFrameDetached(res) {
// res = {frameId}
}
Fired when frame has started loading.
frameIdPage.FrameId Id of the frame that has started loading.
// WebInspector Event: Page.frameStartedLoading
function onFrameStartedLoading(res) {
// res = {frameId}
}
Fired when frame has stopped loading.
frameIdPage.FrameId Id of the frame that has stopped loading.
// WebInspector Event: Page.frameStoppedLoading
function onFrameStoppedLoading(res) {
// res = {frameId}
}
Fired when frame schedules a potential navigation.
frameIdPage.FrameId Id of the frame that has scheduled a navigation.delayNumber Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start.
// WebInspector Event: Page.frameScheduledNavigation
function onFrameScheduledNavigation(res) {
// res = {frameId, delay}
}
Fired when frame no longer has a scheduled navigation.
frameIdPage.FrameId Id of the frame that has cleared its scheduled navigation.
// WebInspector Event: Page.frameClearedScheduledNavigation
function onFrameClearedScheduledNavigation(res) {
// res = {frameId}
}
Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.
messageString Message that will be displayed by the dialog.
// WebInspector Event: Page.javascriptDialogOpening
function onJavascriptDialogOpening(res) {
// res = {message}
}
Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.
// WebInspector Event: Page.javascriptDialogClosed
function onJavascriptDialogClosed(res) {
// res = {}
}
Fired when the JavaScript is enabled/disabled on the page
isEnabledBoolean Whether script execution is enabled or disabled on the page.
// WebInspector Event: Page.scriptsEnabled
function onScriptsEnabled(res) {
// res = {isEnabled}
}
Compressed image data requested by the startScreencast.
dataString Base64-encoded compressed image.deviceScaleFactor (optional)Number Device scale factor.pageScaleFactor (optional)Number Page scale factor.viewport (optional)DOM.Rect Viewport in CSS pixels.offsetTop (optional)Number Top offset in DIP.offsetBottom (optional)Number Bottom offset in DIP.
// WebInspector Event: Page.screencastFrame
function onScreencastFrame(res) {
// res = {data, deviceScaleFactor, pageScaleFactor, viewport, offsetTop, offsetBottom}
}
Fired when the page with currently enabled screencast was shown or hidden .
visibleBoolean True if the page is visible.
// WebInspector Event: Page.screencastVisibilityChanged
function onScreencastVisibilityChanged(res) {
// res = {visible}
}
Type
Command
Event
Profile header.
titleString Profile title.uidInteger Unique identifier of the profile.
CPU Profile node. Holds callsite information, execution statistics and child nodes.
functionNameString Function name.scriptIdDebugger.ScriptId Script identifier.urlString URL.lineNumberInteger Line number.hitCountInteger Number of samples where this node was on top of the call stack.callUIDNumber Call UID.children[Profiler.CPUProfileNode] Child nodes.deoptReasonString The reason of being not optimized. The function may be deoptimized or marked as don't optimize.id (optional)Integer Unique id of the node.
Profile.
headProfiler.CPUProfileNodestartTimeNumber Profiling start time in seconds.endTimeNumber Profiling end time in seconds.samples (optional)[Integer] Ids of samples top nodes.
Heap snashot object id.
String
// WebInspector Command: Profiler.enable
Profiler.enable();
// WebInspector Command: Profiler.disable
Profiler.disable();
Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
intervalInteger New sampling interval in microseconds.
// WebInspector Command: Profiler.setSamplingInterval
Profiler.setSamplingInterval(interval);
// WebInspector Command: Profiler.start
Profiler.start();
headerProfiler.ProfileHeader The header of the recorded profile.
// WebInspector Command: Profiler.stop
Profiler.stop(function callback(res) {
// res = {header}
});
headers[Profiler.ProfileHeader]
// WebInspector Command: Profiler.getProfileHeaders
Profiler.getProfileHeaders(function callback(res) {
// res = {headers}
});
uidInteger
profileProfiler.CPUProfile
// WebInspector Command: Profiler.getCPUProfile
Profiler.getCPUProfile(uid, function callback(res) {
// res = {profile}
});
typeStringuidInteger
// WebInspector Command: Profiler.removeProfile
Profiler.removeProfile(type, uid);
// WebInspector Command: Profiler.clearProfiles
Profiler.clearProfiles();
headerProfiler.ProfileHeader
// WebInspector Event: Profiler.addProfileHeader
function onAddProfileHeader(res) {
// res = {header}
}
isProfilingBoolean
// WebInspector Event: Profiler.setRecordingProfile
function onSetRecordingProfile(res) {
// res = {isProfiling}
}
// WebInspector Event: Profiler.resetProfiles
function onResetProfiles(res) {
// res = {}
}
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.
Type
Command
Event
Unique object identifier.
String
Mirror object referencing original JavaScript object.
type( object | function | undefined | string | number | boolean ) Object type.subtype (optional)( array | null | node | regexp | date ) Object subtype hint. Specified for object type values only.className (optional)String Object class (constructor) name. Specified for object type values only.value (optional)Any Remote object value (in case of primitive values or JSON values if it was requested).description (optional)String String representation of the object.objectId (optional)Runtime.RemoteObjectId Unique object identifier (for non-primitive values).preview (optional)Runtime.ObjectPreview Preview containing abbreviated property values.
Object containing abbreviated remote object value.
losslessBoolean Determines whether preview is lossless (contains all information of the original object).overflowBoolean True iff some of the properties of the original did not fit.properties[Runtime.PropertyPreview] List of the properties.
nameString Property name.type( object | function | undefined | string | number | boolean ) Object type.value (optional)String User-friendly property value string.valuePreview (optional)Runtime.ObjectPreview Nested value preview.subtype (optional)( array | null | node | regexp | date ) Object subtype hint. Specified for object type values only.
Object property descriptor.
nameString Property name.value (optional)Runtime.RemoteObject The value associated with the property.writable (optional)Boolean True if the value associated with the property may be changed (data descriptors only).get (optional)Runtime.RemoteObject A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only).set (optional)Runtime.RemoteObject A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only).configurableBoolean True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.enumerableBoolean True if this property shows up during enumeration of the properties on the corresponding object.wasThrown (optional)Boolean True if the result was thrown during the evaluation.isOwn (optional)Boolean True if the property is owned for the object.
Object internal property descriptor. This property isn't normally visible in JavaScript code.
nameString Conventional property name.value (optional)Runtime.RemoteObject The value associated with the property.
Represents function call argument. Either remote object id objectId or primitive value or neither of (for undefined) them should be specified.
value (optional)Any Primitive value.objectId (optional)Runtime.RemoteObjectId Remote object handle.
Id of an execution context.
Integer
Description of an isolated world.
idRuntime.ExecutionContextId Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.isPageContextBoolean True if this is a context where inspected web page scripts run. False if it is a content script isolated context.nameString Human readable name describing given context.frameIdPage.FrameId Id of the owning frame.
Evaluates expression on global object.
expressionString Expression to evaluate.objectGroup (optional)String Symbolic group name that can be used to release multiple objects.includeCommandLineAPI (optional)Boolean Determines whether Command Line API should be available during the evaluation.doNotPauseOnExceptionsAndMuteConsole (optional)Boolean Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state.contextId (optional)Runtime.ExecutionContextId Specifies in which isolated context to perform evaluation. Each content script lives in an isolated context and this parameter may be used to specify one of those contexts. If the parameter is omitted or 0 the evaluation will be performed in the context of the inspected page.returnByValue (optional)Boolean Whether the result is expected to be a JSON object that should be sent by value.generatePreview (optional)Boolean Whether preview should be generated for the result.
resultRuntime.RemoteObject Evaluation result.wasThrown (optional)Boolean True if the result was thrown during the evaluation.
// WebInspector Command: Runtime.evaluate
Runtime.evaluate(expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, contextId, returnByValue, generatePreview, function callback(res) {
// res = {result, wasThrown}
});
Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
objectIdRuntime.RemoteObjectId Identifier of the object to call function on.functionDeclarationString Declaration of the function to call.arguments (optional)[Runtime.CallArgument] Call arguments. All call arguments must belong to the same JavaScript world as the target object.doNotPauseOnExceptionsAndMuteConsole (optional)Boolean Specifies whether function call should stop on exceptions and mute console. Overrides setPauseOnException state.returnByValue (optional)Boolean Whether the result is expected to be a JSON object which should be sent by value.generatePreview (optional)Boolean Whether preview should be generated for the result.
resultRuntime.RemoteObject Call result.wasThrown (optional)Boolean True if the result was thrown during the evaluation.
// WebInspector Command: Runtime.callFunctionOn
Runtime.callFunctionOn(objectId, functionDeclaration, arguments, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, function callback(res) {
// res = {result, wasThrown}
});
Returns properties of a given object. Object group of the result is inherited from the target object.
objectIdRuntime.RemoteObjectId Identifier of the object to return properties for.ownProperties (optional)Boolean If true, returns properties belonging only to the element itself, not to its prototype chain.accessorPropertiesOnly (optional)Boolean If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.
result[Runtime.PropertyDescriptor] Object properties.internalProperties (optional)[Runtime.InternalPropertyDescriptor] Internal object properties (only of the element itself).
// WebInspector Command: Runtime.getProperties
Runtime.getProperties(objectId, ownProperties, accessorPropertiesOnly, function callback(res) {
// res = {result, internalProperties}
});
Releases remote object with given id.
objectIdRuntime.RemoteObjectId Identifier of the object to release.
// WebInspector Command: Runtime.releaseObject
Runtime.releaseObject(objectId);
Releases all remote objects that belong to a given group.
objectGroupString Symbolic object group name.
// WebInspector Command: Runtime.releaseObjectGroup
Runtime.releaseObjectGroup(objectGroup);
Tells inspected instance(worker or page) that it can run in case it was started paused.
// WebInspector Command: Runtime.run
Runtime.run();
Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context.
// WebInspector Command: Runtime.enable
Runtime.enable();
Disables reporting of execution contexts creation.
// WebInspector Command: Runtime.disable
Runtime.disable();
Issued when new execution context is created.
contextRuntime.ExecutionContextDescription A newly created execution contex.
// WebInspector Event: Runtime.executionContextCreated
function onExecutionContextCreated(res) {
// res = {context}
}
Timeline provides its clients with instrumentation records that are generated during the page runtime. Timeline instrumentation can be started and stopped using corresponding commands. While timeline is started, it is generating timeline event records.
Type
Command
Event
Current values of DOM counters.
documentsIntegernodesIntegerjsEventListenersInteger
Timeline record contains information about the recorded activity.
typeString Event type.thread (optional)String If present, identifies the thread that produced the event.dataObject Event data.children (optional)[Timeline.TimelineEvent] Nested records.counters (optional)Timeline.DOMCounters Current values of DOM counters.usedHeapSize (optional)Integer Current size of JS heap.nativeHeapStatistics (optional)Object Native heap statistics.
Enables timeline. After this call, timeline can be started from within the page (for example upon console.timeline).
// WebInspector Command: Timeline.enable
Timeline.enable();
Disables timeline.
// WebInspector Command: Timeline.disable
Timeline.disable();
Starts capturing instrumentation events.
maxCallStackDepth (optional)Integer Samples JavaScript stack traces up to maxCallStackDepth, defaults to 5.bufferEvents (optional)Boolean Whether instrumentation events should be buffered and returned upon stop call.includeDomCounters (optional)Boolean Whether DOM counters data should be included into timeline events.includeNativeMemoryStatistics (optional)Boolean Whether native memory usage statistics should be reported as part of timeline events.
// WebInspector Command: Timeline.start
Timeline.start(maxCallStackDepth, bufferEvents, includeDomCounters, includeNativeMemoryStatistics);
Stops capturing instrumentation events.
events (optional)[Timeline.TimelineEvent] Timeline event record data.
// WebInspector Command: Timeline.stop
Timeline.stop(function callback(res) {
// res = {events}
});
Fired for every instrumentation event while timeline is started.
recordTimeline.TimelineEvent Timeline event record data.
// WebInspector Event: Timeline.eventRecorded
function onEventRecorded(res) {
// res = {record}
}
Fired when timeline is started.
consoleTimeline (optional)Boolean If specified, identifies that timeline was started using console.timeline() call.
// WebInspector Event: Timeline.started
function onStarted(res) {
// res = {consoleTimeline}
}
Fired when timeline is stopped.
consoleTimeline (optional)Boolean If specified, identifies that timeline was started using console.timeline() call.
// WebInspector Event: Timeline.stopped
function onStopped(res) {
// res = {consoleTimeline}
}
Command
Event
Strart trace events collection.
categoriesString Category/tag filter
// WebInspector Command: Tracing.start
Tracing.start(categories);
Stop trace events collection.
// WebInspector Command: Tracing.end
Tracing.end();
value[Object]
// WebInspector Event: Tracing.dataCollected
function onDataCollected(res) {
// res = {value}
}
// WebInspector Event: Tracing.tracingComplete
function onTracingComplete(res) {
// res = {}
}
Command
Event
// WebInspector Command: Worker.enable
Worker.enable();
// WebInspector Command: Worker.disable
Worker.disable();
workerIdIntegermessageObject
// WebInspector Command: Worker.sendMessageToWorker
Worker.sendMessageToWorker(workerId, message);
Tells whether browser supports workers inspection.
resultBoolean True if browser has workers support.
// WebInspector Command: Worker.canInspectWorkers
Worker.canInspectWorkers(function callback(res) {
// res = {result}
});
workerIdInteger
// WebInspector Command: Worker.connectToWorker
Worker.connectToWorker(workerId);
workerIdInteger
// WebInspector Command: Worker.disconnectFromWorker
Worker.disconnectFromWorker(workerId);
valueBoolean
// WebInspector Command: Worker.setAutoconnectToWorkers
Worker.setAutoconnectToWorkers(value);
workerIdIntegerurlStringinspectorConnectedBoolean
// WebInspector Event: Worker.workerCreated
function onWorkerCreated(res) {
// res = {workerId, url, inspectorConnected}
}
workerIdInteger
// WebInspector Event: Worker.workerTerminated
function onWorkerTerminated(res) {
// res = {workerId}
}
workerIdIntegermessageObject
// WebInspector Event: Worker.dispatchMessageFromWorker
function onDispatchMessageFromWorker(res) {
// res = {workerId, message}
}
// WebInspector Event: Worker.disconnectedFromWorker
function onDisconnectedFromWorker(res) {
// res = {}
}