ApplicationCache
Type
Command
Event
ApplicationCache.ApplicationCacheResource Type
Detailed application cache resource information.
- url
- String Resource url.
- size
- Integer Resource size.
- type
- String Resource type.
ApplicationCache.ApplicationCache Type
Detailed application cache information.
- manifestURL
- String Manifest URL.
- size
- Number Application cache size.
- creationTime
- Number Application cache creation time.
- updateTime
- Number Application cache update time.
- resources
- [ApplicationCache.ApplicationCacheResource] Application cache resources.
ApplicationCache.FrameWithManifest Type
Frame identifier - manifest URL pair.
- frameId
- Network.FrameId Frame identifier.
- manifestURL
- String Manifest URL.
- status
- Integer Application cache status.
ApplicationCache.getFramesWithManifests Command
Returns array of frame identifiers with manifest urls for each frame containing a document associated with some application cache.
Callback Parameters:
- frameIds
- [ApplicationCache.FrameWithManifest] Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache.
Code Example:
// WebInspector Command: ApplicationCache.getFramesWithManifests
ApplicationCache.getFramesWithManifests(function callback(res) {
// res = {frameIds}
});
ApplicationCache.enable Command
Enables application cache domain notifications.
Code Example:
// WebInspector Command: ApplicationCache.enable
ApplicationCache.enable();
ApplicationCache.getManifestForFrame Command
Returns manifest URL for document in the given frame.
- frameId
- Network.FrameId Identifier of the frame containing document whose manifest is retrieved.
Callback Parameters:
- manifestURL
- String Manifest URL for document in the given frame.
Code Example:
// WebInspector Command: ApplicationCache.getManifestForFrame
ApplicationCache.getManifestForFrame(frameId, function callback(res) {
// res = {manifestURL}
});
ApplicationCache.getApplicationCacheForFrame Command
Returns relevant application cache data for the document in given frame.
- frameId
- Network.FrameId Identifier of the frame containing document whose application cache is retrieved.
Callback Parameters:
- applicationCache
- ApplicationCache.ApplicationCache Relevant application cache data for the document in given frame.
Code Example:
// WebInspector Command: ApplicationCache.getApplicationCacheForFrame
ApplicationCache.getApplicationCacheForFrame(frameId, function callback(res) {
// res = {applicationCache}
});
ApplicationCache.applicationCacheStatusUpdated Event
- frameId
- Network.FrameId Identifier of the frame containing document whose application cache updated status.
- manifestURL
- String Manifest URL.
- status
- Integer Updated application cache status.
Code Example:
// WebInspector Event: ApplicationCache.applicationCacheStatusUpdated
function onApplicationCacheStatusUpdated(res) {
// res = {frameId, manifestURL, status}
}
ApplicationCache.networkStateUpdated Event
- isNowOnline
- Boolean
Code Example:
// WebInspector Event: ApplicationCache.networkStateUpdated
function onNetworkStateUpdated(res) {
// res = {isNowOnline}
}
CSS
This domain exposes CSS read/write operations. All CSS objects, like stylesheets, rules, and styles, have an associated id
used in subsequent operations on the related object. Each object type has a specific id
structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the get*ForNode()
calls (which accept a DOM node id). Alternatively, a client can discover all the existing stylesheets with the getAllStyleSheets()
method and subsequently load the required stylesheet contents using the getStyleSheet[Text]()
methods.
Type
Command
- CSS.enable: 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.
- CSS.disable: Disables the CSS agent for the given page.
- CSS.getMatchedStylesForNode: Returns requested styles for a DOM node identified by nodeId.
- CSS.getInlineStylesForNode: Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId.
- CSS.getComputedStyleForNode: Returns the computed style for a DOM node identified by nodeId.
- CSS.getAllStyleSheets: Returns metainfo entries for all known stylesheets.
- CSS.getStyleSheet: Returns stylesheet data for the specified styleSheetId.
- CSS.getStyleSheetText: Returns the current textual content and the URL for a stylesheet.
- CSS.setStyleSheetText: Sets the new stylesheet text, thereby invalidating all existing CSSStyleId's and CSSRuleId's contained by this stylesheet.
- CSS.setPropertyText: 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.
- CSS.toggleProperty: 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.
- CSS.setRuleSelector: Modifies the rule selector.
- CSS.addRule: Creates a new empty rule with the given selector in a special "inspector" stylesheet in the owner document of the context node.
- CSS.getSupportedCSSProperties: Returns all supported CSS property names.
- CSS.forcePseudoState: Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.
- CSS.startSelectorProfiler
- CSS.stopSelectorProfiler
- CSS.getNamedFlowCollection: Returns the Named Flows from the document.
Event
CSS.StyleSheetId Type
- String
CSS.CSSStyleId Type
This object identifies a CSS style in a unique way.
- styleSheetId
- CSS.StyleSheetId Enclosing stylesheet identifier.
- ordinal
- Integer The style ordinal within the stylesheet.
CSS.StyleSheetOrigin Type
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 )
CSS.CSSRuleId Type
This object identifies a CSS rule in a unique way.
- styleSheetId
- CSS.StyleSheetId Enclosing stylesheet identifier.
- ordinal
- Integer The rule ordinal within the stylesheet.
CSS.PseudoIdMatches Type
CSS rule collection for a single pseudo style.
- pseudoId
- Integer Pseudo style identifier (see
enum PseudoId
in RenderStyleConstants.h
).
- matches
- [CSS.RuleMatch] Matches of CSS rules applicable to the pseudo style.
CSS.InheritedStyleEntry Type
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.
CSS.RuleMatch Type
Match data for a CSS rule.
- rule
- CSS.CSSRule CSS rule in the match.
- matchingSelectors
- [Integer] Matching selector indices in the rule's selectorList selectors (0-based).
CSS.SelectorList Type
Selector list data.
- selectors
- [String] Selectors in the list.
- text
- String Rule selector text.
- range (optional)
- CSS.SourceRange Rule selector range in the underlying resource (if available).
CSS.CSSStyleAttribute Type
CSS style information for a DOM style attribute.
- name
- String DOM attribute name (e.g. "width").
- style
- CSS.CSSStyle CSS style generated by the respective DOM attribute.
CSS.CSSStyleSheetBody Type
CSS stylesheet contents.
- styleSheetId
- CSS.StyleSheetId The stylesheet identifier.
- rules
- [CSS.CSSRule] Stylesheet resource URL.
- text (optional)
- String Stylesheet resource contents (if available).
CSS.CSSRule Type
CSS rule representation.
- ruleId (optional)
- CSS.CSSRuleId The CSS rule identifier (absent for user agent stylesheet and user-specified stylesheet rules).
- selectorList
- CSS.SelectorList Rule selector data.
- sourceURL (optional)
- String Parent stylesheet resource URL (for regular rules).
- sourceLine
- Integer Line ordinal of the rule selector start character in the resource.
- origin
- CSS.StyleSheetOrigin Parent stylesheet's origin.
- style
- CSS.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.
CSS.SourceRange Type
Text range within a resource.
- start
- Integer Start of range (inclusive).
- end
- Integer End of range (exclusive).
CSS.ShorthandEntry Type
- name
- String Shorthand name.
- value
- String Shorthand value.
CSS.CSSPropertyInfo Type
- name
- String Property name.
- longhands (optional)
- [String] Longhand property names.
CSS.CSSComputedStyleProperty Type
- name
- String Computed style property name.
- value
- String Computed style property value.
CSS.CSSStyle Type
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.CSSProperty Type
CSS style effective visual dimensions and source offsets.
- name
- String The property name.
- value
- String 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" (implied if absent) 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" 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.SelectorProfileEntry Type
CSS selector profile entry.
- selector
- String CSS selector of the corresponding rule.
- url
- String URL of the resource containing the corresponding rule.
- lineNumber
- Integer Selector line number in the resource for the corresponding rule.
- time
- Number Total time this rule handling contributed to the browser running time during profiling (in milliseconds.)
- hitCount
- Integer Number of times this rule was considered a candidate for matching against DOM elements.
- matchCount
- Integer Number of times this rule actually matched a DOM element.
CSS.SelectorProfile Type
- totalTime
- Number Total processing time for all selectors in the profile (in milliseconds.)
- data
- [CSS.SelectorProfileEntry] CSS selector profile entries.
CSS.Region Type
This object represents a region that flows from a Named Flow.
- regionOverset
- ( overset | fit | empty ) The "overset" attribute of a Named Flow.
- nodeId
- DOM.NodeId The corresponding DOM node id.
CSS.NamedFlow Type
This object represents a Named Flow.
- documentNodeId
- DOM.NodeId The document node id.
- name
- String Named Flow identifier.
- overset
- Boolean 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.
CSS.enable Command
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.
Code Example:
// WebInspector Command: CSS.enable
CSS.enable();
CSS.disable Command
Disables the CSS agent for the given page.
Code Example:
// WebInspector Command: CSS.disable
CSS.disable();
CSS.getMatchedStylesForNode Command
Returns requested styles for a DOM node identified by nodeId
.
- nodeId
- DOM.NodeId
- includePseudo (optional)
- Boolean Whether to include pseudo styles (default: true).
- includeInherited (optional)
- Boolean Whether to include inherited styles (default: true).
Callback Parameters:
- 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).
Code Example:
// WebInspector Command: CSS.getMatchedStylesForNode
CSS.getMatchedStylesForNode(nodeId, includePseudo, includeInherited, function callback(res) {
// res = {matchedCSSRules, pseudoElements, inherited}
});
CSS.getInlineStylesForNode Command
Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId
.
- nodeId
- DOM.NodeId
Callback Parameters:
- 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%").
Code Example:
// WebInspector Command: CSS.getInlineStylesForNode
CSS.getInlineStylesForNode(nodeId, function callback(res) {
// res = {inlineStyle, attributesStyle}
});
CSS.getComputedStyleForNode Command
Returns the computed style for a DOM node identified by nodeId
.
- nodeId
- DOM.NodeId
Callback Parameters:
- computedStyle
- [CSS.CSSComputedStyleProperty] Computed style for the specified DOM node.
Code Example:
// WebInspector Command: CSS.getComputedStyleForNode
CSS.getComputedStyleForNode(nodeId, function callback(res) {
// res = {computedStyle}
});
CSS.getAllStyleSheets Command
Returns metainfo entries for all known stylesheets.
Callback Parameters:
- headers
- [CSS.CSSStyleSheetHeader] Descriptor entries for all available stylesheets.
Code Example:
// WebInspector Command: CSS.getAllStyleSheets
CSS.getAllStyleSheets(function callback(res) {
// res = {headers}
});
CSS.getStyleSheet Command
Returns stylesheet data for the specified styleSheetId
.
- styleSheetId
- CSS.StyleSheetId
Callback Parameters:
- styleSheet
- CSS.CSSStyleSheetBody Stylesheet contents for the specified
styleSheetId
.
Code Example:
// WebInspector Command: CSS.getStyleSheet
CSS.getStyleSheet(styleSheetId, function callback(res) {
// res = {styleSheet}
});
CSS.getStyleSheetText Command
Returns the current textual content and the URL for a stylesheet.
- styleSheetId
- CSS.StyleSheetId
Callback Parameters:
- text
- String The stylesheet text.
Code Example:
// WebInspector Command: CSS.getStyleSheetText
CSS.getStyleSheetText(styleSheetId, function callback(res) {
// res = {text}
});
CSS.setStyleSheetText Command
Sets the new stylesheet text, thereby invalidating all existing CSSStyleId
's and CSSRuleId
's contained by this stylesheet.
- styleSheetId
- CSS.StyleSheetId
- text
- String
Code Example:
// WebInspector Command: CSS.setStyleSheetText
CSS.setStyleSheetText(styleSheetId, text);
CSS.setPropertyText Command
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
.
- styleId
- CSS.CSSStyleId
- propertyIndex
- Integer
- text
- String
- overwrite
- Boolean
Callback Parameters:
- style
- CSS.CSSStyle The resulting style after the property text modification.
Code Example:
// WebInspector Command: CSS.setPropertyText
CSS.setPropertyText(styleId, propertyIndex, text, overwrite, function callback(res) {
// res = {style}
});
CSS.toggleProperty Command
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.
- styleId
- CSS.CSSStyleId
- propertyIndex
- Integer
- disable
- Boolean
Callback Parameters:
- style
- CSS.CSSStyle The resulting style after the property toggling.
Code Example:
// WebInspector Command: CSS.toggleProperty
CSS.toggleProperty(styleId, propertyIndex, disable, function callback(res) {
// res = {style}
});
CSS.setRuleSelector Command
Modifies the rule selector.
- ruleId
- CSS.CSSRuleId
- selector
- String
Callback Parameters:
- rule
- CSS.CSSRule The resulting rule after the selector modification.
Code Example:
// WebInspector Command: CSS.setRuleSelector
CSS.setRuleSelector(ruleId, selector, function callback(res) {
// res = {rule}
});
CSS.addRule Command
Creates a new empty rule with the given selector
in a special "inspector" stylesheet in the owner document of the context node.
- contextNodeId
- DOM.NodeId
- selector
- String
Callback Parameters:
- rule
- CSS.CSSRule The newly created rule.
Code Example:
// WebInspector Command: CSS.addRule
CSS.addRule(contextNodeId, selector, function callback(res) {
// res = {rule}
});
CSS.getSupportedCSSProperties Command
Returns all supported CSS property names.
Callback Parameters:
- cssProperties
- [CSS.CSSPropertyInfo] Supported property metainfo.
Code Example:
// WebInspector Command: CSS.getSupportedCSSProperties
CSS.getSupportedCSSProperties(function callback(res) {
// res = {cssProperties}
});
CSS.forcePseudoState Command
Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.
- nodeId
- DOM.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.
Code Example:
// WebInspector Command: CSS.forcePseudoState
CSS.forcePseudoState(nodeId, forcedPseudoClasses);
CSS.startSelectorProfiler Command
Code Example:
// WebInspector Command: CSS.startSelectorProfiler
CSS.startSelectorProfiler();
CSS.stopSelectorProfiler Command
Callback Parameters:
- profile
- CSS.SelectorProfile
Code Example:
// WebInspector Command: CSS.stopSelectorProfiler
CSS.stopSelectorProfiler(function callback(res) {
// res = {profile}
});
CSS.getNamedFlowCollection Command
Returns the Named Flows from the document.
- documentNodeId
- DOM.NodeId The document node id for which to get the Named Flow Collection.
Callback Parameters:
- namedFlows
- [CSS.NamedFlow] An array containing the Named Flows in the document.
Code Example:
// WebInspector Command: CSS.getNamedFlowCollection
CSS.getNamedFlowCollection(documentNodeId, function callback(res) {
// res = {namedFlows}
});
CSS.styleSheetChanged Event
Fired whenever a stylesheet is changed as a result of the client operation.
- styleSheetId
- CSS.StyleSheetId
Code Example:
// WebInspector Event: CSS.styleSheetChanged
function onStyleSheetChanged(res) {
// res = {styleSheetId}
}
CSS.namedFlowCreated Event
Fires when a Named Flow is created.
- namedFlow
- CSS.NamedFlow The new Named Flow.
Code Example:
// WebInspector Event: CSS.namedFlowCreated
function onNamedFlowCreated(res) {
// res = {namedFlow}
}
CSS.namedFlowRemoved Event
Fires when a Named Flow is removed: has no associated content nodes and regions.
- documentNodeId
- DOM.NodeId The document node id.
- flowName
- String Identifier of the removed Named Flow.
Code Example:
// WebInspector Event: CSS.namedFlowRemoved
function onNamedFlowRemoved(res) {
// res = {documentNodeId, flowName}
}
CSS.regionLayoutUpdated Event
Fires when a Named Flow's layout may have changed.
- namedFlow
- CSS.NamedFlow The Named Flow whose layout may have changed.
Code Example:
// WebInspector Event: CSS.regionLayoutUpdated
function onRegionLayoutUpdated(res) {
// res = {namedFlow}
}
Console
Console domain defines methods and events for interaction with the JavaScript console. Console collects messages created by means of the JavaScript Console API. One needs to enable this domain using enable
command in order to start receiving the console messages. Browser collects messages issued while console domain is not enabled as well and reports them using messageAdded
notification upon enabling.
Type
Command
Event
Console.ConsoleMessage Type
Console message.
- source
- ( html | wml | xml | javascript | network | console-api | other ) Message source.
- level
- ( tip | log | warning | error | debug ) Message severity.
- text
- String Message text.
- type (optional)
- ( log | dir | dirxml | trace | startGroup | startGroupCollapsed | endGroup | assert ) Console message type.
- url (optional)
- String URL of the message origin.
- line (optional)
- Integer Line 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.
Console.CallFrame Type
Stack entry for console errors and assertions.
- functionName
- String JavaScript function name.
- url
- String JavaScript script name or url.
- lineNumber
- Integer JavaScript script line number.
- columnNumber
- Integer JavaScript script column number.
Console.StackTrace Type
Call frames for assertions or error messages.
- [Console.CallFrame]
Console.enable Command
Enables console domain, sends the messages collected so far to the client by means of the messageAdded
notification.
Code Example:
// WebInspector Command: Console.enable
Console.enable();
Console.disable Command
Disables console domain, prevents further console messages from being reported to the client.
Code Example:
// WebInspector Command: Console.disable
Console.disable();
Console.clearMessages Command
Clears console messages collected in the browser.
Code Example:
// WebInspector Command: Console.clearMessages
Console.clearMessages();
Console.setMonitoringXHREnabled Command
Toggles monitoring of XMLHttpRequest. If true
, console will receive messages upon each XHR issued.
- enabled
- Boolean Monitoring enabled state.
Code Example:
// WebInspector Command: Console.setMonitoringXHREnabled
Console.setMonitoringXHREnabled(enabled);
Console.addInspectedNode Command
Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
- nodeId
- DOM.NodeId DOM node id to be accessible by means of $x command line API.
Code Example:
// WebInspector Command: Console.addInspectedNode
Console.addInspectedNode(nodeId);
Console.addInspectedHeapObject Command
- heapObjectId
- Integer
Code Example:
// WebInspector Command: Console.addInspectedHeapObject
Console.addInspectedHeapObject(heapObjectId);
Console.messageAdded Event
Issued when new console message is added.
- message
- Console.ConsoleMessage Console message that has been added.
Code Example:
// WebInspector Event: Console.messageAdded
function onMessageAdded(res) {
// res = {message}
}
Console.messageRepeatCountUpdated Event
Issued when subsequent message(s) are equal to the previous one(s).
- count
- Integer New repeat count value.
Code Example:
// WebInspector Event: Console.messageRepeatCountUpdated
function onMessageRepeatCountUpdated(res) {
// res = {count}
}
Console.messagesCleared Event
Issued when console is cleared. This happens either upon clearMessages
command or after page navigation.
Code Example:
// WebInspector Event: Console.messagesCleared
function onMessagesCleared(res) {
// res = {}
}
DOM
This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an id
. This id
can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client's responsibility to collect information about the nodes that were sent to the client.
Note that iframe
owner elements will return corresponding document elements as their child nodes.
Type
- DOM.NodeId: Unique DOM node identifier.
- DOM.Node: DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
- DOM.EventListener: DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
- DOM.RGBA: A structure holding an RGBA color.
- DOM.HighlightConfig: Configuration data for the highlighting of page elements.
Command
Event
DOM.NodeId Type
Unique DOM node identifier.
- Integer
DOM.Node Type
DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
- nodeId
- DOM.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.
- nodeType
- Integer
Node
's nodeType.
- nodeName
- String
Node
's nodeName.
- localName
- String
Node
's localName.
- nodeValue
- String
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.
- contentDocument (optional)
- DOM.Node Content document for frame owner elements.
- shadowRoots (optional)
- [DOM.Node] Shadow root list for given element host.
DOM.EventListener Type
DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
- type
- String
EventListener
's type.
- useCapture
- Boolean
EventListener
's useCapture.
- isAttribute
- Boolean
EventListener
's isAttribute.
- nodeId
- DOM.NodeId Target
DOMNode
id.
- handlerBody
- String Event handler function body.
- location (optional)
- Debugger.Location Handler code location.
- sourceName (optional)
- String Source script URL.
DOM.RGBA Type
A structure holding an RGBA color.
- r
- Integer The red component, in the [0-255] range.
- g
- Integer The green component, in the [0-255] range.
- b
- Integer The blue component, in the [0-255] range.
- a (optional)
- Number The alpha component, in the [0-1] range (default: 1).
DOM.HighlightConfig Type
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).
DOM.getDocument Command
Returns the root DOM node to the caller.
Callback Parameters:
- root
- DOM.Node Resulting node.
Code Example:
// WebInspector Command: DOM.getDocument
DOM.getDocument(function callback(res) {
// res = {root}
});
DOM.requestChildNodes Command
Requests that children of the node with given id are returned to the caller in form of setChildNodes
events.
- nodeId
- DOM.NodeId Id of the node to get children for.
Code Example:
// WebInspector Command: DOM.requestChildNodes
DOM.requestChildNodes(nodeId);
DOM.querySelector Command
Executes querySelector
on a given node.
- nodeId
- DOM.NodeId Id of the node to query upon.
- selector
- String Selector string.
Callback Parameters:
- nodeId
- DOM.NodeId Query selector result.
Code Example:
// WebInspector Command: DOM.querySelector
DOM.querySelector(nodeId, selector, function callback(res) {
// res = {nodeId}
});
DOM.querySelectorAll Command
Executes querySelectorAll
on a given node.
- nodeId
- DOM.NodeId Id of the node to query upon.
- selector
- String Selector string.
Callback Parameters:
- nodeIds
- [DOM.NodeId] Query selector result.
Code Example:
// WebInspector Command: DOM.querySelectorAll
DOM.querySelectorAll(nodeId, selector, function callback(res) {
// res = {nodeIds}
});
DOM.setNodeName Command
Sets node name for a node with given id.
- nodeId
- DOM.NodeId Id of the node to set name for.
- name
- String New node's name.
Callback Parameters:
- nodeId
- DOM.NodeId New node's id.
Code Example:
// WebInspector Command: DOM.setNodeName
DOM.setNodeName(nodeId, name, function callback(res) {
// res = {nodeId}
});
DOM.setNodeValue Command
Sets node value for a node with given id.
- nodeId
- DOM.NodeId Id of the node to set value for.
- value
- String New node's value.
Code Example:
// WebInspector Command: DOM.setNodeValue
DOM.setNodeValue(nodeId, value);
DOM.removeNode Command
Removes node with given id.
- nodeId
- DOM.NodeId Id of the node to remove.
Code Example:
// WebInspector Command: DOM.removeNode
DOM.removeNode(nodeId);
DOM.setAttributeValue Command
Sets attribute for an element with given id.
- nodeId
- DOM.NodeId Id of the element to set attribute for.
- name
- String Attribute name.
- value
- String Attribute value.
Code Example:
// WebInspector Command: DOM.setAttributeValue
DOM.setAttributeValue(nodeId, name, value);
DOM.setAttributesAsText Command
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.
- nodeId
- DOM.NodeId Id of the element to set attributes for.
- text
- String 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.
Code Example:
// WebInspector Command: DOM.setAttributesAsText
DOM.setAttributesAsText(nodeId, text, name);
DOM.removeAttribute Command
Removes attribute with given name from an element with given id.
- nodeId
- DOM.NodeId Id of the element to remove attribute from.
- name
- String Name of the attribute to remove.
Code Example:
// WebInspector Command: DOM.removeAttribute
DOM.removeAttribute(nodeId, name);
DOM.getEventListenersForNode Command
Returns event listeners relevant to the node.
- nodeId
- DOM.NodeId Id of the node to get listeners for.
Callback Parameters:
- listeners
- [DOM.EventListener] Array of relevant listeners.
Code Example:
// WebInspector Command: DOM.getEventListenersForNode
DOM.getEventListenersForNode(nodeId, function callback(res) {
// res = {listeners}
});
DOM.getOuterHTML Command
Returns node's HTML markup.
- nodeId
- DOM.NodeId Id of the node to get markup for.
Callback Parameters:
- outerHTML
- String Outer HTML markup.
Code Example:
// WebInspector Command: DOM.getOuterHTML
DOM.getOuterHTML(nodeId, function callback(res) {
// res = {outerHTML}
});
DOM.setOuterHTML Command
Sets node HTML markup, returns new node id.
- nodeId
- DOM.NodeId Id of the node to set markup for.
- outerHTML
- String Outer HTML markup to set.
Code Example:
// WebInspector Command: DOM.setOuterHTML
DOM.setOuterHTML(nodeId, outerHTML);
DOM.getSearchResults Command
Returns search results from given fromIndex
to given toIndex
from the sarch with the given identifier.
- searchId
- String Unique search session identifier.
- fromIndex
- Integer Start index of the search result to be returned.
- toIndex
- Integer End index of the search result to be returned.
Callback Parameters:
- nodeIds
- [DOM.NodeId] Ids of the search result nodes.
Code Example:
// WebInspector Command: DOM.getSearchResults
DOM.getSearchResults(searchId, fromIndex, toIndex, function callback(res) {
// res = {nodeIds}
});
DOM.discardSearchResults Command
Discards search results from the session with the given id. getSearchResults
should no longer be called for that search.
- searchId
- String Unique search session identifier.
Code Example:
// WebInspector Command: DOM.discardSearchResults
DOM.discardSearchResults(searchId);
DOM.requestNode Command
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.
- objectId
- Runtime.RemoteObjectId JavaScript object id to convert into node.
Callback Parameters:
- nodeId
- DOM.NodeId Node id for given object.
Code Example:
// WebInspector Command: DOM.requestNode
DOM.requestNode(objectId, function callback(res) {
// res = {nodeId}
});
DOM.setInspectModeEnabled Command
Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspect' command upon element selection.
- enabled
- Boolean True to enable inspection mode, false to disable it.
- highlightConfig (optional)
- DOM.HighlightConfig A descriptor for the highlight appearance of hovered-over nodes. May be omitted if
enabled == false
.
Code Example:
// WebInspector Command: DOM.setInspectModeEnabled
DOM.setInspectModeEnabled(enabled, highlightConfig);
DOM.highlightRect Command
Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.
- x
- Integer X coordinate
- y
- Integer Y coordinate
- width
- Integer Rectangle width
- height
- Integer Rectangle height
- color (optional)
- DOM.RGBA The highlight fill color (default: transparent).
- outlineColor (optional)
- DOM.RGBA The highlight outline color (default: transparent).
Code Example:
// WebInspector Command: DOM.highlightRect
DOM.highlightRect(x, y, width, height, color, outlineColor);
DOM.highlightNode Command
Highlights DOM node with given id.
- nodeId
- DOM.NodeId Identifier of the node to highlight.
- highlightConfig
- DOM.HighlightConfig A descriptor for the highlight appearance.
Code Example:
// WebInspector Command: DOM.highlightNode
DOM.highlightNode(nodeId, highlightConfig);
DOM.hideHighlight Command
Hides DOM node highlight.
Code Example:
// WebInspector Command: DOM.hideHighlight
DOM.hideHighlight();
DOM.highlightFrame Command
Highlights owner element of the frame with given id.
- frameId
- Network.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).
Code Example:
// WebInspector Command: DOM.highlightFrame
DOM.highlightFrame(frameId, contentColor, contentOutlineColor);
DOM.pushNodeByPathToFrontend Command
Requests that the node is sent to the caller given its path. // FIXME, use XPath
- path
- String Path to node in the proprietary format.
Callback Parameters:
- nodeId
- DOM.NodeId Id of the node for given path.
Code Example:
// WebInspector Command: DOM.pushNodeByPathToFrontend
DOM.pushNodeByPathToFrontend(path, function callback(res) {
// res = {nodeId}
});
DOM.resolveNode Command
Resolves JavaScript node object for given node id.
- nodeId
- DOM.NodeId Id of the node to resolve.
- objectGroup (optional)
- String Symbolic group name that can be used to release multiple objects.
Callback Parameters:
- object
- Runtime.RemoteObject JavaScript object wrapper for given node.
Code Example:
// WebInspector Command: DOM.resolveNode
DOM.resolveNode(nodeId, objectGroup, function callback(res) {
// res = {object}
});
DOM.getAttributes Command
Returns attributes for the specified node.
- nodeId
- DOM.NodeId Id of the node to retrieve attibutes for.
Callback Parameters:
- attributes
- [String] An interleaved array of node attribute names and values.
Code Example:
// WebInspector Command: DOM.getAttributes
DOM.getAttributes(nodeId, function callback(res) {
// res = {attributes}
});
DOM.moveTo Command
Moves node into the new container, places it before the given anchor.
- nodeId
- DOM.NodeId Id of the node to drop.
- targetNodeId
- DOM.NodeId Id of the element to drop into.
- insertBeforeNodeId (optional)
- DOM.NodeId Drop node before given one.
Callback Parameters:
- nodeId
- DOM.NodeId New id of the moved node.
Code Example:
// WebInspector Command: DOM.moveTo
DOM.moveTo(nodeId, targetNodeId, insertBeforeNodeId, function callback(res) {
// res = {nodeId}
});
DOM.undo Command
Undoes the last performed action.
Code Example:
// WebInspector Command: DOM.undo
DOM.undo();
DOM.redo Command
Re-does the last undone action.
Code Example:
// WebInspector Command: DOM.redo
DOM.redo();
DOM.markUndoableState Command
Marks last undoable state.
Code Example:
// WebInspector Command: DOM.markUndoableState
DOM.markUndoableState();
DOM.documentUpdated Event
Fired when Document
has been totally updated. Node ids are no longer valid.
Code Example:
// WebInspector Event: DOM.documentUpdated
function onDocumentUpdated(res) {
// res = {}
}
DOM.setChildNodes Event
Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.
- parentId
- DOM.NodeId Parent node id to populate with children.
- nodes
- [DOM.Node] Child nodes array.
Code Example:
// WebInspector Event: DOM.setChildNodes
function onSetChildNodes(res) {
// res = {parentId, nodes}
}
DOM.attributeModified Event
Fired when Element
's attribute is modified.
- nodeId
- DOM.NodeId Id of the node that has changed.
- name
- String Attribute name.
- value
- String Attribute value.
Code Example:
// WebInspector Event: DOM.attributeModified
function onAttributeModified(res) {
// res = {nodeId, name, value}
}
DOM.attributeRemoved Event
Fired when Element
's attribute is removed.
- nodeId
- DOM.NodeId Id of the node that has changed.
- name
- String A ttribute name.
Code Example:
// WebInspector Event: DOM.attributeRemoved
function onAttributeRemoved(res) {
// res = {nodeId, name}
}
DOM.inlineStyleInvalidated Event
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.
Code Example:
// WebInspector Event: DOM.inlineStyleInvalidated
function onInlineStyleInvalidated(res) {
// res = {nodeIds}
}
DOM.characterDataModified Event
Mirrors DOMCharacterDataModified
event.
- nodeId
- DOM.NodeId Id of the node that has changed.
- characterData
- String New text value.
Code Example:
// WebInspector Event: DOM.characterDataModified
function onCharacterDataModified(res) {
// res = {nodeId, characterData}
}
DOM.childNodeCountUpdated Event
Fired when Container
's child node count has changed.
- nodeId
- DOM.NodeId Id of the node that has changed.
- childNodeCount
- Integer New node count.
Code Example:
// WebInspector Event: DOM.childNodeCountUpdated
function onChildNodeCountUpdated(res) {
// res = {nodeId, childNodeCount}
}
DOM.childNodeInserted Event
Mirrors DOMNodeInserted
event.
- parentNodeId
- DOM.NodeId Id of the node that has changed.
- previousNodeId
- DOM.NodeId If of the previous siblint.
- node
- DOM.Node Inserted node data.
Code Example:
// WebInspector Event: DOM.childNodeInserted
function onChildNodeInserted(res) {
// res = {parentNodeId, previousNodeId, node}
}
DOM.childNodeRemoved Event
Mirrors DOMNodeRemoved
event.
- parentNodeId
- DOM.NodeId Parent id.
- nodeId
- DOM.NodeId Id of the node that has been removed.
Code Example:
// WebInspector Event: DOM.childNodeRemoved
function onChildNodeRemoved(res) {
// res = {parentNodeId, nodeId}
}
DOM.shadowRootPushed Event
Called when shadow root is pushed into the element.
- hostId
- DOM.NodeId Host element id.
- root
- DOM.Node Shadow root.
Code Example:
// WebInspector Event: DOM.shadowRootPushed
function onShadowRootPushed(res) {
// res = {hostId, root}
}
DOM.shadowRootPopped Event
Called when shadow root is popped from the element.
- hostId
- DOM.NodeId Host element id.
- rootId
- DOM.NodeId Shadow root id.
Code Example:
// WebInspector Event: DOM.shadowRootPopped
function onShadowRootPopped(res) {
// res = {hostId, rootId}
}
DOMDebugger
DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript execution will stop on these operations as if there was a regular breakpoint set.
Type
Command
DOMDebugger.DOMBreakpointType Type
DOM breakpoint type.
- ( subtree-modified | attribute-modified | node-removed )
DOMDebugger.setDOMBreakpoint Command
Sets breakpoint on particular operation with DOM.
- nodeId
- DOM.NodeId Identifier of the node to set breakpoint on.
- type
- DOMDebugger.DOMBreakpointType Type of the operation to stop upon.
Code Example:
// WebInspector Command: DOMDebugger.setDOMBreakpoint
DOMDebugger.setDOMBreakpoint(nodeId, type);
DOMDebugger.removeDOMBreakpoint Command
Removes DOM breakpoint that was set using setDOMBreakpoint
.
- nodeId
- DOM.NodeId Identifier of the node to remove breakpoint from.
- type
- DOMDebugger.DOMBreakpointType Type of the breakpoint to remove.
Code Example:
// WebInspector Command: DOMDebugger.removeDOMBreakpoint
DOMDebugger.removeDOMBreakpoint(nodeId, type);
DOMDebugger.setEventListenerBreakpoint Command
Sets breakpoint on particular DOM event.
- eventName
- String DOM Event name to stop on (any DOM event will do).
Code Example:
// WebInspector Command: DOMDebugger.setEventListenerBreakpoint
DOMDebugger.setEventListenerBreakpoint(eventName);
DOMDebugger.removeEventListenerBreakpoint Command
Removes breakpoint on particular DOM event.
- eventName
- String Event name.
Code Example:
// WebInspector Command: DOMDebugger.removeEventListenerBreakpoint
DOMDebugger.removeEventListenerBreakpoint(eventName);
DOMDebugger.setInstrumentationBreakpoint Command
Sets breakpoint on particular native event.
- eventName
- String Instrumentation name to stop on.
Code Example:
// WebInspector Command: DOMDebugger.setInstrumentationBreakpoint
DOMDebugger.setInstrumentationBreakpoint(eventName);
DOMDebugger.removeInstrumentationBreakpoint Command
Sets breakpoint on particular native event.
- eventName
- String Instrumentation name to stop on.
Code Example:
// WebInspector Command: DOMDebugger.removeInstrumentationBreakpoint
DOMDebugger.removeInstrumentationBreakpoint(eventName);
DOMDebugger.setXHRBreakpoint Command
Sets breakpoint on XMLHttpRequest.
- url
- String Resource URL substring. All XHRs having this substring in the URL will get stopped upon.
Code Example:
// WebInspector Command: DOMDebugger.setXHRBreakpoint
DOMDebugger.setXHRBreakpoint(url);
DOMDebugger.removeXHRBreakpoint Command
Removes breakpoint from XMLHttpRequest.
- url
- String Resource URL substring.
Code Example:
// WebInspector Command: DOMDebugger.removeXHRBreakpoint
DOMDebugger.removeXHRBreakpoint(url);
DOMStorage
Type
Command
Event
DOMStorage.StorageId Type
Unique identifier of DOM storage entry.
- String
DOMStorage.Entry Type
DOM Storage entry.
- origin
- String Document origin.
- isLocalStorage
- Boolean True for local storage.
- id
- DOMStorage.StorageId Entry id for further reference.
DOMStorage.Item Type
DOM Storage item.
- [String]
DOMStorage.enable Command
Enables storage tracking, storage events will now be delivered to the client.
Code Example:
// WebInspector Command: DOMStorage.enable
DOMStorage.enable();
DOMStorage.disable Command
Disables storage tracking, prevents storage events from being sent to the client.
Code Example:
// WebInspector Command: DOMStorage.disable
DOMStorage.disable();
DOMStorage.getDOMStorageEntries Command
- storageId
- DOMStorage.StorageId
Callback Parameters:
- entries
- [DOMStorage.Item]
Code Example:
// WebInspector Command: DOMStorage.getDOMStorageEntries
DOMStorage.getDOMStorageEntries(storageId, function callback(res) {
// res = {entries}
});
DOMStorage.setDOMStorageItem Command
- storageId
- DOMStorage.StorageId
- key
- String
- value
- String
Callback Parameters:
- success
- Boolean
Code Example:
// WebInspector Command: DOMStorage.setDOMStorageItem
DOMStorage.setDOMStorageItem(storageId, key, value, function callback(res) {
// res = {success}
});
DOMStorage.removeDOMStorageItem Command
- storageId
- DOMStorage.StorageId
- key
- String
Callback Parameters:
- success
- Boolean
Code Example:
// WebInspector Command: DOMStorage.removeDOMStorageItem
DOMStorage.removeDOMStorageItem(storageId, key, function callback(res) {
// res = {success}
});
DOMStorage.addDOMStorage Event
- storage
- DOMStorage.Entry
Code Example:
// WebInspector Event: DOMStorage.addDOMStorage
function onAddDOMStorage(res) {
// res = {storage}
}
DOMStorage.domStorageUpdated Event
- storageId
- DOMStorage.StorageId
Code Example:
// WebInspector Event: DOMStorage.domStorageUpdated
function onDomStorageUpdated(res) {
// res = {storageId}
}
Database
Type
Command
Event
Database.DatabaseId Type
Unique identifier of Database object.
- String
Database.Database Type
Database object.
- id
- Database.DatabaseId Database ID.
- domain
- String Database domain.
- name
- String Database name.
- version
- String Database version.
Database.Error Type
Database error.
- message
- String Error message.
- code
- Integer Error code.
Database.enable Command
Enables database tracking, database events will now be delivered to the client.
Code Example:
// WebInspector Command: Database.enable
Database.enable();
Database.disable Command
Disables database tracking, prevents database events from being sent to the client.
Code Example:
// WebInspector Command: Database.disable
Database.disable();
Database.getDatabaseTableNames Command
- databaseId
- Database.DatabaseId
Callback Parameters:
- tableNames
- [String]
Code Example:
// WebInspector Command: Database.getDatabaseTableNames
Database.getDatabaseTableNames(databaseId, function callback(res) {
// res = {tableNames}
});
Database.executeSQL Command
- databaseId
- Database.DatabaseId
- query
- String
Callback Parameters:
- columnNames (optional)
- [String]
- values (optional)
- [Any]
- sqlError (optional)
- Database.Error
Code Example:
// WebInspector Command: Database.executeSQL
Database.executeSQL(databaseId, query, function callback(res) {
// res = {columnNames, values, sqlError}
});
Database.addDatabase Event
- database
- Database.Database
Code Example:
// WebInspector Event: Database.addDatabase
function onAddDatabase(res) {
// res = {database}
}
Debugger
Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.
Type
Command
Event
Debugger.BreakpointId Type
Breakpoint identifier.
- String
Debugger.ScriptId Type
Unique script identifier.
- String
Debugger.CallFrameId Type
Call frame identifier.
- String
Debugger.Location Type
Location in the source code.
- scriptId
- Debugger.ScriptId Script identifier as reported in the
Debugger.scriptParsed
.
- lineNumber
- Integer Line number in the script.
- columnNumber (optional)
- Integer Column number in the script.
Debugger.FunctionDetails Type
Information about the function.
- location
- Debugger.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.
Debugger.CallFrame Type
JavaScript call frame. Array of call frames form the call stack.
- callFrameId
- Debugger.CallFrameId Call frame identifier. This identifier is only valid while the virtual machine is paused.
- functionName
- String Name of the JavaScript function called on this call frame.
- location
- Debugger.Location Location in the source code.
- scopeChain
- [Debugger.Scope] Scope chain for this call frame.
- this
- Runtime.RemoteObject
this
object for this call frame.
Debugger.Scope Type
Scope description.
- type
- ( global | local | with | closure | catch ) Scope type.
- object
- Runtime.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.
Debugger.causesRecompilation Command
Tells whether enabling debugger causes scripts recompilation.
Callback Parameters:
- result
- Boolean True if enabling debugger causes scripts recompilation.
Code Example:
// WebInspector Command: Debugger.causesRecompilation
Debugger.causesRecompilation(function callback(res) {
// res = {result}
});
Debugger.supportsSeparateScriptCompilationAndExecution Command
Tells whether debugger supports separate script compilation and execution.
Callback Parameters:
- result
- Boolean True if debugger supports separate script compilation and execution.
Code Example:
// WebInspector Command: Debugger.supportsSeparateScriptCompilationAndExecution
Debugger.supportsSeparateScriptCompilationAndExecution(function callback(res) {
// res = {result}
});
Debugger.enable Command
Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
Code Example:
// WebInspector Command: Debugger.enable
Debugger.enable();
Debugger.disable Command
Disables debugger for given page.
Code Example:
// WebInspector Command: Debugger.disable
Debugger.disable();
Debugger.setBreakpointsActive Command
Activates / deactivates all breakpoints on the page.
- active
- Boolean New value for breakpoints active state.
Code Example:
// WebInspector Command: Debugger.setBreakpointsActive
Debugger.setBreakpointsActive(active);
Debugger.setBreakpointByUrl Command
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.
- lineNumber
- Integer 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.
Callback Parameters:
- breakpointId
- Debugger.BreakpointId Id of the created breakpoint for further reference.
- locations
- [Debugger.Location] List of the locations this breakpoint resolved into upon addition.
Code Example:
// WebInspector Command: Debugger.setBreakpointByUrl
Debugger.setBreakpointByUrl(lineNumber, url, urlRegex, columnNumber, condition, function callback(res) {
// res = {breakpointId, locations}
});
Debugger.setBreakpoint Command
Sets JavaScript breakpoint at a given location.
- location
- Debugger.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.
Callback Parameters:
- breakpointId
- Debugger.BreakpointId Id of the created breakpoint for further reference.
- actualLocation
- Debugger.Location Location this breakpoint resolved into.
Code Example:
// WebInspector Command: Debugger.setBreakpoint
Debugger.setBreakpoint(location, condition, function callback(res) {
// res = {breakpointId, actualLocation}
});
Debugger.removeBreakpoint Command
Removes JavaScript breakpoint.
- breakpointId
- Debugger.BreakpointId
Code Example:
// WebInspector Command: Debugger.removeBreakpoint
Debugger.removeBreakpoint(breakpointId);
Debugger.continueToLocation Command
Continues execution until specific location is reached.
- location
- Debugger.Location Location to continue to.
Code Example:
// WebInspector Command: Debugger.continueToLocation
Debugger.continueToLocation(location);
Debugger.stepOver Command
Steps over the statement.
Code Example:
// WebInspector Command: Debugger.stepOver
Debugger.stepOver();
Debugger.stepInto Command
Steps into the function call.
Code Example:
// WebInspector Command: Debugger.stepInto
Debugger.stepInto();
Debugger.stepOut Command
Steps out of the function call.
Code Example:
// WebInspector Command: Debugger.stepOut
Debugger.stepOut();
Debugger.pause Command
Stops on the next JavaScript statement.
Code Example:
// WebInspector Command: Debugger.pause
Debugger.pause();
Debugger.resume Command
Resumes JavaScript execution.
Code Example:
// WebInspector Command: Debugger.resume
Debugger.resume();
Debugger.searchInContent Command
Searches for given string in script content.
- scriptId
- Debugger.ScriptId Id of the script to search in.
- query
- String String to search for.
- caseSensitive (optional)
- Boolean If true, search is case sensitive.
- isRegex (optional)
- Boolean If true, treats string parameter as regex.
Callback Parameters:
- result
- [Page.SearchMatch] List of search matches.
Code Example:
// WebInspector Command: Debugger.searchInContent
Debugger.searchInContent(scriptId, query, caseSensitive, isRegex, function callback(res) {
// res = {result}
});
Debugger.canSetScriptSource Command
Tells whether setScriptSource
is supported.
Callback Parameters:
- result
- Boolean True if
setScriptSource
is supported.
Code Example:
// WebInspector Command: Debugger.canSetScriptSource
Debugger.canSetScriptSource(function callback(res) {
// res = {result}
});
Debugger.setScriptSource Command
Edits JavaScript source live.
- scriptId
- Debugger.ScriptId Id of the script to edit.
- scriptSource
- String 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.
Callback Parameters:
- 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.
Code Example:
// WebInspector Command: Debugger.setScriptSource
Debugger.setScriptSource(scriptId, scriptSource, preview, function callback(res) {
// res = {callFrames, result}
});
Debugger.restartFrame Command
Restarts particular call frame from the beginning.
- callFrameId
- Debugger.CallFrameId Call frame identifier to evaluate on.
Callback Parameters:
- callFrames
- [Debugger.CallFrame] New stack trace.
- result
- Object VM-specific description.
Code Example:
// WebInspector Command: Debugger.restartFrame
Debugger.restartFrame(callFrameId, function callback(res) {
// res = {callFrames, result}
});
Debugger.getScriptSource Command
Returns source for the script with given id.
- scriptId
- Debugger.ScriptId Id of the script to get source for.
Callback Parameters:
- scriptSource
- String Script source.
Code Example:
// WebInspector Command: Debugger.getScriptSource
Debugger.getScriptSource(scriptId, function callback(res) {
// res = {scriptSource}
});
Debugger.getFunctionDetails Command
Returns detailed informtation on given function.
- functionId
- Runtime.RemoteObjectId Id of the function to get location for.
Callback Parameters:
- details
- Debugger.FunctionDetails Information about the function.
Code Example:
// WebInspector Command: Debugger.getFunctionDetails
Debugger.getFunctionDetails(functionId, function callback(res) {
// res = {details}
});
Debugger.setPauseOnExceptions Command
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.
Code Example:
// WebInspector Command: Debugger.setPauseOnExceptions
Debugger.setPauseOnExceptions(state);
Debugger.evaluateOnCallFrame Command
Evaluates expression on a given call frame.
- callFrameId
- Debugger.CallFrameId Call frame identifier to evaluate on.
- expression
- String 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.
Callback Parameters:
- result
- Runtime.RemoteObject Object wrapper for the evaluation result.
- wasThrown (optional)
- Boolean True if the result was thrown during the evaluation.
Code Example:
// WebInspector Command: Debugger.evaluateOnCallFrame
Debugger.evaluateOnCallFrame(callFrameId, expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, function callback(res) {
// res = {result, wasThrown}
});
Debugger.compileScript Command
Compiles expression.
- expression
- String Expression to compile.
- sourceURL
- String Source url to be set for the script.
Callback Parameters:
- scriptId (optional)
- Debugger.ScriptId Id of the script.
- syntaxErrorMessage (optional)
- String Syntax error message if compilation failed.
Code Example:
// WebInspector Command: Debugger.compileScript
Debugger.compileScript(expression, sourceURL, function callback(res) {
// res = {scriptId, syntaxErrorMessage}
});
Debugger.runScript Command
Runs script with given id in a given context.
- scriptId
- Debugger.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.
Callback Parameters:
- result
- Runtime.RemoteObject Run result.
- wasThrown (optional)
- Boolean True if the result was thrown during the script run.
Code Example:
// WebInspector Command: Debugger.runScript
Debugger.runScript(scriptId, contextId, objectGroup, doNotPauseOnExceptionsAndMuteConsole, function callback(res) {
// res = {result, wasThrown}
});
Debugger.setOverlayMessage Command
Sets overlay message.
- message (optional)
- String Overlay message to display when paused in debugger.
Code Example:
// WebInspector Command: Debugger.setOverlayMessage
Debugger.setOverlayMessage(message);
Debugger.globalObjectCleared Event
Called when global has been cleared and debugger client should reset its state. Happens upon navigation or reload.
Code Example:
// WebInspector Event: Debugger.globalObjectCleared
function onGlobalObjectCleared(res) {
// res = {}
}
Debugger.scriptParsed Event
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
- scriptId
- Debugger.ScriptId Identifier of the script parsed.
- url
- String URL or name of the script parsed (if any).
- startLine
- Integer Line offset of the script within the resource with given URL (for script tags).
- startColumn
- Integer Column offset of the script within the resource with given URL.
- endLine
- Integer Last line of the script.
- endColumn
- Integer 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.
Code Example:
// WebInspector Event: Debugger.scriptParsed
function onScriptParsed(res) {
// res = {scriptId, url, startLine, startColumn, endLine, endColumn, isContentScript, sourceMapURL, hasSourceURL}
}
Debugger.scriptFailedToParse Event
Fired when virtual machine fails to parse the script.
- url
- String URL of the script that failed to parse.
- scriptSource
- String Source text of the script that failed to parse.
- startLine
- Integer Line offset of the script within the resource.
- errorLine
- Integer Line with error.
- errorMessage
- String Parse error message.
Code Example:
// WebInspector Event: Debugger.scriptFailedToParse
function onScriptFailedToParse(res) {
// res = {url, scriptSource, startLine, errorLine, errorMessage}
}
Debugger.breakpointResolved Event
Fired when breakpoint is resolved to an actual script and location.
- breakpointId
- Debugger.BreakpointId Breakpoint unique identifier.
- location
- Debugger.Location Actual breakpoint location.
Code Example:
// WebInspector Event: Debugger.breakpointResolved
function onBreakpointResolved(res) {
// res = {breakpointId, location}
}
Debugger.paused Event
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 | other ) Pause reason.
- data (optional)
- Object Object containing break-specific auxiliary properties.
Code Example:
// WebInspector Event: Debugger.paused
function onPaused(res) {
// res = {callFrames, reason, data}
}
Debugger.resumed Event
Fired when the virtual machine resumed execution.
Code Example:
// WebInspector Event: Debugger.resumed
function onResumed(res) {
// res = {}
}
FileSystem
Type
Command
FileSystem.Entry Type
Represents a browser side file or directory.
- url
- String filesystem: URL for the entry.
- name
- String The name of the file or directory.
- isDirectory
- Boolean 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.
FileSystem.enable Command
Enables events from backend.
Code Example:
// WebInspector Command: FileSystem.enable
FileSystem.enable();
FileSystem.disable Command
Disables events from backend.
Code Example:
// WebInspector Command: FileSystem.disable
FileSystem.disable();
FileSystem.requestFileSystemRoot Command
Returns root directory of the FileSystem, if exists.
- origin
- String 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.
Callback Parameters:
- errorCode
- Integer 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.
Code Example:
// WebInspector Command: FileSystem.requestFileSystemRoot
FileSystem.requestFileSystemRoot(origin, type, function callback(res) {
// res = {errorCode, root}
});
FileSystem.requestDirectoryContent Command
Returns content of the directory.
- url
- String URL of the directory that the frontend is requesting to read from.
Callback Parameters:
- errorCode
- Integer 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.
Code Example:
// WebInspector Command: FileSystem.requestDirectoryContent
FileSystem.requestDirectoryContent(url, function callback(res) {
// res = {errorCode, entries}
});
FileSystem.requestFileContent Command
Returns content of the file. Result should be sliced into [start, end).
- url
- String URL of the file that the frontend is requesting to read from.
- readAsText
- Boolean 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.
Callback Parameters:
- errorCode
- Integer 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.
Code Example:
// WebInspector Command: FileSystem.requestFileContent
FileSystem.requestFileContent(url, readAsText, start, end, charset, function callback(res) {
// res = {errorCode, content, charset}
});
FileSystem.deleteEntry Command
Deletes specified entry. If the entry is a directory, the agent deletes children recursively.
- url
- String URL of the entry to delete.
Callback Parameters:
- errorCode
- Integer 0, if no error. Otherwise errorCode is set to FileError::ErrorCode value.
Code Example:
// WebInspector Command: FileSystem.deleteEntry
FileSystem.deleteEntry(url, function callback(res) {
// res = {errorCode}
});
IndexedDB
Type
Command
IndexedDB.SecurityOriginWithDatabaseNames Type
Security origin with database names.
- securityOrigin
- String Security origin.
- databaseNames
- [String] Database names for this origin.
IndexedDB.DatabaseWithObjectStores Type
Database with an array of object stores.
- name
- String Database name.
- version
- String Deprecated string database version.
- intVersion
- Integer Integer database version.
- objectStores
- [IndexedDB.ObjectStore] Object stores in this database.
IndexedDB.ObjectStore Type
Object store.
- name
- String Object store name.
- keyPath
- IndexedDB.KeyPath Object store key path.
- autoIncrement
- Boolean If true, object store has auto increment flag set.
- indexes
- [IndexedDB.ObjectStoreIndex] Indexes in this object store.
IndexedDB.ObjectStoreIndex Type
Object store index.
- name
- String Index name.
- keyPath
- IndexedDB.KeyPath Index key path.
- unique
- Boolean If true, index is unique.
- multiEntry
- Boolean If true, index allows multiple entries for a key.
IndexedDB.Key Type
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.
IndexedDB.KeyRange Type
Key range.
- lower (optional)
- IndexedDB.Key Lower bound.
- upper (optional)
- IndexedDB.Key Upper bound.
- lowerOpen
- Boolean If true lower bound is open.
- upperOpen
- Boolean If true upper bound is open.
IndexedDB.DataEntry Type
Data entry.
- key
- IndexedDB.Key Key.
- primaryKey
- IndexedDB.Key Primary key.
- value
- Runtime.RemoteObject Value.
IndexedDB.KeyPath Type
Key path.
- type
- ( null | string | array ) Key path type.
- string (optional)
- String String value.
- array (optional)
- [String] Array value.
IndexedDB.enable Command
Enables events from backend.
Code Example:
// WebInspector Command: IndexedDB.enable
IndexedDB.enable();
IndexedDB.disable Command
Disables events from backend.
Code Example:
// WebInspector Command: IndexedDB.disable
IndexedDB.disable();
IndexedDB.requestDatabaseNamesForFrame Command
Requests database names for given frame's security origin.
- frameId
- Network.FrameId Frame id.
Callback Parameters:
- securityOriginWithDatabaseNames
- IndexedDB.SecurityOriginWithDatabaseNames Frame with database names.
Code Example:
// WebInspector Command: IndexedDB.requestDatabaseNamesForFrame
IndexedDB.requestDatabaseNamesForFrame(frameId, function callback(res) {
// res = {securityOriginWithDatabaseNames}
});
IndexedDB.requestDatabase Command
Requests database with given name in given frame.
- frameId
- Network.FrameId Frame id.
- databaseName
- String Database name.
Callback Parameters:
- databaseWithObjectStores
- IndexedDB.DatabaseWithObjectStores Database with an array of object stores.
Code Example:
// WebInspector Command: IndexedDB.requestDatabase
IndexedDB.requestDatabase(frameId, databaseName, function callback(res) {
// res = {databaseWithObjectStores}
});
IndexedDB.requestData Command
Requests data from object store or index.
- frameId
- Network.FrameId Frame id.
- databaseName
- String Database name.
- objectStoreName
- String Object store name.
- indexName
- String Index name, empty string for object store data requests.
- skipCount
- Integer Number of records to skip.
- pageSize
- Integer Number of records to fetch.
- keyRange (optional)
- IndexedDB.KeyRange Key range.
Callback Parameters:
- objectStoreDataEntries
- [IndexedDB.DataEntry] Array of object store data entries.
- hasMore
- Boolean If true, there are more entries to fetch in the given range.
Code Example:
// WebInspector Command: IndexedDB.requestData
IndexedDB.requestData(frameId, databaseName, objectStoreName, indexName, skipCount, pageSize, keyRange, function callback(res) {
// res = {objectStoreDataEntries, hasMore}
});
Network
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
- Network.enable: Enables network tracking, network events will now be delivered to the client.
- Network.disable: Disables network tracking, prevents network events from being sent to the client.
- Network.setUserAgentOverride: Allows overriding user agent with the given string.
- Network.setExtraHTTPHeaders: Specifies whether to always send extra HTTP headers with the requests from this page.
- Network.getResponseBody: Returns content served for the given request.
- Network.replayXHR: 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.
- Network.canClearBrowserCache: Tells whether clearing browser cache is supported.
- Network.clearBrowserCache: Clears browser cache.
- Network.canClearBrowserCookies: Tells whether clearing browser cookies is supported.
- Network.clearBrowserCookies: Clears browser cookies.
- Network.setCacheDisabled: Toggles ignoring cache for each request. If true, cache will not be used.
Event
Network.LoaderId Type
Unique loader identifier.
- String
Network.FrameId Type
Unique frame identifier.
- String
Network.RequestId Type
Unique request identifier.
- String
Network.Timestamp Type
Number of seconds since epoch.
- Number
Network.ResourceTiming Type
Timing information for the request.
- requestTime
- Number Timing's requestTime is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this requestTime.
- proxyStart
- Number Started resolving proxy.
- proxyEnd
- Number Finished resolving proxy.
- dnsStart
- Number Started DNS address resolve.
- dnsEnd
- Number Finished DNS address resolve.
- connectStart
- Number Started connecting to the remote host.
- connectEnd
- Number Connected to the remote host.
- sslStart
- Number Started SSL handshake.
- sslEnd
- Number Finished SSL handshake.
- sendStart
- Number Started sending request.
- sendEnd
- Number Finished sending request.
- receiveHeadersEnd
- Number Finished receiving response headers.
Network.Request Type
HTTP request data.
- url
- String Request URL.
- method
- String HTTP request method.
- headers
- Network.Headers HTTP request headers.
- postData (optional)
- String HTTP POST request data.
Network.Response Type
HTTP response data.
- url
- String Response URL.
- status
- Number HTTP response status code.
- statusText
- String HTTP response status text.
- headers
- Network.Headers HTTP response headers.
- headersText (optional)
- String HTTP response headers text.
- mimeType
- String 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.
- connectionReused
- Boolean Specifies whether physical connection was actually reused for this request.
- connectionId
- Number 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.
Network.WebSocketRequest Type
WebSocket request data.
- requestKey3
- String HTTP response status text.
- headers
- Network.Headers HTTP response headers.
Network.WebSocketResponse Type
WebSocket response data.
- status
- Number HTTP response status code.
- statusText
- String HTTP response status text.
- headers
- Network.Headers HTTP response headers.
- challengeResponse
- String Challenge response.
Network.WebSocketFrame Type
WebSocket frame data.
- opcode
- Number WebSocket frame opcode.
- mask
- Boolean WebSocke frame mask.
- payloadData
- String WebSocke frame payload data.
Network.CachedResource Type
Information about the cached resource.
- url
- String Resource URL.
- type
- Page.ResourceType Type of this resource.
- response (optional)
- Network.Response Cached response data.
- bodySize
- Number Cached response body size.
Network.Initiator Type
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.
Network.enable Command
Enables network tracking, network events will now be delivered to the client.
Code Example:
// WebInspector Command: Network.enable
Network.enable();
Network.disable Command
Disables network tracking, prevents network events from being sent to the client.
Code Example:
// WebInspector Command: Network.disable
Network.disable();
Network.setUserAgentOverride Command
Allows overriding user agent with the given string.
- userAgent
- String User agent to use.
Code Example:
// WebInspector Command: Network.setUserAgentOverride
Network.setUserAgentOverride(userAgent);
Network.setExtraHTTPHeaders Command
Specifies whether to always send extra HTTP headers with the requests from this page.
- headers
- Network.Headers Map with extra HTTP headers.
Code Example:
// WebInspector Command: Network.setExtraHTTPHeaders
Network.setExtraHTTPHeaders(headers);
Network.getResponseBody Command
Returns content served for the given request.
- requestId
- Network.RequestId Identifier of the network request to get content for.
Callback Parameters:
- body
- String Response body.
- base64Encoded
- Boolean True, if content was sent as base64.
Code Example:
// WebInspector Command: Network.getResponseBody
Network.getResponseBody(requestId, function callback(res) {
// res = {body, base64Encoded}
});
Network.replayXHR Command
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.
- requestId
- Network.RequestId Identifier of XHR to replay.
Code Example:
// WebInspector Command: Network.replayXHR
Network.replayXHR(requestId);
Network.canClearBrowserCache Command
Tells whether clearing browser cache is supported.
Callback Parameters:
- result
- Boolean True if browser cache can be cleared.
Code Example:
// WebInspector Command: Network.canClearBrowserCache
Network.canClearBrowserCache(function callback(res) {
// res = {result}
});
Network.clearBrowserCache Command
Clears browser cache.
Code Example:
// WebInspector Command: Network.clearBrowserCache
Network.clearBrowserCache();
Network.canClearBrowserCookies Command
Tells whether clearing browser cookies is supported.
Callback Parameters:
- result
- Boolean True if browser cookies can be cleared.
Code Example:
// WebInspector Command: Network.canClearBrowserCookies
Network.canClearBrowserCookies(function callback(res) {
// res = {result}
});
Network.clearBrowserCookies Command
Clears browser cookies.
Code Example:
// WebInspector Command: Network.clearBrowserCookies
Network.clearBrowserCookies();
Network.setCacheDisabled Command
Toggles ignoring cache for each request. If true
, cache will not be used.
- cacheDisabled
- Boolean Cache disabled state.
Code Example:
// WebInspector Command: Network.setCacheDisabled
Network.setCacheDisabled(cacheDisabled);
Network.requestWillBeSent Event
Fired when page is about to send HTTP request.
- requestId
- Network.RequestId Request identifier.
- frameId
- Network.FrameId Frame identifier.
- loaderId
- Network.LoaderId Loader identifier.
- documentURL
- String URL of the document this request is loaded for.
- request
- Network.Request Request data.
- timestamp
- Network.Timestamp Timestamp.
- initiator
- Network.Initiator Request initiator.
- redirectResponse (optional)
- Network.Response Redirect response data.
Code Example:
// WebInspector Event: Network.requestWillBeSent
function onRequestWillBeSent(res) {
// res = {requestId, frameId, loaderId, documentURL, request, timestamp, initiator, redirectResponse}
}
Network.requestServedFromCache Event
Fired if request ended up loading from cache.
- requestId
- Network.RequestId Request identifier.
Code Example:
// WebInspector Event: Network.requestServedFromCache
function onRequestServedFromCache(res) {
// res = {requestId}
}
Network.dataReceived Event
Fired when data chunk was received over the network.
- requestId
- Network.RequestId Request identifier.
- timestamp
- Network.Timestamp Timestamp.
- dataLength
- Integer Data chunk length.
- encodedDataLength
- Integer Actual bytes received (might be less than dataLength for compressed encodings).
Code Example:
// WebInspector Event: Network.dataReceived
function onDataReceived(res) {
// res = {requestId, timestamp, dataLength, encodedDataLength}
}
Network.loadingFinished Event
Fired when HTTP request has finished loading.
- requestId
- Network.RequestId Request identifier.
- timestamp
- Network.Timestamp Timestamp.
Code Example:
// WebInspector Event: Network.loadingFinished
function onLoadingFinished(res) {
// res = {requestId, timestamp}
}
Network.loadingFailed Event
Fired when HTTP request has failed to load.
- requestId
- Network.RequestId Request identifier.
- timestamp
- Network.Timestamp Timestamp.
- errorText
- String User friendly error message.
- canceled (optional)
- Boolean True if loading was canceled.
Code Example:
// WebInspector Event: Network.loadingFailed
function onLoadingFailed(res) {
// res = {requestId, timestamp, errorText, canceled}
}
Network.requestServedFromMemoryCache Event
Fired when HTTP request has been served from memory cache.
- requestId
- Network.RequestId Request identifier.
- frameId
- Network.FrameId Frame identifier.
- loaderId
- Network.LoaderId Loader identifier.
- documentURL
- String URL of the document this request is loaded for.
- timestamp
- Network.Timestamp Timestamp.
- initiator
- Network.Initiator Request initiator.
- resource
- Network.CachedResource Cached resource data.
Code Example:
// WebInspector Event: Network.requestServedFromMemoryCache
function onRequestServedFromMemoryCache(res) {
// res = {requestId, frameId, loaderId, documentURL, timestamp, initiator, resource}
}
Network.webSocketWillSendHandshakeRequest Event
Fired when WebSocket is about to initiate handshake.
- requestId
- Network.RequestId Request identifier.
- timestamp
- Network.Timestamp Timestamp.
- request
- Network.WebSocketRequest WebSocket request data.
Code Example:
// WebInspector Event: Network.webSocketWillSendHandshakeRequest
function onWebSocketWillSendHandshakeRequest(res) {
// res = {requestId, timestamp, request}
}
Network.webSocketHandshakeResponseReceived Event
Fired when WebSocket handshake response becomes available.
- requestId
- Network.RequestId Request identifier.
- timestamp
- Network.Timestamp Timestamp.
- response
- Network.WebSocketResponse WebSocket response data.
Code Example:
// WebInspector Event: Network.webSocketHandshakeResponseReceived
function onWebSocketHandshakeResponseReceived(res) {
// res = {requestId, timestamp, response}
}
Network.webSocketCreated Event
Fired upon WebSocket creation.
- requestId
- Network.RequestId Request identifier.
- url
- String WebSocket request URL.
Code Example:
// WebInspector Event: Network.webSocketCreated
function onWebSocketCreated(res) {
// res = {requestId, url}
}
Network.webSocketClosed Event
Fired when WebSocket is closed.
- requestId
- Network.RequestId Request identifier.
- timestamp
- Network.Timestamp Timestamp.
Code Example:
// WebInspector Event: Network.webSocketClosed
function onWebSocketClosed(res) {
// res = {requestId, timestamp}
}
Network.webSocketFrameReceived Event
Fired when WebSocket frame is received.
- requestId
- Network.RequestId Request identifier.
- timestamp
- Network.Timestamp Timestamp.
- response
- Network.WebSocketFrame WebSocket response data.
Code Example:
// WebInspector Event: Network.webSocketFrameReceived
function onWebSocketFrameReceived(res) {
// res = {requestId, timestamp, response}
}
Network.webSocketFrameError Event
Fired when WebSocket frame error occurs.
- requestId
- Network.RequestId Request identifier.
- timestamp
- Network.Timestamp Timestamp.
- errorMessage
- String WebSocket frame error message.
Code Example:
// WebInspector Event: Network.webSocketFrameError
function onWebSocketFrameError(res) {
// res = {requestId, timestamp, errorMessage}
}
Network.webSocketFrameSent Event
Fired when WebSocket frame is sent.
- requestId
- Network.RequestId Request identifier.
- timestamp
- Network.Timestamp Timestamp.
- response
- Network.WebSocketFrame WebSocket response data.
Code Example:
// WebInspector Event: Network.webSocketFrameSent
function onWebSocketFrameSent(res) {
// res = {requestId, timestamp, response}
}
Page
Actions and events related to the inspected page belong to the page domain.
Type
Command
Event
Page.ResourceType Type
Resource type as it was perceived by the rendering engine.
- ( Document | Stylesheet | Image | Font | Script | XHR | WebSocket | Other )
Page.Frame Type
Information about the Frame on the page.
- id
- String Frame unique identifier.
- parentId (optional)
- String Parent frame identifier.
- loaderId
- Network.LoaderId Identifier of the loader associated with this frame.
- name (optional)
- String Frame's name as specified in the tag.
- url
- String Frame document's URL.
- securityOrigin (optional)
- String Frame document's security origin.
- mimeType
- String Frame document's mimeType as determined by the browser.
Page.FrameResourceTree Type
Information about the Frame hierarchy along with their cached resources.
- frame
- Page.Frame Frame information for this tree item.
- childFrames (optional)
- [Page.FrameResourceTree] Child frames.
- resources
- [Object] Information about frame resources.
Page.SearchMatch Type
Search match for resource.
- lineNumber
- Number Line number in resource content.
- lineContent
- String Line with match content.
Page.SearchResult Type
Search result for resource.
- url
- String Resource URL.
- frameId
- Network.FrameId Resource frame id.
- matchesCount
- Number Number of matches in the resource content.
Page.Cookie Type
Cookie object
- name
- String Cookie name.
- value
- String Cookie value.
- domain
- String Cookie domain.
- path
- String Cookie path.
- expires
- Number Cookie expires.
- size
- Integer Cookie size.
- httpOnly
- Boolean True if cookie is http-only.
- secure
- Boolean True if cookie is secure.
- session
- Boolean True in case of session cookie.
Page.ScriptIdentifier Type
Unique script identifier.
- String
Page.enable Command
Enables page domain notifications.
Code Example:
// WebInspector Command: Page.enable
Page.enable();
Page.disable Command
Disables page domain notifications.
Code Example:
// WebInspector Command: Page.disable
Page.disable();
Page.addScriptToEvaluateOnLoad Command
- scriptSource
- String
Callback Parameters:
- identifier
- Page.ScriptIdentifier Identifier of the added script.
Code Example:
// WebInspector Command: Page.addScriptToEvaluateOnLoad
Page.addScriptToEvaluateOnLoad(scriptSource, function callback(res) {
// res = {identifier}
});
Page.removeScriptToEvaluateOnLoad Command
- identifier
- Page.ScriptIdentifier
Code Example:
// WebInspector Command: Page.removeScriptToEvaluateOnLoad
Page.removeScriptToEvaluateOnLoad(identifier);
Page.reload Command
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.
Code Example:
// WebInspector Command: Page.reload
Page.reload(ignoreCache, scriptToEvaluateOnLoad);
Page.navigate Command
Navigates current page to the given URL.
- url
- String URL to navigate the page to.
Code Example:
// WebInspector Command: Page.navigate
Page.navigate(url);
Page.getCookies Command
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
.
Callback Parameters:
- cookies
- [Page.Cookie] Array of cookie objects.
- cookiesString
- String document.cookie string representation of the cookies.
Code Example:
// WebInspector Command: Page.getCookies
Page.getCookies(function callback(res) {
// res = {cookies, cookiesString}
});
Page.deleteCookie Command
Deletes browser cookie with given name for the given domain.
- cookieName
- String Name of the cookie to remove.
- domain
- String Domain of the cookie to remove.
Code Example:
// WebInspector Command: Page.deleteCookie
Page.deleteCookie(cookieName, domain);
Page.getResourceTree Command
Returns present frame / resource tree structure.
Callback Parameters:
- frameTree
- Page.FrameResourceTree Present frame / resource tree structure.
Code Example:
// WebInspector Command: Page.getResourceTree
Page.getResourceTree(function callback(res) {
// res = {frameTree}
});
Page.getResourceContent Command
Returns content of the given resource.
- frameId
- Network.FrameId Frame id to get resource for.
- url
- String URL of the resource to get content for.
Callback Parameters:
- content
- String Resource content.
- base64Encoded
- Boolean True, if content was served as base64.
Code Example:
// WebInspector Command: Page.getResourceContent
Page.getResourceContent(frameId, url, function callback(res) {
// res = {content, base64Encoded}
});
Page.searchInResource Command
Searches for given string in resource content.
- frameId
- Network.FrameId Frame id for resource to search in.
- url
- String URL of the resource to search in.
- query
- String String to search for.
- caseSensitive (optional)
- Boolean If true, search is case sensitive.
- isRegex (optional)
- Boolean If true, treats string parameter as regex.
Callback Parameters:
- result
- [Page.SearchMatch] List of search matches.
Code Example:
// WebInspector Command: Page.searchInResource
Page.searchInResource(frameId, url, query, caseSensitive, isRegex, function callback(res) {
// res = {result}
});
Page.searchInResources Command
Searches for given string in frame / resource tree structure.
- text
- String String to search for.
- caseSensitive (optional)
- Boolean If true, search is case sensitive.
- isRegex (optional)
- Boolean If true, treats string parameter as regex.
Callback Parameters:
- result
- [Page.SearchResult] List of search results.
Code Example:
// WebInspector Command: Page.searchInResources
Page.searchInResources(text, caseSensitive, isRegex, function callback(res) {
// res = {result}
});
Page.setDocumentContent Command
Sets given markup as the document's HTML.
- frameId
- Network.FrameId Frame id to set HTML for.
- html
- String HTML content to set.
Code Example:
// WebInspector Command: Page.setDocumentContent
Page.setDocumentContent(frameId, html);
Page.canOverrideDeviceMetrics Command
Checks whether setDeviceMetricsOverride
can be invoked.
Callback Parameters:
- result
- Boolean If true,
setDeviceMetricsOverride
can safely be invoked on the agent.
Code Example:
// WebInspector Command: Page.canOverrideDeviceMetrics
Page.canOverrideDeviceMetrics(function callback(res) {
// res = {result}
});
Page.setDeviceMetricsOverride Command
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.
- width
- Integer Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
- height
- Integer Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
- fontScaleFactor
- Number Overriding font scale factor value (must be positive). 1 disables the override.
- fitWindow
- Boolean Whether a view that exceeds the available browser window area should be scaled down to fit.
Code Example:
// WebInspector Command: Page.setDeviceMetricsOverride
Page.setDeviceMetricsOverride(width, height, fontScaleFactor, fitWindow);
Page.setShowPaintRects Command
Requests that backend shows paint rectangles
- result
- Boolean True for showing paint rectangles
Code Example:
// WebInspector Command: Page.setShowPaintRects
Page.setShowPaintRects(result);
Page.getScriptExecutionStatus Command
Determines if scripts can be executed in the page.
Callback Parameters:
- 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.
Code Example:
// WebInspector Command: Page.getScriptExecutionStatus
Page.getScriptExecutionStatus(function callback(res) {
// res = {result}
});
Page.setScriptExecutionDisabled Command
Switches script execution in the page.
- value
- Boolean Whether script execution should be disabled in the page.
Code Example:
// WebInspector Command: Page.setScriptExecutionDisabled
Page.setScriptExecutionDisabled(value);
Page.setGeolocationOverride Command
Overrides the Geolocation Position or Error.
- latitude (optional)
- Number Mock longitude
- longitude (optional)
- Number Mock latitude
- accuracy (optional)
- Number Mock accuracy
Code Example:
// WebInspector Command: Page.setGeolocationOverride
Page.setGeolocationOverride(latitude, longitude, accuracy);
Page.clearGeolocationOverride Command
Clears the overriden Geolocation Position and Error.
Code Example:
// WebInspector Command: Page.clearGeolocationOverride
Page.clearGeolocationOverride();
Page.canOverrideGeolocation Command
Checks if Geolocation can be overridden.
Callback Parameters:
- result
- Boolean True if browser can ovrride Geolocation.
Code Example:
// WebInspector Command: Page.canOverrideGeolocation
Page.canOverrideGeolocation(function callback(res) {
// res = {result}
});
Page.setDeviceOrientationOverride Command
Overrides the Device Orientation.
- alpha
- Number Mock alpha
- beta
- Number Mock beta
- gamma
- Number Mock gamma
Code Example:
// WebInspector Command: Page.setDeviceOrientationOverride
Page.setDeviceOrientationOverride(alpha, beta, gamma);
Page.clearDeviceOrientationOverride Command
Clears the overridden Device Orientation.
Code Example:
// WebInspector Command: Page.clearDeviceOrientationOverride
Page.clearDeviceOrientationOverride();
Page.canOverrideDeviceOrientation Command
Check the backend if Web Inspector can override the device orientation.
Callback Parameters:
- result
- Boolean If true,
setDeviceOrientationOverride
can safely be invoked on the agent.
Code Example:
// WebInspector Command: Page.canOverrideDeviceOrientation
Page.canOverrideDeviceOrientation(function callback(res) {
// res = {result}
});
Page.setTouchEmulationEnabled Command
Toggles mouse event-based touch event emulation.
- enabled
- Boolean Whether the touch event emulation should be enabled.
Code Example:
// WebInspector Command: Page.setTouchEmulationEnabled
Page.setTouchEmulationEnabled(enabled);
Page.getCompositingBordersVisible Command
Indicates the visibility of compositing borders.
Callback Parameters:
- result
- Boolean If true, compositing borders are visible.
Code Example:
// WebInspector Command: Page.getCompositingBordersVisible
Page.getCompositingBordersVisible(function callback(res) {
// res = {result}
});
Page.setCompositingBordersVisible Command
Controls the visibility of compositing borders.
- visible
- Boolean True for showing compositing borders.
Code Example:
// WebInspector Command: Page.setCompositingBordersVisible
Page.setCompositingBordersVisible(visible);
Page.domContentEventFired Event
- timestamp
- Number
Code Example:
// WebInspector Event: Page.domContentEventFired
function onDomContentEventFired(res) {
// res = {timestamp}
}
Page.loadEventFired Event
- timestamp
- Number
Code Example:
// WebInspector Event: Page.loadEventFired
function onLoadEventFired(res) {
// res = {timestamp}
}
Page.frameNavigated Event
Fired once navigation of the frame has completed. Frame is now associated with the new loader.
- frame
- Page.Frame Frame object.
Code Example:
// WebInspector Event: Page.frameNavigated
function onFrameNavigated(res) {
// res = {frame}
}
Page.frameDetached Event
Fired when frame has been detached from its parent.
- frameId
- Network.FrameId Id of the frame that has been detached.
Code Example:
// WebInspector Event: Page.frameDetached
function onFrameDetached(res) {
// res = {frameId}
}
Profiler
Type
Command
Event
Profiler.Profile Type
Profile.
- head (optional)
- Object
- bottomUpHead (optional)
- Object
Profiler.HeapSnapshotObjectId Type
Heap snashot object id.
- String
Profiler.causesRecompilation Command
Callback Parameters:
- result
- Boolean
Code Example:
// WebInspector Command: Profiler.causesRecompilation
Profiler.causesRecompilation(function callback(res) {
// res = {result}
});
Profiler.isSampling Command
Callback Parameters:
- result
- Boolean
Code Example:
// WebInspector Command: Profiler.isSampling
Profiler.isSampling(function callback(res) {
// res = {result}
});
Profiler.hasHeapProfiler Command
Callback Parameters:
- result
- Boolean
Code Example:
// WebInspector Command: Profiler.hasHeapProfiler
Profiler.hasHeapProfiler(function callback(res) {
// res = {result}
});
Profiler.enable Command
Code Example:
// WebInspector Command: Profiler.enable
Profiler.enable();
Profiler.disable Command
Code Example:
// WebInspector Command: Profiler.disable
Profiler.disable();
Profiler.start Command
Code Example:
// WebInspector Command: Profiler.start
Profiler.start();
Profiler.stop Command
Code Example:
// WebInspector Command: Profiler.stop
Profiler.stop();
Profiler.getProfileHeaders Command
Callback Parameters:
- headers
- [Profiler.ProfileHeader]
Code Example:
// WebInspector Command: Profiler.getProfileHeaders
Profiler.getProfileHeaders(function callback(res) {
// res = {headers}
});
Profiler.getProfile Command
- type
- String
- uid
- Integer
Callback Parameters:
- profile
- Profiler.Profile
Code Example:
// WebInspector Command: Profiler.getProfile
Profiler.getProfile(type, uid, function callback(res) {
// res = {profile}
});
Profiler.removeProfile Command
- type
- String
- uid
- Integer
Code Example:
// WebInspector Command: Profiler.removeProfile
Profiler.removeProfile(type, uid);
Profiler.clearProfiles Command
Code Example:
// WebInspector Command: Profiler.clearProfiles
Profiler.clearProfiles();
Profiler.takeHeapSnapshot Command
Code Example:
// WebInspector Command: Profiler.takeHeapSnapshot
Profiler.takeHeapSnapshot();
Profiler.collectGarbage Command
Code Example:
// WebInspector Command: Profiler.collectGarbage
Profiler.collectGarbage();
Profiler.getObjectByHeapObjectId Command
- objectId
- Profiler.HeapSnapshotObjectId
- objectGroup (optional)
- String Symbolic group name that can be used to release multiple objects.
Callback Parameters:
- result
- Runtime.RemoteObject Evaluation result.
Code Example:
// WebInspector Command: Profiler.getObjectByHeapObjectId
Profiler.getObjectByHeapObjectId(objectId, objectGroup, function callback(res) {
// res = {result}
});
Profiler.getHeapObjectId Command
- objectId
- Runtime.RemoteObjectId Identifier of the object to get heap object id for.
Callback Parameters:
- heapSnapshotObjectId
- Profiler.HeapSnapshotObjectId Id of the heap snapshot object corresponding to the passed remote object id.
Code Example:
// WebInspector Command: Profiler.getHeapObjectId
Profiler.getHeapObjectId(objectId, function callback(res) {
// res = {heapSnapshotObjectId}
});
Profiler.addProfileHeader Event
- header
- Profiler.ProfileHeader
Code Example:
// WebInspector Event: Profiler.addProfileHeader
function onAddProfileHeader(res) {
// res = {header}
}
Profiler.addHeapSnapshotChunk Event
- uid
- Integer
- chunk
- String
Code Example:
// WebInspector Event: Profiler.addHeapSnapshotChunk
function onAddHeapSnapshotChunk(res) {
// res = {uid, chunk}
}
Profiler.finishHeapSnapshot Event
- uid
- Integer
Code Example:
// WebInspector Event: Profiler.finishHeapSnapshot
function onFinishHeapSnapshot(res) {
// res = {uid}
}
Profiler.setRecordingProfile Event
- isProfiling
- Boolean
Code Example:
// WebInspector Event: Profiler.setRecordingProfile
function onSetRecordingProfile(res) {
// res = {isProfiling}
}
Profiler.resetProfiles Event
Code Example:
// WebInspector Event: Profiler.resetProfiles
function onResetProfiles(res) {
// res = {}
}
Profiler.reportHeapSnapshotProgress Event
- done
- Integer
- total
- Integer
Code Example:
// WebInspector Event: Profiler.reportHeapSnapshotProgress
function onReportHeapSnapshotProgress(res) {
// res = {done, total}
}
Runtime
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
- Runtime.evaluate: Evaluates expression on global object.
- Runtime.callFunctionOn: Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
- Runtime.getProperties: Returns properties of a given object. Object group of the result is inherited from the target object.
- Runtime.releaseObject: Releases remote object with given id.
- Runtime.releaseObjectGroup: Releases all remote objects that belong to a given group.
- Runtime.run: Tells inspected instance(worker or page) that it can run in case it was started paused.
- Runtime.enable: 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.
- Runtime.disable: Disables reporting of execution contexts creation.
Event
Runtime.RemoteObjectId Type
Unique object identifier.
- String
Runtime.RemoteObject Type
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 containsing abbreviated property values.
Runtime.ObjectPreview Type
Object containing abbreviated remote object value.
- lossless
- Boolean Determines whether preview is lossless (contains all information of the original object).
- overflow
- Boolean True iff some of the properties of the original did not fit.
- properties
- [Runtime.PropertyPreview] List of the properties.
Runtime.PropertyPreview Type
- name
- String Property name.
- type
- ( object | function | undefined | string | number | boolean ) Object type.
- value (optional)
- String User-friendly property value string.
- subtype (optional)
- ( array | null | node | regexp | date ) Object subtype hint. Specified for
object
type values only.
Runtime.PropertyDescriptor Type
Object property descriptor.
- name
- String 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).
- configurable
- Boolean True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.
- enumerable
- Boolean 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.
Runtime.InternalPropertyDescriptor Type
Object internal property descriptor. This property isn't normally visible in JavaScript code.
- name
- String Conventional property name.
- value (optional)
- Runtime.RemoteObject The value associated with the property.
Runtime.CallArgument Type
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.
Runtime.ExecutionContextId Type
Id of an execution context.
- Integer
Runtime.ExecutionContextDescription Type
Description of an isolated world.
- id
- Runtime.ExecutionContextId Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.
- isPageContext
- Boolean True if this is a context where inpspected web page scripts run. False if it is a content script isolated context.
- name
- String Human readable name describing given context.
- frameId
- Network.FrameId Id of the owning frame.
Runtime.evaluate Command
Evaluates expression on global object.
- expression
- String 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.
Callback Parameters:
- result
- Runtime.RemoteObject Evaluation result.
- wasThrown (optional)
- Boolean True if the result was thrown during the evaluation.
Code Example:
// WebInspector Command: Runtime.evaluate
Runtime.evaluate(expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, contextId, returnByValue, generatePreview, function callback(res) {
// res = {result, wasThrown}
});
Runtime.callFunctionOn Command
Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
- objectId
- Runtime.RemoteObjectId Identifier of the object to call function on.
- functionDeclaration
- String 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.
Callback Parameters:
- result
- Runtime.RemoteObject Call result.
- wasThrown (optional)
- Boolean True if the result was thrown during the evaluation.
Code Example:
// WebInspector Command: Runtime.callFunctionOn
Runtime.callFunctionOn(objectId, functionDeclaration, arguments, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, function callback(res) {
// res = {result, wasThrown}
});
Runtime.getProperties Command
Returns properties of a given object. Object group of the result is inherited from the target object.
- objectId
- Runtime.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.
Callback Parameters:
- result
- [Runtime.PropertyDescriptor] Object properties.
- internalProperties (optional)
- [Runtime.InternalPropertyDescriptor] Internal object properties.
Code Example:
// WebInspector Command: Runtime.getProperties
Runtime.getProperties(objectId, ownProperties, function callback(res) {
// res = {result, internalProperties}
});
Runtime.releaseObject Command
Releases remote object with given id.
- objectId
- Runtime.RemoteObjectId Identifier of the object to release.
Code Example:
// WebInspector Command: Runtime.releaseObject
Runtime.releaseObject(objectId);
Runtime.releaseObjectGroup Command
Releases all remote objects that belong to a given group.
- objectGroup
- String Symbolic object group name.
Code Example:
// WebInspector Command: Runtime.releaseObjectGroup
Runtime.releaseObjectGroup(objectGroup);
Runtime.run Command
Tells inspected instance(worker or page) that it can run in case it was started paused.
Code Example:
// WebInspector Command: Runtime.run
Runtime.run();
Runtime.enable Command
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.
Code Example:
// WebInspector Command: Runtime.enable
Runtime.enable();
Runtime.disable Command
Disables reporting of execution contexts creation.
Code Example:
// WebInspector Command: Runtime.disable
Runtime.disable();
Runtime.executionContextCreated Event
Issued when new execution context is created.
- context
- Runtime.ExecutionContextDescription A newly created execution contex.
Code Example:
// WebInspector Event: Runtime.executionContextCreated
function onExecutionContextCreated(res) {
// res = {context}
}
Timeline
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
Timeline.TimelineEvent Type
Timeline record contains information about the recorded activity.
- type
- String Event type.
- data
- Object Event data.
- children (optional)
- [Timeline.TimelineEvent] Nested records.
Timeline.start Command
Starts capturing instrumentation events.
- maxCallStackDepth (optional)
- Integer Samples JavaScript stack traces up to
maxCallStackDepth
, defaults to 5.
Code Example:
// WebInspector Command: Timeline.start
Timeline.start(maxCallStackDepth);
Timeline.stop Command
Stops capturing instrumentation events.
Code Example:
// WebInspector Command: Timeline.stop
Timeline.stop();
Timeline.setIncludeMemoryDetails Command
Starts calculating various DOM statistics and sending them as part of timeline events.
- enabled
- Boolean True to start collecting DOM counters.
Code Example:
// WebInspector Command: Timeline.setIncludeMemoryDetails
Timeline.setIncludeMemoryDetails(enabled);
Timeline.supportsFrameInstrumentation Command
Tells whether timeline agent supports frame instrumentation.
Callback Parameters:
- result
- Boolean True if timeline supports frame instrumentation.
Code Example:
// WebInspector Command: Timeline.supportsFrameInstrumentation
Timeline.supportsFrameInstrumentation(function callback(res) {
// res = {result}
});
Timeline.canMonitorMainThread Command
Tells whether timeline agent supports main thread CPU utilization instrumentation.
Callback Parameters:
- result
- Boolean True if timeline supports main thread CPU utilization instrumentation.
Code Example:
// WebInspector Command: Timeline.canMonitorMainThread
Timeline.canMonitorMainThread(function callback(res) {
// res = {result}
});
Timeline.eventRecorded Event
Fired for every instrumentation event while timeline is started.
- record
- Timeline.TimelineEvent Timeline event record data.
Code Example:
// WebInspector Event: Timeline.eventRecorded
function onEventRecorded(res) {
// res = {record}
}
Worker
Command
Event
Worker.enable Command
Code Example:
// WebInspector Command: Worker.enable
Worker.enable();
Worker.disable Command
Code Example:
// WebInspector Command: Worker.disable
Worker.disable();
Worker.sendMessageToWorker Command
- workerId
- Integer
- message
- Object
Code Example:
// WebInspector Command: Worker.sendMessageToWorker
Worker.sendMessageToWorker(workerId, message);
Worker.connectToWorker Command
- workerId
- Integer
Code Example:
// WebInspector Command: Worker.connectToWorker
Worker.connectToWorker(workerId);
Worker.disconnectFromWorker Command
- workerId
- Integer
Code Example:
// WebInspector Command: Worker.disconnectFromWorker
Worker.disconnectFromWorker(workerId);
Worker.setAutoconnectToWorkers Command
- value
- Boolean
Code Example:
// WebInspector Command: Worker.setAutoconnectToWorkers
Worker.setAutoconnectToWorkers(value);
Worker.workerCreated Event
- workerId
- Integer
- url
- String
- inspectorConnected
- Boolean
Code Example:
// WebInspector Event: Worker.workerCreated
function onWorkerCreated(res) {
// res = {workerId, url, inspectorConnected}
}
Worker.workerTerminated Event
- workerId
- Integer
Code Example:
// WebInspector Event: Worker.workerTerminated
function onWorkerTerminated(res) {
// res = {workerId}
}
Worker.dispatchMessageFromWorker Event
- workerId
- Integer
- message
- Object
Code Example:
// WebInspector Event: Worker.dispatchMessageFromWorker
function onDispatchMessageFromWorker(res) {
// res = {workerId, message}
}
Worker.disconnectedFromWorker Event
Code Example:
// WebInspector Event: Worker.disconnectedFromWorker
function onDisconnectedFromWorker(res) {
// res = {}
}