diff --git a/src/LiveDevelopment/Agents/CSSAgent.js b/src/LiveDevelopment/Agents/CSSAgent.js index f9095278a9c..bc25a1965da 100644 --- a/src/LiveDevelopment/Agents/CSSAgent.js +++ b/src/LiveDevelopment/Agents/CSSAgent.js @@ -34,12 +34,12 @@ define(function CSSAgent(require, exports, module) { "use strict"; require("thirdparty/path-utils/path-utils.min"); - + var Inspector = require("LiveDevelopment/Inspector/Inspector"); var _load; // {$.Deferred} load promise var _urlToStyle; // {url -> loaded} style definition - + /** * Create a canonicalized version of the given URL, stripping off query strings and hashes. * @param {string} url the URL to canonicalize @@ -50,7 +50,7 @@ define(function CSSAgent(require, exports, module) { } // WebInspector Event: Page.loadEventFired - function _onLoadEventFired(res) { + function _onLoadEventFired(event, res) { // res = {timestamp} _urlToStyle = {}; Inspector.CSS.getAllStyleSheets(function onGetAllStyleSheets(res) { @@ -69,7 +69,7 @@ define(function CSSAgent(require, exports, module) { function styleForURL(url) { return _urlToStyle[_canonicalize(url)]; } - + /** Get a list of all loaded stylesheet files by URL */ function getStylesheetURLs() { var urls = [], url; @@ -89,7 +89,7 @@ define(function CSSAgent(require, exports, module) { console.assert(style, "Style Sheet for document not loaded: " + doc.url); Inspector.CSS.setStyleSheetText(style.styleSheetId, doc.getText()); } - + /** Empties a CSS style sheet given a document that has been deleted * @param {Document} document */ @@ -102,13 +102,13 @@ define(function CSSAgent(require, exports, module) { /** Initialize the agent */ function load() { _load = new $.Deferred(); - Inspector.on("Page.loadEventFired", _onLoadEventFired); + $(Inspector.Page).on("loadEventFired.CSSAgent", _onLoadEventFired); return _load.promise(); } /** Clean up */ function unload() { - Inspector.off("Page.loadEventFired", _onLoadEventFired); + $(Inspector.Page).off(".CSSAgent"); } // Export public functions diff --git a/src/LiveDevelopment/Agents/ConsoleAgent.js b/src/LiveDevelopment/Agents/ConsoleAgent.js index a58c646abc3..5cef3d90e7b 100644 --- a/src/LiveDevelopment/Agents/ConsoleAgent.js +++ b/src/LiveDevelopment/Agents/ConsoleAgent.js @@ -23,7 +23,7 @@ /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */ -/*global define */ +/*global define, $ */ /** * ConsoleAgent forwards all console message from the remote console to the @@ -53,14 +53,14 @@ define(function ConsoleAgent(require, exports, module) { } // WebInspector Event: Console.messageAdded - function _onMessageAdded(res) { + function _onMessageAdded(event, res) { // res = {message} _lastMessage = res.message; _log(_lastMessage); } // WebInspector Event: Console.messageRepeatCountUpdated - function _onMessageRepeatCountUpdated(res) { + function _onMessageRepeatCountUpdated(event, res) { // res = {count} if (_lastMessage) { _log(_lastMessage); @@ -68,23 +68,22 @@ define(function ConsoleAgent(require, exports, module) { } // WebInspector Event: Console.messagesCleared - function _onMessagesCleared(res) { + function _onMessagesCleared(event, res) { // res = {} } /** Initialize the agent */ function load() { Inspector.Console.enable(); - Inspector.on("Console.messageAdded", _onMessageAdded); - Inspector.on("Console.messageRepeatCountUpdated", _onMessageRepeatCountUpdated); - Inspector.on("Console.messagesCleared", _onMessagesCleared); + $(Inspector.Console) + .on("messageAdded.ConsoleAgent", _onMessageAdded) + .on("messageRepeatCountUpdated.ConsoleAgent", _onMessageRepeatCountUpdated) + .on("messagesCleared.ConsoleAgent", _onMessagesCleared); } /** Clean up */ function unload() { - Inspector.off("Console.messageAdded", _onMessageAdded); - Inspector.off("Console.messageRepeatCountUpdated", _onMessageRepeatCountUpdated); - Inspector.off("Console.messagesCleared", _onMessagesCleared); + $(Inspector.Console).off(".ConsoleAgent"); } // Export public functions diff --git a/src/LiveDevelopment/Agents/DOMAgent.js b/src/LiveDevelopment/Agents/DOMAgent.js index 5f676d807e9..ff1ae55db30 100644 --- a/src/LiveDevelopment/Agents/DOMAgent.js +++ b/src/LiveDevelopment/Agents/DOMAgent.js @@ -32,12 +32,14 @@ * the source document (replace [from,to] with text) call * `applyChange(from, to, text)`. * - * The DOMAgent triggers `DOMAgent.getDocument` on Inspector once it has loaded + * The DOMAgent triggers `getDocument` once it has loaded * the document. */ define(function DOMAgent(require, exports, module) { "use strict"; + var $exports = $(exports); + var Inspector = require("LiveDevelopment/Inspector/Inspector"); var RemoteAgent = require("LiveDevelopment/Agents/RemoteAgent"); var DOMNode = require("LiveDevelopment/Agents/DOMNode"); @@ -186,10 +188,10 @@ define(function DOMAgent(require, exports, module) { } // WebInspector Event: Page.loadEventFired - function _onLoadEventFired(res) { + function _onLoadEventFired(event, res) { // res = {timestamp} Inspector.DOM.getDocument(function onGetDocument(res) { - Inspector.trigger("DOMAgent.getDocument", res); + $exports.triggerHandler("getDocument", res); // res = {root} _idToNode = {}; _pendingRequests = 0; @@ -198,18 +200,18 @@ define(function DOMAgent(require, exports, module) { } // WebInspector Event: Page.frameNavigated - function _onFrameNavigated(res) { + function _onFrameNavigated(event, res) { // res = {frame} exports.url = _cleanURL(res.frame.url); } // WebInspector Event: DOM.documentUpdated - function _onDocumentUpdated(res) { + function _onDocumentUpdated(event, res) { // res = {} } // WebInspector Event: DOM.setChildNodes - function _onSetChildNodes(res) { + function _onSetChildNodes(event, res) { // res = {parentId, nodes} var node = nodeWithId(res.parentId); node.setChildrenPayload(res.nodes); @@ -219,7 +221,7 @@ define(function DOMAgent(require, exports, module) { } // WebInspector Event: DOM.childNodeCountUpdated - function _onChildNodeCountUpdated(res) { + function _onChildNodeCountUpdated(event, res) { // res = {nodeId, childNodeCount} if (res.nodeId > 0) { Inspector.DOM.requestChildNodes(res.nodeId); @@ -227,7 +229,7 @@ define(function DOMAgent(require, exports, module) { } // WebInspector Event: DOM.childNodeInserted - function _onChildNodeInserted(res) { + function _onChildNodeInserted(event, res) { // res = {parentNodeId, previousNodeId, node} if (res.node.nodeId > 0) { var parent = nodeWithId(res.parentNodeId); @@ -238,7 +240,7 @@ define(function DOMAgent(require, exports, module) { } // WebInspector Event: DOM.childNodeRemoved - function _onChildNodeRemoved(res) { + function _onChildNodeRemoved(event, res) { // res = {parentNodeId, nodeId} if (res.nodeId > 0) { var node = nodeWithId(res.nodeId); @@ -286,13 +288,15 @@ define(function DOMAgent(require, exports, module) { /** Initialize the agent */ function load() { _load = new $.Deferred(); - Inspector.on("Page.frameNavigated", _onFrameNavigated); - Inspector.on("Page.loadEventFired", _onLoadEventFired); - Inspector.on("DOM.documentUpdated", _onDocumentUpdated); - Inspector.on("DOM.setChildNodes", _onSetChildNodes); - Inspector.on("DOM.childNodeCountUpdated", _onChildNodeCountUpdated); - Inspector.on("DOM.childNodeInserted", _onChildNodeInserted); - Inspector.on("DOM.childNodeRemoved", _onChildNodeRemoved); + $(Inspector.Page) + .on("frameNavigated.DOMAgent", _onFrameNavigated) + .on("loadEventFired.DOMAgent", _onLoadEventFired); + $(Inspector.DOM) + .on("documentUpdated.DOMAgent", _onDocumentUpdated) + .on("setChildNodes.DOMAgent", _onSetChildNodes) + .on("childNodeCountUpdated.DOMAgent", _onChildNodeCountUpdated) + .on("childNodeInserted.DOMAgent", _onChildNodeInserted) + .on("childNodeRemoved.DOMAgent", _onChildNodeRemoved); Inspector.Page.enable(); Inspector.Page.reload(); return _load.promise(); @@ -300,13 +304,8 @@ define(function DOMAgent(require, exports, module) { /** Clean up */ function unload() { - Inspector.off("Page.frameNavigated", _onFrameNavigated); - Inspector.off("Page.loadEventFired", _onLoadEventFired); - Inspector.off("DOM.documentUpdated", _onDocumentUpdated); - Inspector.off("DOM.setChildNodes", _onSetChildNodes); - Inspector.off("DOM.childNodeCountUpdated", _onChildNodeCountUpdated); - Inspector.off("DOM.childNodeInserted", _onChildNodeInserted); - Inspector.off("DOM.childNodeRemoved", _onChildNodeRemoved); + $(Inspector.Page).off(".DOMAgent"); + $(Inspector.DOM).off(".DOMAgent"); } // Export private functions diff --git a/src/LiveDevelopment/Agents/EditAgent.js b/src/LiveDevelopment/Agents/EditAgent.js index c867e9c711f..e0144a2c84a 100644 --- a/src/LiveDevelopment/Agents/EditAgent.js +++ b/src/LiveDevelopment/Agents/EditAgent.js @@ -75,7 +75,7 @@ define(function EditAgent(require, exports, module) { } // Remote Event: Go to the given source node - function _onRemoteEdit(res) { + function _onRemoteEdit(event, res) { // res = {nodeId, name, value} var node = DOMAgent.nodeWithId(res.nodeId); node = node.children[0]; @@ -90,7 +90,7 @@ define(function EditAgent(require, exports, module) { var from = codeMirror.posFromIndex(node.location + change.from); var to = codeMirror.posFromIndex(node.location + change.to); editor.document.replaceRange(change.text, from, to); - + var newPos = codeMirror.posFromIndex(node.location + change.from + change.text.length); editor.setCursorPos(newPos.line, newPos.ch); } @@ -98,12 +98,12 @@ define(function EditAgent(require, exports, module) { /** Initialize the agent */ function load() { - Inspector.on("RemoteAgent.edit", _onRemoteEdit); + $(RemoteAgent).on("edit.EditAgent", _onRemoteEdit); } /** Initialize the agent */ function unload() { - Inspector.off("RemoteAgent.edit", _onRemoteEdit); + $(RemoteAgent).off(".EditAgent"); } // Export public functions diff --git a/src/LiveDevelopment/Agents/GotoAgent.js b/src/LiveDevelopment/Agents/GotoAgent.js index 3189e5eed53..39029401e1f 100644 --- a/src/LiveDevelopment/Agents/GotoAgent.js +++ b/src/LiveDevelopment/Agents/GotoAgent.js @@ -112,7 +112,7 @@ define(function GotoAgent(require, exports, module) { } /** Gather options where to go to from the given source node */ - function _onRemoteShowGoto(res) { + function _onRemoteShowGoto(event, res) { // res = {nodeId, name, value} var node = DOMAgent.nodeWithId(res.nodeId); @@ -177,7 +177,7 @@ define(function GotoAgent(require, exports, module) { } /** Go to the given source node */ - function _onRemoteGoto(res) { + function _onRemoteGoto(event, res) { // res = {nodeId, name, value} var location, url = res.value; var matches = /^(.*):([^:]+)$/.exec(url); @@ -195,14 +195,14 @@ define(function GotoAgent(require, exports, module) { /** Initialize the agent */ function load() { - Inspector.on("RemoteAgent.showgoto", _onRemoteShowGoto); - Inspector.on("RemoteAgent.goto", _onRemoteGoto); + $(RemoteAgent) + .on("showgoto.GotoAgent", _onRemoteShowGoto) + .on("goto.GotoAgent", _onRemoteGoto); } /** Initialize the agent */ function unload() { - Inspector.off("RemoteAgent.showgoto", _onRemoteShowGoto); - Inspector.off("RemoteAgent.goto", _onRemoteGoto); + $(RemoteAgent).off(".GotoAgent"); } // Export public functions diff --git a/src/LiveDevelopment/Agents/HighlightAgent.js b/src/LiveDevelopment/Agents/HighlightAgent.js index d9e7fca0286..3267e001e01 100644 --- a/src/LiveDevelopment/Agents/HighlightAgent.js +++ b/src/LiveDevelopment/Agents/HighlightAgent.js @@ -23,11 +23,13 @@ /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, forin: true, maxerr: 50, regexp: true */ -/*global define */ +/*global define, $ */ /** * HighlightAgent dispatches events for highlight requests from in-browser * highlight requests, and allows highlighting nodes and rules in the browser. + * + * Trigger "highlight" when a node should be highlighted */ define(function HighlightAgent(require, exports, module) { "use strict"; @@ -39,12 +41,12 @@ define(function HighlightAgent(require, exports, module) { var _highlight; // active highlight // Remote Event: Highlight - function _onRemoteHighlight(res) { + function _onRemoteHighlight(event, res) { var node; if (res.value === "1") { node = DOMAgent.nodeWithId(res.nodeId); } - Inspector.trigger("HighlightAgent.highlight", node); + $(exports).triggerHandler("highlight", node); } /** Hide in-browser highlighting */ @@ -103,12 +105,12 @@ define(function HighlightAgent(require, exports, module) { /** Initialize the agent */ function load() { _highlight = {}; - Inspector.on("RemoteAgent.highlight", _onRemoteHighlight); + $(RemoteAgent).on("highlight.HighlightAgent", _onRemoteHighlight); } /** Clean up */ function unload() { - Inspector.off("RemoteAgent.highlight", _onRemoteHighlight); + $(RemoteAgent).off(".HighlightAgent"); } // Export public functions diff --git a/src/LiveDevelopment/Agents/NetworkAgent.js b/src/LiveDevelopment/Agents/NetworkAgent.js index 9cabc7939da..aaafe461004 100644 --- a/src/LiveDevelopment/Agents/NetworkAgent.js +++ b/src/LiveDevelopment/Agents/NetworkAgent.js @@ -55,7 +55,7 @@ define(function NetworkAgent(require, exports, module) { } // WebInspector Event: Network.requestWillBeSent - function _onRequestWillBeSent(res) { + function _onRequestWillBeSent(event, res) { // res = {requestId, frameId, loaderId, documentURL, request, timestamp, initiator, stackTrace, redirectResponse} var url = _urlWithoutQueryString(res.request.url); _urlRequested[url] = true; @@ -65,12 +65,12 @@ define(function NetworkAgent(require, exports, module) { function load() { _urlRequested = {}; Inspector.Network.enable(); - Inspector.on("Network.requestWillBeSent", _onRequestWillBeSent); + $(Inspector.Network).on("requestWillBeSent.NetworkAgent", _onRequestWillBeSent); } /** Unload the agent */ function unload() { - Inspector.off("Network.requestWillBeSent", _onRequestWillBeSent); + $(Inspector.Network).off(".NetworkAgent"); } // Export public functions diff --git a/src/LiveDevelopment/Agents/RemoteAgent.js b/src/LiveDevelopment/Agents/RemoteAgent.js index f00ab972880..04da263ddfa 100644 --- a/src/LiveDevelopment/Agents/RemoteAgent.js +++ b/src/LiveDevelopment/Agents/RemoteAgent.js @@ -28,19 +28,22 @@ /** * RemoteAgent defines and provides an interface for custom remote functions * loaded from RemoteFunctions. Remote commands are executed via - * `call(name, varargs)`. Remote events are dispatched as events on the - * Inspector named "Remote.EVENT". + * `call(name, varargs)`. + * + * Remote events are dispatched as events on this object. */ define(function RemoteAgent(require, exports, module) { "use strict"; + var $exports = $(exports); + var Inspector = require("LiveDevelopment/Inspector/Inspector"); var _load; // deferred load var _objectId; // the object id of the remote object // WebInspector Event: Page.loadEventFired - function _onLoadEventFired(res) { + function _onLoadEventFired(event, res) { // res = {timestamp} var request = new XMLHttpRequest(); request.open("GET", "LiveDevelopment/Agents/RemoteFunctions.js"); @@ -56,11 +59,11 @@ define(function RemoteAgent(require, exports, module) { } // WebInspector Event: DOM.attributeModified - function _onAttributeModified(res) { + function _onAttributeModified(event, res) { // res = {nodeId, name, value} var matches = /^data-ld-(.*)/.exec(res.name); if (matches) { - Inspector.trigger("RemoteAgent." + matches[1], res); + $exports.triggerHandler(matches[1], res); } } @@ -103,15 +106,15 @@ define(function RemoteAgent(require, exports, module) { /** Initialize the agent */ function load() { _load = new $.Deferred(); - Inspector.on("Page.loadEventFired", _onLoadEventFired); - Inspector.on("DOM.attributeModified", _onAttributeModified); + $(Inspector.Page).on("loadEventFired.RemoteAgent", _onLoadEventFired); + $(Inspector.DOM).on("attributeModified.RemoteAgent", _onAttributeModified); return _load.promise(); } /** Clean up */ function unload() { - Inspector.off("Page.loadEventFired", _onLoadEventFired); - Inspector.off("DOM.attributeModified", _onAttributeModified); + $(Inspector.Page).off(".RemoteAgent"); + $(Inspector.DOM).off(".RemoteAgent"); } // Export public functions diff --git a/src/LiveDevelopment/Agents/RemoteFunctions.js b/src/LiveDevelopment/Agents/RemoteFunctions.js index 07006a94183..c7b17f49193 100644 --- a/src/LiveDevelopment/Agents/RemoteFunctions.js +++ b/src/LiveDevelopment/Agents/RemoteFunctions.js @@ -314,7 +314,7 @@ function RemoteFunctions() { } // install event listeners - + /* FUTURE window.document.addEventListener("keyup", _onKeyUp); window.document.addEventListener("mousemove", _onMouse); @@ -323,7 +323,7 @@ function RemoteFunctions() { window.document.addEventListener("mouseup", _preventEventWhenMeta, true); window.document.addEventListener("click", _onClick, true); */ - + return { "showGoto": showGoto, "hideHighlight": hideHighlight, diff --git a/src/LiveDevelopment/Agents/ScriptAgent.js b/src/LiveDevelopment/Agents/ScriptAgent.js index 3171351fb81..fa723785a0c 100644 --- a/src/LiveDevelopment/Agents/ScriptAgent.js +++ b/src/LiveDevelopment/Agents/ScriptAgent.js @@ -66,13 +66,13 @@ define(function ScriptAgent(require, exports, module) { } // DOMAgent Event: Document root loaded - function _onGetDocument(res) { + function _onGetDocument(event, res) { Inspector.DOMDebugger.setDOMBreakpoint(res.root.nodeId, "subtree-modified"); _load.resolve(); } // WebInspector Event: DOM.childNodeInserted - function _onChildNodeInserted(res) { + function _onChildNodeInserted(event, res) { // res = {parentNodeId, previousNodeId, node} if (_insertTrace) { var node = DOMAgent.nodeWithId(res.node.nodeId); @@ -83,19 +83,19 @@ define(function ScriptAgent(require, exports, module) { // TODO: Strip off query/hash strings from URL (see CSSAgent._canonicalize()) // WebInspector Event: Debugger.scriptParsed - function _onScriptParsed(res) { + function _onScriptParsed(event, res) { // res = {scriptId, url, startLine, startColumn, endLine, endColumn, isContentScript, sourceMapURL} _idToScript[res.scriptId] = res; _urlToScript[res.url] = res; } // WebInspector Event: Debugger.scriptFailedToParse - function _onScriptFailedToParse(res) { + function _onScriptFailedToParse(event, res) { // res = {url, scriptSource, startLine, errorLine, errorMessage} } // WebInspector Event: Debugger.paused - function _onPaused(res) { + function _onPaused(event, res) { // res = {callFrames, reason, data} switch (res.reason) { @@ -124,21 +124,20 @@ define(function ScriptAgent(require, exports, module) { _load = new $.Deferred(); Inspector.Debugger.enable(); Inspector.Debugger.setPauseOnExceptions("uncaught"); - Inspector.on("DOMAgent.getDocument", _onGetDocument); - Inspector.on("Debugger.scriptParsed", _onScriptParsed); - Inspector.on("Debugger.scriptFailedToParse", _onScriptFailedToParse); - Inspector.on("Debugger.paused", _onPaused); - Inspector.on("DOM.childNodeInserted", _onChildNodeInserted); + $(DOMAgent).on("getDocument.ScriptAgent", _onGetDocument); + $(Inspector.Debugger) + .on("scriptParsed.ScriptAgent", _onScriptParsed) + .on("scriptFailedToParse.ScriptAgent", _onScriptFailedToParse) + .on("paused.ScriptAgent", _onPaused); + $(Inspector.DOM).on("childNodeInserted.ScriptAgent", _onChildNodeInserted); return _load; } /** Clean up */ function unload() { - Inspector.off("DOMAgent.getDocument", _onGetDocument); - Inspector.off("Debugger.scriptParsed", _onScriptParsed); - Inspector.off("Debugger.scriptFailedToParse", _onScriptFailedToParse); - Inspector.off("Debugger.paused", _onPaused); - Inspector.off("DOM.childNodeInserted", _onChildNodeInserted); + $(DOMAgent).off(".ScriptAgent"); + $(Inspector.Debugger).off(".ScriptAgent"); + $(Inspector.DOM).off(".ScriptAgent"); } // Export public functions diff --git a/src/LiveDevelopment/Documents/CSSDocument.js b/src/LiveDevelopment/Documents/CSSDocument.js index 1f50a614c87..241f5c09f75 100644 --- a/src/LiveDevelopment/Documents/CSSDocument.js +++ b/src/LiveDevelopment/Documents/CSSDocument.js @@ -58,7 +58,7 @@ define(function CSSDocumentModule(require, exports, module) { */ var CSSDocument = function CSSDocument(doc, editor, inspector) { this.doc = doc; - + // FUTURE: Highlighting is currently disabled, since this code doesn't yet know // how to deal with different editors pointing at the same document. /* @@ -66,9 +66,9 @@ define(function CSSDocumentModule(require, exports, module) { this._highlight = []; this.onHighlight = this.onHighlight.bind(this); this.onCursorActivity = this.onCursorActivity.bind(this); - Inspector.on("HighlightAgent.highlight", this.onHighlight); + $(HighlightAgent).on("highlight", this.onHighlight); */ - + // Add a ref to the doc since we're listening for change events this.doc.addRef(); this.onChange = this.onChange.bind(this); @@ -89,7 +89,7 @@ define(function CSSDocumentModule(require, exports, module) { // res = {styleSheet} this.rules = res.styleSheet.rules; }.bind(this)); - + // If the CSS document is dirty, push the changes into the browser now if (doc.isDirty) { CSSAgent.reloadCSSForDocument(this.doc); @@ -99,7 +99,7 @@ define(function CSSDocumentModule(require, exports, module) { /** Get the browser version of the StyleSheet object */ CSSDocument.prototype.getStyleSheetFromBrowser = function getStyleSheetFromBrowser() { var deferred = new $.Deferred(); - + // WebInspector Command: CSS.getStyleSheet Inspector.CSS.getStyleSheet(this.styleSheet.styleSheetId, function callback(res) { // res = {styleSheet} @@ -109,20 +109,20 @@ define(function CSSDocumentModule(require, exports, module) { deferred.reject(); } }); - + return deferred.promise(); }; - + /** Get the browser version of the source */ CSSDocument.prototype.getSourceFromBrowser = function getSourceFromBrowser() { var deferred = new $.Deferred(); - + this.getStyleSheetFromBrowser().done(function onDone(styleSheet) { deferred.resolve(styleSheet.text); }).fail(function onFail() { deferred.reject(); }); - + return deferred.promise(); }; @@ -132,7 +132,7 @@ define(function CSSDocumentModule(require, exports, module) { $(this.doc).off("deleted", this.onDeleted); this.doc.releaseRef(); /* - Inspector.off("HighlightAgent.highlight", this.onHighlight); + $(HighlightAgent).off("highlight", this.onHighlight); $(this.editor).off("cursorActivity", this.onCursorActivity); this.onHighlight(); */ @@ -176,7 +176,7 @@ define(function CSSDocumentModule(require, exports, module) { CSSDocument.prototype.onDeleted = function onDeleted(event, editor, change) { // clear the CSS CSSAgent.clearCSSForDocument(this.doc); - + // shut down, since our Document is now dead this.close(); $(this).triggerHandler("deleted", [this]); diff --git a/src/LiveDevelopment/Documents/HTMLDocument.js b/src/LiveDevelopment/Documents/HTMLDocument.js index 9b967502447..84ce63a6d2f 100644 --- a/src/LiveDevelopment/Documents/HTMLDocument.js +++ b/src/LiveDevelopment/Documents/HTMLDocument.js @@ -58,7 +58,7 @@ define(function HTMLDocumentModule(require, exports, module) { this.onHighlight = this.onHighlight.bind(this); this.onChange = this.onChange.bind(this); this.onCursorActivity = this.onCursorActivity.bind(this); - Inspector.on("HighlightAgent.highlight", this.onHighlight); + $(HighlightAgent).on("highlight", this.onHighlight); $(this.editor).on("change", this.onChange); $(this.editor).on("cursorActivity", this.onCursorActivity); this.onCursorActivity(); @@ -66,7 +66,7 @@ define(function HTMLDocumentModule(require, exports, module) { /** Close the document */ HTMLDocument.prototype.close = function close() { - Inspector.off("HighlightAgent.highlight", this.onHighlight); + $(HighlightAgent).off("highlight", this.onHighlight); $(this.editor).off("change", this.onChange); $(this.editor).off("cursorActivity", this.onCursorActivity); this.onHighlight(); diff --git a/src/LiveDevelopment/Documents/JSDocument.js b/src/LiveDevelopment/Documents/JSDocument.js index d2cb2cbbd3c..120de1f48f4 100644 --- a/src/LiveDevelopment/Documents/JSDocument.js +++ b/src/LiveDevelopment/Documents/JSDocument.js @@ -60,7 +60,7 @@ define(function JSDocumentModule(require, exports, module) { this.onHighlight = this.onHighlight.bind(this); this.onChange = this.onChange.bind(this); this.onCursorActivity = this.onCursorActivity.bind(this); - Inspector.on("HighlightAgent.highlight", this.onHighlight); + $(HighlightAgent).on("highlight", this.onHighlight); $(this.editor).on("change", this.onChange); $(this.editor).on("cursorActivity", this.onCursorActivity); this.onCursorActivity(); @@ -68,7 +68,7 @@ define(function JSDocumentModule(require, exports, module) { /** Close the document */ JSDocument.prototype.close = function close() { - Inspector.off("HighlightAgent.highlight", this.onHighlight); + $(HighlightAgent).off("highlight", this.onHighlight); $(this.editor).off("change", this.onChange); $(this.editor).off("cursorActivity", this.onCursorActivity); this.onHighlight(); diff --git a/src/LiveDevelopment/Inspector/Inspector.js b/src/LiveDevelopment/Inspector/Inspector.js index 29c0435e926..1460df0992c 100644 --- a/src/LiveDevelopment/Inspector/Inspector.js +++ b/src/LiveDevelopment/Inspector/Inspector.js @@ -83,32 +83,14 @@ define(function Inspector(require, exports, module) { "use strict"; + // jQuery exports object for events + var $exports = $(exports); + var _messageId = 1; // id used for remote method calls, auto-incrementing var _messageCallbacks = {}; // {id -> function} for remote method calls - var _handlers = {}; // {name -> function} for attached event handlers var _socket; // remote debugger WebSocket var _connectDeferred; // The deferred connect - /** Trigger an event handler - * @param {function} event handler - * @param {Array} arguments array - */ - function _triggerHandler(handler, args) { - handler.apply(undefined, args); - } - - /** Trigger an event and all attached event handlers - * All passed arguments after the name are passed on as parameters. - * @param {string} event name - */ - function trigger(name, res) { - var i, handlers = _handlers[name]; - var args = Array.prototype.slice.call(arguments, 1); - for (i in handlers) { - window.setTimeout(_triggerHandler.bind(undefined, handlers[i], args)); - } - } - /** Check a parameter value against the given signature * This only checks for optional parameters, not types * Type checking is complex because of $ref and done on the remote end anyways @@ -138,7 +120,7 @@ define(function Inspector(require, exports, module) { // off auto re-opening when a new HTML file is selected. return; } - + console.assert(_socket, "You must connect to the WebSocket before sending messages."); var id, callback, args, i, params = {}; @@ -164,17 +146,17 @@ define(function Inspector(require, exports, module) { /** WebSocket did close */ function _onDisconnect() { _socket = undefined; - trigger("disconnect"); + $exports.triggerHandler("disconnect"); } /** WebSocket reported an error */ function _onError(error) { - trigger("error", error); + $exports.triggerHandler("error", [error]); } /** WebSocket did open */ function _onConnect() { - trigger("connect"); + $exports.triggerHandler("connect"); } /** Received message from the WebSocket @@ -186,15 +168,18 @@ define(function Inspector(require, exports, module) { */ function _onMessage(message) { var response = JSON.parse(message.data); - trigger("message", response); + $exports.triggerHandler("message", [response]); if (response.error) { - trigger("error", response.error); + $exports.triggerHandler("error", [response.error]); } else if (response.result) { if (_messageCallbacks[response.id]) { _messageCallbacks[response.id](response.result); } } else { - trigger(response.method, response.params); + var domainAndMethod = response.method.split("."); + var domain = domainAndMethod[0]; + var method = domainAndMethod[1]; + $(exports[domain]).triggerHandler(method, response.params); } } @@ -231,10 +216,7 @@ define(function Inspector(require, exports, module) { * @param {function} handler function */ function on(name, handler) { - if (!_handlers[name]) { - _handlers[name] = []; - } - _handlers[name].push(handler); + $exports.on(name, handler); } /** Remove the given or all event handler(s) for the given event or remove all event handlers @@ -242,18 +224,7 @@ define(function Inspector(require, exports, module) { * @param {function} optional handler function */ function off(name, handler) { - if (!name) { - _handlers = {}; - } else if (!handler) { - delete _handlers[name]; - } else { - var i, handlers = _handlers[name]; - for (i in handlers) { - if (handlers[i] === handler) { - handlers.splice(i, 1); - } - } - } + $exports.off(name, handler); } /** Disconnect from the remote debugger WebSocket */ @@ -344,7 +315,6 @@ define(function Inspector(require, exports, module) { } // Export public functions - exports.trigger = trigger; exports.getAvailableSockets = getAvailableSockets; exports.on = on; exports.off = off; diff --git a/src/LiveDevelopment/Inspector/Inspector.json b/src/LiveDevelopment/Inspector/Inspector.json index ba1d7bdc167..4e644dc5612 100644 --- a/src/LiveDevelopment/Inspector/Inspector.json +++ b/src/LiveDevelopment/Inspector/Inspector.json @@ -28,20 +28,6 @@ { "name": "object", "$ref": "Runtime.RemoteObject" }, { "name": "hints", "type": "object" } ] - }, - { - "name": "didCreateWorker", - "parameters": [ - { "name": "id", "type": "integer" }, - { "name": "url", "type": "string" }, - { "name": "isShared", "type": "boolean" } - ] - }, - { - "name": "didDestroyWorker", - "parameters": [ - { "name": "id", "type": "integer" } - ] } ] }, @@ -87,6 +73,15 @@ { "name": "nodeCount", "type": "array", "items": { "$ref": "NodeCount" }}, { "name": "listenerCount", "type": "array", "items": { "$ref": "ListenerCount" }} ] + }, + { + "id": "MemoryBlock", + "type": "object", + "properties": [ + { "name": "size", "type": "number", "optional": true, "description": "Size of the block in bytes if available" }, + { "name": "name", "type": "string", "description": "Unique name used to identify the component that allocated this block" }, + { "name": "children", "type": "array", "optional": true, "items": { "$ref": "MemoryBlock" }} + ] } ], "commands": [ @@ -96,6 +91,12 @@ { "name": "domGroups", "type": "array", "items": { "$ref": "DOMGroup" }}, { "name": "strings", "$ref": "StringStatistics" } ] + }, + { + "name": "getProcessMemoryDistribution", + "returns": [ + { "name": "distribution", "$ref": "MemoryBlock", "description": "An object describing all memory allocated by the process"} + ] } ] }, @@ -177,7 +178,7 @@ { "name": "value", "type": "string", "description": "Cookie value." }, { "name": "domain", "type": "string", "description": "Cookie domain." }, { "name": "path", "type": "string", "description": "Cookie path." }, - { "name": "expires", "type": "integer", "description": "Cookie expires." }, + { "name": "expires", "type": "number", "description": "Cookie expires." }, { "name": "size", "type": "integer", "description": "Cookie size." }, { "name": "httpOnly", "type": "boolean", "description": "True if cookie is http-only." }, { "name": "secure", "type": "boolean", "description": "True if cookie is secure." }, @@ -310,11 +311,21 @@ "hidden": true }, { - "name": "setScreenSizeOverride", - "description": "Overrides the values of window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media query results", + "name": "canOverrideDeviceMetrics", + "description": "Checks whether setDeviceMetricsOverride can be invoked.", + "returns": [ + { "name": "result", "type": "boolean", "description": "If true, setDeviceMetricsOverride can safely be invoked on the agent." } + ], + "hidden": true + }, + { + "name": "setDeviceMetricsOverride", + "description": "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.", "parameters": [ { "name": "width", "type": "integer", "description": "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override." }, - { "name": "height", "type": "integer", "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override." } + { "name": "height", "type": "integer", "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override." }, + { "name": "fontScaleFactor", "type": "number", "description": "Overriding font scale factor value (must be positive). 1 disables the override." }, + { "name": "fitWindow", "type": "boolean", "description": "Whether a view that exceeds the available browser window area should be scaled down to fit." } ], "hidden": true }, @@ -325,6 +336,74 @@ { "name": "result", "type": "boolean", "description": "True for showing paint rectangles" } ], "hidden": true + }, + { + "name": "getScriptExecutionStatus", + "description": "Determines if scripts can be executed in the page.", + "returns": [ + { "name": "result", "type": "string", "enum": ["allowed", "disabled", "forbidden"], "description": "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." } + ] + }, + { + "name": "setScriptExecutionDisabled", + "description": "Switches script execution in the page.", + "parameters": [ + { "name": "value", "type": "boolean", "description": "Whether script execution should be disabled in the page." } + ] + }, + { + "name": "setGeolocationOverride", + "description": "Overrides the Geolocation Position or Error.", + "parameters": [ + { "name": "latitude", "type": "number", "optional": true, "description": "Mock longitude"}, + { "name": "longitude", "type": "number", "optional": true, "description": "Mock latitude"}, + { "name": "accuracy", "type": "number", "optional": true, "description": "Mock accuracy"} + ], + "hidden": true + }, + { + "name": "clearGeolocationOverride", + "description": "Clears the overriden Geolocation Position and Error.", + "hidden": true + }, + { + "name": "canOverrideGeolocation", + "description": "Checks if Geolocation can be overridden.", + "returns": [ + { "name": "result", "type": "boolean", "description": "True if browser can ovrride Geolocation." } + ], + "hidden": true + }, + { + "name": "setDeviceOrientationOverride", + "description": "Overrides the Device Orientation.", + "parameters": [ + { "name": "alpha", "type": "number", "description": "Mock alpha"}, + { "name": "beta", "type": "number", "description": "Mock beta"}, + { "name": "gamma", "type": "number", "description": "Mock gamma"} + ], + "hidden": true + }, + { + "name": "clearDeviceOrientationOverride", + "description": "Clears the overridden Device Orientation.", + "hidden": true + }, + { + "name": "canOverrideDeviceOrientation", + "description": "Check the backend if Web Inspector can override the device orientation.", + "returns": [ + { "name": "result", "type": "boolean", "description": "If true, setDeviceOrientationOverride can safely be invoked on the agent." } + ], + "hidden": true + }, + { + "name": "setTouchEmulationEnabled", + "parameters": [ + { "name": "enabled", "type": "boolean", "description": "Whether the touch event emulation should be enabled." } + ], + "description": "Toggles mouse event-based touch event emulation.", + "hidden": true } ], "events": [ @@ -377,7 +456,30 @@ { "name": "className", "type": "string", "optional": true, "description": "Object class (constructor) name. Specified for object type values only." }, { "name": "value", "type": "any", "optional": true, "description": "Remote object value (in case of primitive values or JSON values if it was requested)." }, { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." }, - { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Unique object identifier (for non-primitive values)." } + { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Unique object identifier (for non-primitive values)." }, + { "name": "preview", "$ref": "ObjectPreview", "optional": true, "description": "Preview containsing abbreviated property values.", "hidden": true } + ] + }, + { + "id": "ObjectPreview", + "type": "object", + "hidden": true, + "description": "Object containing abbreviated remote object value.", + "properties": [ + { "name": "lossless", "type": "boolean", "description": "Determines whether preview is lossless (contains all information of the original object)." }, + { "name": "overflow", "type": "boolean", "description": "True iff some of the properties of the original did not fit." }, + { "name": "properties", "type": "array", "items": { "$ref": "PropertyPreview" }, "description": "List of the properties." } + ] + }, + { + "id": "PropertyPreview", + "type": "object", + "hidden": true, + "properties": [ + { "name": "name", "type": "string", "description": "Property name." }, + { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean"], "description": "Object type." }, + { "name": "value", "type": "string", "optional": true, "description": "User-friendly property value string." }, + { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date"], "description": "Object subtype hint. Specified for object type values only." } ] }, { @@ -403,7 +505,26 @@ { "name": "value", "type": "any", "optional": true, "description": "Primitive value." }, { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Remote object handle." } ] + }, + { + "id": "ExecutionContextId", + "type": "integer", + "description": "Id of an execution context.", + "hidden": true + }, + { + "id": "ExecutionContextDescription", + "type": "object", + "description": "Description of an isolated world.", + "properties": [ + { "name": "id", "$ref": "ExecutionContextId", "description": "Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed." }, + { "name": "isPageContext", "type": "boolean", "description": "True if this is a context where inpspected web page scripts run. False if it is a content script isolated context." }, + { "name": "name", "type": "string", "description": "Human readable name describing given context." }, + { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the owning frame." } + ], + "hidden": true } + ], "commands": [ { @@ -412,8 +533,8 @@ { "name": "expression", "type": "string", "description": "Expression to evaluate." }, { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }, { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation.", "hidden": true }, - { "name": "doNotPauseOnExceptions", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions. Overrides setPauseOnException state.", "hidden": true }, - { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "Specifies in which frame to perform evaluation.", "hidden": true }, + { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state.", "hidden": true }, + { "name": "contextId", "$ref": "Runtime.ExecutionContextId", "optional": true, "description": "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.", "hidden": true }, { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." } ], "returns": [ @@ -428,6 +549,7 @@ { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to call function on." }, { "name": "functionDeclaration", "type": "string", "description": "Declaration of the function to call." }, { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument", "description": "Call argument." }, "optional": true, "description": "Call arguments. All call arguments must belong to the same JavaScript world as the target object." }, + { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether function call should stop on exceptions and mute console. Overrides setPauseOnException state.", "hidden": true }, { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." } ], "returns": [ @@ -465,6 +587,24 @@ "name": "run", "hidden": true, "description": "Tells inspected instance(worker or page) that it can run in case it was started paused." + }, + { + "name": "setReportExecutionContextCreation", + "parameters": [ + { "name": "enabled", "type": "boolean", "description": "Reporting enabled state." } + ], + "hidden": true, + "description": "Enables reporting about creation of isolated contexts by means of isolatedContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing isolated context." + } + + ], + "events": [ + { + "name": "isolatedContextCreated", + "parameters": [ + { "name": "context", "$ref": "ExecutionContextDescription", "description": "A newly created isolated contex." } + ], + "description": "Issued when new isolated context is created." } ] }, @@ -540,7 +680,7 @@ "name": "addInspectedHeapObject", "parameters": [ { "name": "heapObjectId", "type": "integer" } - ] + ] } ], "events": [ @@ -665,6 +805,17 @@ { "name": "challengeResponse", "type": "string", "description": "Challenge response." } ] }, + { + "id": "WebSocketFrame", + "type": "object", + "description": "WebSocket frame data.", + "hidden": true, + "properties": [ + { "name": "opcode", "type": "number", "description": "WebSocket frame opcode." }, + { "name": "mask", "type": "boolean", "description": "WebSocke frame mask." }, + { "name": "payloadData", "type": "string", "description": "WebSocke frame payload data." } + ] + }, { "id": "CachedResource", "type": "object", @@ -764,7 +915,6 @@ { "name": "request", "$ref": "Request", "description": "Request data." }, { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, { "name": "initiator", "$ref": "Initiator", "description": "Request initiator." }, - { "name": "stackTrace", "$ref": "Console.StackTrace", "optional": true, "description": "JavaScript stack trace upon issuing this request." }, { "name": "redirectResponse", "optional": true, "$ref": "Response", "description": "Redirect response data." } ] }, @@ -865,6 +1015,36 @@ { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." } ], "hidden": true + }, + { + "name": "webSocketFrameReceived", + "description": "Fired when WebSocket frame is received.", + "parameters": [ + { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, + { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, + { "name": "response", "$ref": "WebSocketFrame", "description": "WebSocket response data." } + ], + "hidden": true + }, + { + "name": "webSocketFrameError", + "description": "Fired when WebSocket frame error occurs.", + "parameters": [ + { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, + { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, + { "name": "errorMessage", "type": "string", "description": "WebSocket frame error message." } + ], + "hidden": true + }, + { + "name": "webSocketFrameSent", + "description": "Fired when WebSocket frame is sent.", + "parameters": [ + { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." }, + { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." }, + { "name": "response", "$ref": "WebSocketFrame", "description": "WebSocket response data." } + ], + "hidden": true } ] }, @@ -872,13 +1052,19 @@ "domain": "Database", "hidden": true, "types": [ + { + "id": "DatabaseId", + "type": "string", + "description": "Unique identifier of Database object.", + "hidden": true + }, { "id": "Database", "type": "object", "description": "Database object.", "hidden": true, "properties": [ - { "name": "id", "type": "string", "description": "Database ID." }, + { "name": "id", "$ref": "DatabaseId", "description": "Database ID." }, { "name": "domain", "type": "string", "description": "Database domain." }, { "name": "name", "type": "string", "description": "Database name." }, { "name": "version", "type": "string", "description": "Database version." } @@ -902,7 +1088,7 @@ { "name": "getDatabaseTableNames", "parameters": [ - { "name": "databaseId", "type": "integer" } + { "name": "databaseId", "$ref": "DatabaseId" } ], "returns": [ { "name": "tableNames", "type": "array", "items": { "type": "string" } } @@ -911,7 +1097,7 @@ { "name": "executeSQL", "parameters": [ - { "name": "databaseId", "type": "integer" }, + { "name": "databaseId", "$ref": "DatabaseId" }, { "name": "query", "type": "string" } ], "returns": [ @@ -973,7 +1159,8 @@ "description": "Object store.", "properties": [ { "name": "name", "type": "string", "description": "Object store name." }, - { "name": "keyPath", "type": "string", "description": "Object store key path." }, + { "name": "keyPath", "$ref": "KeyPath", "description": "Object store key path." }, + { "name": "autoIncrement", "type": "boolean", "description": "If true, object store has auto increment flag set." }, { "name": "indexes", "type": "array", "items": { "$ref": "ObjectStoreIndex" }, "description": "Indexes in this object store." } ] }, @@ -983,7 +1170,7 @@ "description": "Object store index.", "properties": [ { "name": "name", "type": "string", "description": "Index name." }, - { "name": "keyPath", "type": "string", "description": "Index key path." }, + { "name": "keyPath", "$ref": "KeyPath", "description": "Index key path." }, { "name": "unique", "type": "boolean", "description": "If true, index is unique." }, { "name": "multiEntry", "type": "boolean", "description": "If true, index allows multiple entries for a key." } ] @@ -1014,12 +1201,22 @@ { "id": "DataEntry", "type": "object", - "description": "Key.", + "description": "Data entry.", "properties": [ { "name": "key", "$ref": "Key", "description": "Key." }, { "name": "primaryKey", "$ref": "Key", "description": "Primary key." }, { "name": "value", "$ref": "Runtime.RemoteObject", "description": "Value." } ] + }, + { + "id": "KeyPath", + "type": "object", + "description": "Key path.", + "properties": [ + { "name": "type", "type": "string", "enum": ["null", "string", "array"], "description": "Key path type." }, + { "name": "string", "type": "string", "optional": true, "description": "String value." }, + { "name": "array", "type": "array", "optional": true, "items": { "type": "string" }, "description": "Array value." } + ] } ], "commands": [ @@ -1100,16 +1297,29 @@ "domain": "DOMStorage", "hidden": true, "types": [ + { + "id": "StorageId", + "type": "string", + "description": "Unique identifier of DOM storage entry.", + "hidden": true + }, { "id": "Entry", "type": "object", "description": "DOM Storage entry.", "hidden": true, "properties": [ - { "name": "host", "type": "string", "description": "Domain name." }, + { "name": "origin", "type": "string", "description": "Document origin." }, { "name": "isLocalStorage", "type": "boolean", "description": "True for local storage." }, - { "name": "id", "type": "number", "description": "Entry id for further reference." } + { "name": "id", "$ref": "StorageId", "description": "Entry id for further reference." } ] + }, + { + "id": "Item", + "type": "array", + "description": "DOM Storage item.", + "hidden": true, + "items": { "type": "string" } } ], "commands": [ @@ -1124,16 +1334,16 @@ { "name": "getDOMStorageEntries", "parameters": [ - { "name": "storageId", "type": "integer" } + { "name": "storageId", "$ref": "StorageId" } ], "returns": [ - { "name": "entries", "type": "array", "items": { "$ref": "Entry"} } + { "name": "entries", "type": "array", "items": { "$ref": "Item" } } ] }, { "name": "setDOMStorageItem", "parameters": [ - { "name": "storageId", "type": "integer" }, + { "name": "storageId", "$ref": "StorageId" }, { "name": "key", "type": "string" }, { "name": "value", "type": "string" } ], @@ -1144,7 +1354,7 @@ { "name": "removeDOMStorageItem", "parameters": [ - { "name": "storageId", "type": "integer" }, + { "name": "storageId", "$ref": "StorageId" }, { "name": "key", "type": "string" } ], "returns": [ @@ -1160,9 +1370,9 @@ ] }, { - "name": "updateDOMStorage", + "name": "domStorageUpdated", "parameters": [ - { "name": "storageId", "type": "integer" } + { "name": "storageId", "$ref": "StorageId" } ] } ] @@ -1257,6 +1467,35 @@ { "domain": "FileSystem", "hidden": true, + "types": [ + { + "id": "RequestId", + "type": "integer", + "description": "Request Identifier to glue a request and its completion event." + }, + { + "id": "Entry", + "type": "object", + "properties": [ + { "name": "url", "type": "string", "description": "filesystem: URL for the entry." }, + { "name": "name", "type": "string", "description": "The name of the file or directory." }, + { "name": "isDirectory", "type": "boolean", "description": "True if the entry is a directory." }, + { "name": "mimeType", "type": "string", "optional": true, "description": "MIME type of the entry, available for a file only." }, + { "name": "resourceType", "$ref": "Page.ResourceType", "optional": true, "description": "ResourceType of the entry, available for a file only." }, + { "name": "isTextFile", "type": "boolean", "optional": true, "description": "True if the entry is a text file." } + ], + "description": "Represents a browser side file or directory." + }, + { + "id": "Metadata", + "type": "object", + "properties": [ + { "name": "modificationTime", "type": "number", "description": "Modification time." }, + { "name": "size", "type": "number", "description": "File size. This field is always zero for directories." } + ], + "description": "Represents metadata of a file or entry." + } + ], "commands": [ { "name": "enable", @@ -1264,10 +1503,92 @@ }, { "name": "disable", - "description": "Disables events from backend.." + "description": "Disables events from backend." + }, + { + "name": "requestFileSystemRoot", + "parameters": [ + { "name": "origin", "type": "string", "description": "Security origin of requesting FileSystem. One of frames in current page needs to have this security origin." }, + { "name": "type", "type": "string", "enum": ["temporary", "persistent"], "description": "FileSystem type of requesting FileSystem." } + ], + "returns": [ + { "name": "requestId", "$ref": "RequestId", "description": "Request identifier. Corresponding fileSystemRootReceived event should have same requestId with this." } + ], + "description": "Returns root directory of the FileSystem as fileSystemRootReceived event, if exists." + }, + { + "name": "requestDirectoryContent", + "parameters": [ + { "name": "url", "type": "string", "description": "URL of the directory that the frontend is requesting to read from." } + ], + "returns": [ + { "name": "requestId", "$ref": "RequestId", "description": "Request identifier. Corresponding directoryContentReceived event should have same requestId with this." } + ], + "description": "Returns content of the directory as directoryContentReceived event." + }, + { + "name": "requestMetadata", + "parameters": [ + { "name": "url", "type": "string", "description": "URL of the entry that the frontend is requesting to get metadata from." } + ], + "returns": [ + { "name": "requestId", "$ref": "RequestId", "description": "Request identifier. Corresponding metadataReceived event should have same requestId with this." } + ], + "description": "Returns metadata of the entry as metadataReceived event." + }, + { + "name": "requestFileContent", + "parameters": [ + { "name": "url", "type": "string", "description": "URL of the file that the frontend is requesting to read from." }, + { "name": "readAsText", "type": "boolean", "description": "True if the content should be read as text, otherwise the result will be returned as base64 encoded text." }, + { "name": "start", "type": "integer", "optional": true, "description": "Specifies the start of range to read." }, + { "name": "end", "type": "integer", "optional": true, "description": "Specifies the end of range to read exclusively." }, + { "name": "charset", "type": "string", "optional": true, "description": "Overrides charset of the content when content is served as text." } + ], + "returns": [ + { "name": "requestId", "$ref": "RequestId", "description": "Request identifier. Corresponding fileContentReceived event should have same requestId with this." } + ], + "description": "Returns content of the file as fileContentReceived event. Result should be sliced into [start, end)." } ], "events": [ + { + "name": "fileSystemRootReceived", + "parameters": [ + { "name": "requestId", "type": "integer", "description": "Request Identifier that was returned by corresponding requestFileSystemRoot command." }, + { "name": "errorCode", "type": "integer", "description": "0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value." }, + { "name": "root", "$ref": "FileSystem.Entry", "optional": true, "description": "Contains root of the requested FileSystem if the command completed successfully." } + ], + "description": "Completion event of requestFileSystemRoot command." + }, + { + "name": "directoryContentReceived", + "parameters": [ + { "name": "requestId", "type": "integer", "description": "Request Identifier that was returned by corresponding requestDirectoryContent command." }, + { "name": "errorCode", "type": "integer", "description": "0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value." }, + { "name": "entries", "type": "array", "items": { "$ref": "FileSystem.Entry" }, "optional": true, "description": "Contains all entries on directory if the command completed successfully." } + ], + "description": "Completion event of requestDirectoryContent command." + }, + { + "name": "metadataReceived", + "parameters": [ + { "name": "requestId", "type": "integer", "description": "Request Identifier that was returned in response to the corresponding requestMetadata command." }, + { "name": "errorCode", "type": "integer", "description": "0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value." }, + { "name": "metadata", "$ref": "FileSystem.Metadata", "optional": true, "description": "Contains metadata of the entry if the command completed successfully." } + ], + "description": "Completion event of requestMetadata command." + }, + { + "name": "fileContentReceived", + "parameters": [ + { "name": "requestId", "type": "integer", "description": "Request Identifier that was returned in response to the corresponding requestFileContent command." }, + { "name": "errorCode", "type": "integer", "description": "0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value." }, + { "name": "content", "type": "string", "optional": true, "description": "Content of the file." }, + { "name": "charset", "type": "string", "optional": true, "description": "Charset of the content if it is served as text." } + ], + "description": "Completion event of requestFileContent command." + } ] }, { @@ -1589,14 +1910,6 @@ ], "description": "Moves node into the new container, places it before the given anchor." }, - { - "name": "setTouchEmulationEnabled", - "parameters": [ - { "name": "enabled", "type": "boolean", "description": "Whether the touch event emulation should be enabled." } - ], - "description": "Toggles mouse event-based touch event emulation.", - "hidden": true - }, { "name": "undo", "description": "Undoes the last performed action.", @@ -1722,6 +2035,12 @@ ], "description": "This object identifies a CSS style in a unique way." }, + { + "id": "StyleSheetOrigin", + "type": "string", + "enum": ["user", "user-agent", "inspector", "regular"], + "description": "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." + }, { "id": "CSSRuleId", "type": "object", @@ -1763,7 +2082,9 @@ "type": "object", "properties": [ { "name": "styleSheetId", "$ref": "StyleSheetId", "description": "The stylesheet identifier."}, + { "name": "frameId", "$ref": "Network.FrameId", "description": "Owner frame identifier."}, { "name": "sourceURL", "type": "string", "description": "Stylesheet resource URL."}, + { "name": "origin", "$ref": "StyleSheetOrigin", "description": "Stylesheet origin."}, { "name": "title", "type": "string", "description": "Stylesheet title."}, { "name": "disabled", "type": "boolean", "description": "Denotes whether the stylesheet is disabled."} ], @@ -1787,7 +2108,7 @@ { "name": "selectorText", "type": "string", "description": "Rule selector."}, { "name": "sourceURL", "type": "string", "optional": true, "description": "Parent stylesheet resource URL (for regular rules)."}, { "name": "sourceLine", "type": "integer", "description": "Line ordinal of the rule selector start character in the resource."}, - { "name": "origin", "type": "string", "enum": ["user", "user-agent", "inspector", "regular"], "description": "The parent stylesheet type: \"user\" for user stylesheets, \"user-agent\" for user-agent stylesheets, \"inspector\" for stylesheets created by the inspector (i.e. those holding new rules created with addRule()), \"regular\" for regular stylesheets."}, + { "name": "origin", "$ref": "StyleSheetOrigin", "description": "Parent stylesheet's origin."}, { "name": "style", "$ref": "CSSStyle", "description": "Associated style declaration." }, { "name": "selectorRange", "$ref": "SourceRange", "optional": true, "description": "The rule selector range in the underlying resource (if available)." }, { "name": "media", "type": "array", "items": { "$ref": "CSSMedia" }, "optional": true, "description": "Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards." } @@ -1807,6 +2128,14 @@ "id": "ShorthandEntry", "type": "object" }, + { + "id": "CSSPropertyInfo", + "type": "object", + "properties": [ + { "name": "name", "type": "string", "description": "Property name." }, + { "name": "longhands", "type": "array", "optional": true, "items": { "type": "string" }, "description": "Longhand property names." } + ] + }, { "id": "CSSComputedStyleProperty", "type": "object", @@ -1814,7 +2143,7 @@ { "name": "name", "type": "string", "description": "Computed style property name." }, { "name": "value", "type": "string", "description": "Computed style property value." } ] - }, + }, { "id": "CSSStyle", "type": "object", @@ -1840,7 +2169,6 @@ { "name": "text", "type": "string", "optional": true, "description": "The full property text as specified in the style." }, { "name": "parsedOk", "type": "boolean", "optional": true, "description": "Whether the property is understood by the browser (implies true if absent)." }, { "name": "status", "type": "string", "enum": ["active", "inactive", "disabled", "style"], "optional": true, "description": "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." }, - { "name": "shorthandName", "type": "string", "optional": true, "description": "The related shorthand property name (absent if this property is not a longhand)." }, { "name": "range", "$ref": "SourceRange", "optional": true, "description": "The entire property range in the enclosing style declaration (if available)." } ], "description": "CSS style effective visual dimensions and source offsets." @@ -1876,6 +2204,29 @@ { "name": "totalTime", "type": "number", "description": "Total processing time for all selectors in the profile (in milliseconds.)" }, { "name": "data", "type": "array", "items": { "$ref": "SelectorProfileEntry" }, "description": "CSS selector profile entries." } ] + }, + { + "id": "Region", + "type": "object", + "properties": [ + { "name": "regionOverset", "type": "string", "enum": ["overset", "fit", "empty"], "description": "The \"overset\" attribute of a Named Flow." }, + { "name": "nodeId", "$ref": "DOM.NodeId", "description": "The corresponding DOM node id." } + ], + "description": "This object represents a region that flows from a Named Flow.", + "hidden": true + }, + { + "id": "NamedFlow", + "type": "object", + "properties": [ + { "name": "documentNodeId", "$ref": "DOM.NodeId", "description": "The document node id." }, + { "name": "name", "type": "string", "description": "Named Flow identifier." }, + { "name": "overset", "type": "boolean", "description": "The \"overset\" attribute of a Named Flow." }, + { "name": "content", "type": "array", "items": { "$ref": "DOM.NodeId" }, "description": "An array of nodes that flow into the Named Flow." }, + { "name": "regions", "type": "array", "items": { "$ref": "Region" }, "description": "An array of regions associated with the Named Flow." } + ], + "description": "This object represents a Named Flow.", + "hidden": true } ], "commands": [ @@ -1891,7 +2242,6 @@ "name": "getMatchedStylesForNode", "parameters": [ { "name": "nodeId", "$ref": "DOM.NodeId" }, - { "name": "forcedPseudoClasses", "type": "array", "items": { "type": "string", "enum": ["active", "focus", "hover", "visited"] }, "optional": true, "description": "Element pseudo classes to force when computing applicable style rules." }, { "name": "includePseudo", "type": "boolean", "optional": true, "description": "Whether to include pseudo styles (default: true)." }, { "name": "includeInherited", "type": "boolean", "optional": true, "description": "Whether to include inherited styles (default: true)." } ], @@ -1916,8 +2266,7 @@ { "name": "getComputedStyleForNode", "parameters": [ - { "name": "nodeId", "$ref": "DOM.NodeId" }, - { "name": "forcedPseudoClasses", "type": "array", "items": { "type": "string", "enum": ["active", "focus", "hover", "visited"] }, "optional": true, "description": "Element pseudo classes to force when computing applicable style rules." } + { "name": "nodeId", "$ref": "DOM.NodeId" } ], "returns": [ { "name": "computedStyle", "type": "array", "items": { "$ref": "CSSComputedStyleProperty" }, "description": "Computed style for the specified DOM node." } @@ -2009,10 +2358,18 @@ { "name": "getSupportedCSSProperties", "returns": [ - { "name": "cssProperties", "type": "array", "items": { "type": "string" }, "description": "Supported property names." } + { "name": "cssProperties", "type": "array", "items": { "$ref": "CSSPropertyInfo" }, "description": "Supported property metainfo." } ], "description": "Returns all supported CSS property names." }, + { + "name": "forcePseudoState", + "parameters": [ + { "name": "nodeId", "$ref": "DOM.NodeId", "description": "The element id for which to force the pseudo state." }, + { "name": "forcedPseudoClasses", "type": "array", "items": { "type": "string", "enum": ["active", "focus", "hover", "visited"] }, "description": "Element pseudo classes to force when computing the element's style." } + ], + "description": "Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser." + }, { "name": "startSelectorProfiler" }, @@ -2021,6 +2378,29 @@ "returns": [ { "name": "profile", "$ref": "SelectorProfile" } ] + }, + { + "name": "getNamedFlowCollection", + "parameters": [ + { "name": "documentNodeId", "$ref": "DOM.NodeId", "description": "The document node id for which to get the Named Flow Collection." } + ], + "returns": [ + { "name": "namedFlows", "type": "array", "items": { "$ref": "NamedFlow" }, "description": "An array containing the Named Flows in the document." } + ], + "description": "Returns the Named Flows from the document.", + "hidden": true + }, + { + "name": "getFlowByName", + "parameters": [ + { "name": "documentNodeId", "$ref": "DOM.NodeId", "description": "The document node id." }, + { "name": "name", "type": "string", "description": "Named Flow identifier." } + ], + "returns": [ + { "name": "namedFlow", "$ref": "NamedFlow", "description": "A Named Flow." } + ], + "description": "Returns the Named Flow identified by the given name", + "hidden": true } ], "events": [ @@ -2034,6 +2414,24 @@ { "name": "styleSheetId", "$ref": "StyleSheetId" } ], "description": "Fired whenever a stylesheet is changed as a result of the client operation." + }, + { + "name": "namedFlowCreated", + "parameters": [ + { "name": "documentNodeId", "$ref": "DOM.NodeId", "description": "The document node id." }, + { "name": "namedFlow", "type": "string", "description": "Identifier of the new Named Flow." } + ], + "description": "Fires when a Named Flow is created.", + "hidden": true + }, + { + "name": "namedFlowRemoved", + "parameters": [ + { "name": "documentNodeId", "$ref": "DOM.NodeId", "description": "The document node id." }, + { "name": "namedFlow", "type": "string", "description": "Identifier of the removed Named Flow." } + ], + "description": "Fires when a Named Flow is removed: has no associated content nodes and regions.", + "hidden": true } ] }, @@ -2071,6 +2469,14 @@ ], "hidden": true, "description": "Starts calculating various DOM statistics and sending them as part of timeline events." + }, + { + "name": "supportsFrameInstrumentation", + "returns": [ + { "name": "result", "type": "boolean", "description": "True if timeline supports frame instrumentation." } + ], + "hidden": true, + "description": "Tells whether timeline agent supports frame instrumentation." } ], "events": [ @@ -2120,7 +2526,8 @@ { "name": "location", "$ref": "Location", "description": "Location of the function." }, { "name": "name", "type": "string", "optional": true, "description": "Name of the function. Not present for anonymous functions." }, { "name": "displayName", "type": "string", "optional": true, "description": "Display name of the function(specified in 'displayName' property on the function object)." }, - { "name": "inferredName", "type": "string", "optional": true, "description": "Name of the function inferred from its initial assignment." } + { "name": "inferredName", "type": "string", "optional": true, "description": "Name of the function inferred from its initial assignment." }, + { "name": "scopeChain", "type": "array", "optional": true, "items": { "$ref": "Scope" }, "description": "Scope chain for this closure." } ], "description": "Information about the function." }, @@ -2156,12 +2563,12 @@ "description": "Tells whether enabling debugger causes scripts recompilation." }, { - "name": "supportsNativeBreakpoints", + "name": "supportsSeparateScriptCompilationAndExecution", "returns": [ - { "name": "result", "type": "boolean", "description": "True if debugger supports native breakpoints." } + { "name": "result", "type": "boolean", "description": "True if debugger supports separate script compilation and execution." } ], "hidden": true, - "description": "Tells whether debugger supports native breakpoints." + "description": "Tells whether debugger supports separate script compilation and execution." }, { "name": "enable", @@ -2189,7 +2596,7 @@ ], "returns": [ { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." }, - { "name": "locations", "optional": true, "type": "array", "items": { "$ref": "Location"}, "description": "List of the locations this breakpoint resolved into upon addition." } + { "name": "locations", "type": "array", "items": { "$ref": "Location"}, "description": "List of the locations this breakpoint resolved into upon addition." } ], "description": "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." }, @@ -2272,6 +2679,18 @@ ], "description": "Edits JavaScript source live." }, + { + "name": "restartFrame", + "parameters": [ + { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." } + ], + "returns": [ + { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame"}, "description": "New stack trace." }, + { "name": "result", "type": "object", "description": "VM-specific description.", "hidden": true } + ], + "hidden": true, + "description": "Restarts particular call frame from the beginning." + }, { "name": "getScriptSource", "parameters": [ @@ -2307,6 +2726,7 @@ { "name": "expression", "type": "string", "description": "Expression to evaluate." }, { "name": "objectGroup", "type": "string", "optional": true, "description": "String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup)." }, { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Specifies whether command line API should be available to the evaluated expression, defaults to false.", "hidden": true }, + { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state.", "hidden": true }, { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." } ], "returns": [ @@ -2314,6 +2734,42 @@ { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." } ], "description": "Evaluates expression on a given call frame." + }, + { + "name": "compileScript", + "hidden": true, + "parameters": [ + { "name": "expression", "type": "string", "description": "Expression to compile." }, + { "name": "sourceURL", "type": "string", "description": "Source url to be set for the script." } + ], + "returns": [ + { "name": "scriptId", "$ref": "ScriptId", "optional": true, "description": "Id of the script." }, + { "name": "syntaxErrorMessage", "type": "string", "optional": true, "description": "Syntax error message if compilation failed." } + ], + "description": "Compiles expression." + }, + { + "name": "runScript", + "hidden": true, + "parameters": [ + { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to run." }, + { "name": "contextId", "$ref": "Runtime.ExecutionContextId", "optional": true, "description": "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." }, + { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }, + { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether script run should stop on exceptions and mute console. Overrides setPauseOnException state." } + ], + "returns": [ + { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Run result." }, + { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the script run." } + ], + "description": "Runs script with given id in a given context." + }, + { + "name": "setOverlayMessage", + "parameters": [ + { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." } + ], + "hidden": true, + "description": "Sets overlay message." } ], "events": [ @@ -2448,14 +2904,29 @@ "hidden": true, "types": [ { - "id": "Profile", + "id": "ProfileHeader", "type": "object", - "description": "Profile." + "description": "Profile header.", + "properties": [ + { "name": "typeId", "type": "string", "enum": ["CPU", "CSS", "HEAP"], "description": "Profile type name." }, + { "name": "title", "type": "string", "description": "Profile title." }, + { "name": "uid", "type": "integer", "description": "Unique identifier of the profile." }, + { "name": "maxJSObjectId", "type": "integer", "optional": true, "description": "Last seen JS object Id." } + ] }, { - "id": "ProfileHeader", + "id": "Profile", "type": "object", - "description": "Profile header." + "description": "Profile.", + "properties": [ + { "name": "head", "type": "object", "optional": true }, + { "name": "bottomUpHead", "type": "object", "optional": true } + ] + }, + { + "id": "HeapSnapshotObjectId", + "type": "string", + "description": "Heap snashot object id." } ], "commands": [ @@ -2524,12 +2995,21 @@ { "name": "getObjectByHeapObjectId", "parameters": [ - { "name": "objectId", "type": "integer" }, + { "name": "objectId", "$ref": "HeapSnapshotObjectId" }, { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." } ], "returns": [ { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Evaluation result." } ] + }, + { + "name": "getHeapObjectId", + "parameters": [ + { "name": "objectId", "$ref": "Runtime.RemoteObjectId", "description": "Identifier of the object to get heap object id for." } + ], + "returns": [ + { "name": "heapSnapshotObjectId", "$ref": "HeapSnapshotObjectId", "description": "Id of the heap snapshot object corresponding to the passed remote object id." } + ] } ], "events": [ @@ -2576,10 +3056,10 @@ "types": [], "commands": [ { - "name": "setWorkerInspectionEnabled", - "parameters": [ - { "name": "value", "type": "boolean" } - ] + "name": "enable" + }, + { + "name": "disable" }, { "name": "sendMessageToWorker", @@ -2633,5 +3113,21 @@ "name": "disconnectedFromWorker" } ] + }, + { + "domain": "WebGL", + "hidden": true, + "types": [], + "commands": [ + { + "name": "enable", + "description": "Enables WebGL inspection." + }, + { + "name": "disable", + "description": "Disables WebGL inspection." + } + ], + "events": [] }] } diff --git a/src/LiveDevelopment/Inspector/inspector.html b/src/LiveDevelopment/Inspector/inspector.html index e76989d0ba0..b757a99d790 100644 --- a/src/LiveDevelopment/Inspector/inspector.html +++ b/src/LiveDevelopment/Inspector/inspector.html @@ -1,5 +1,4 @@ - Inspector 1.0 Documentation @@ -25,10 +24,10 @@ $(_domain).show(); speed = 0; } else { -speed = 'fast'; +speed = "fast"; } -$('html, body').animate({ -scrollTop: symbol.offset().top - 70 + 'px' +$("html, body").animate({ +scrollTop: symbol.offset().top - 70 + "px" }, speed); if (domainAndName.length > 1) symbol.effect("highlight", { color: "#ffc"}, 1000); }); @@ -55,557 +54,624 @@ -
-
+
+

Table of Contents

ApplicationCache

-Type +Type -Command +Command -Event +Event

CSS

-Type +Type -Command +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.startSelectorProfiler
  • -
  • CSS.stopSelectorProfiler
  • +
  • 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.
  • +
  • CSS.getFlowByName: Returns the Named Flow identified by the given name
-Event +Event
    -
  • CSS.mediaQueryResultChanged: Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features.
  • -
  • CSS.styleSheetChanged: Fired whenever a stylesheet is changed as a result of the client operation.
  • +
  • CSS.mediaQueryResultChanged: Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features.
  • +
  • CSS.styleSheetChanged: Fired whenever a stylesheet is changed as a result of the client operation.
  • +
  • CSS.namedFlowCreated: Fires when a Named Flow is created.
  • +
  • CSS.namedFlowRemoved: Fires when a Named Flow is removed: has no associated content nodes and regions.

Console

-Type +Type -Command +Command -Event +Event

DOM

-Type +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.
  • +
  • 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 +Command -Event +Event

DOMDebugger

-Type +Type -Command +Command

DOMStorage

-Type +Type -Command +Command -Event +Event

Database

-Type +Type -Command +Command -Event +Event

Debugger

-Type +Type -Command +Command -Event +Event

FileSystem

-Command +Type + +Command + +Event

IndexedDB

-Type +Type -Command +Command -Event +Event

Inspector

-Command +Command -Event +Event

Memory

-Type +Type -Command +Command

Network

-Type +Type -Command +Command -Event +Event

Page

-Type +Type -Command +Command -Event +Event

Profiler

-Type +Type -Command +Command -Event +Event

Runtime

-Type +Type + +Command -Command +Event

Timeline

-Type +Type + +Command -Command +Event -Event +

WebGL

+Command

Worker

-Command +Command -Event +Event
-
+

ApplicationCache

-Type +Type -Command +Command -Event +Event -
-

ApplicationCache.ApplicationCacheResource Type

+
+

ApplicationCache.ApplicationCacheResource Type

Detailed application cache resource information.

url
-
String Resource url.
+
String Resource url.
size
-
Integer Resource size.
+
Integer Resource size.
type
-
String Resource type.
+
String Resource type.
-
-

ApplicationCache.ApplicationCache Type

+
+

ApplicationCache.ApplicationCache Type

Detailed application cache information.

manifestURL
-
String Manifest URL.
+
String Manifest URL.
size
-
Number Application cache size.
+
Number Application cache size.
creationTime
-
Number Application cache creation time.
+
Number Application cache creation time.
updateTime
-
Number Application cache update time.
+
Number Application cache update time.
resources
-
[ApplicationCache.ApplicationCacheResource] Application cache resources.
+
[ApplicationCache.ApplicationCacheResource] Application cache resources.
-
-

ApplicationCache.FrameWithManifest Type

+
+

ApplicationCache.FrameWithManifest Type

Frame identifier - manifest URL pair.

frameId
-
Network.FrameId Frame identifier.
+
Network.FrameId Frame identifier.
manifestURL
-
String Manifest URL.
+
String Manifest URL.
status
-
Integer Application cache status.
+
Integer Application cache status.
-
-

ApplicationCache.getFramesWithManifests Command

+
+

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.
+
[ApplicationCache.FrameWithManifest] Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache.

Code Example:

@@ -615,8 +681,8 @@ 

Code Example:

});
-
-

ApplicationCache.enable Command

+
+

ApplicationCache.enable Command

Enables application cache domain notifications.

Code Example:

@@ -624,17 +690,17 @@ 

Code Example:

ApplicationCache.enable();
-
-

ApplicationCache.getManifestForFrame Command

+
+

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.
+
Network.FrameId Identifier of the frame containing document whose manifest is retrieved.

Callback Parameters:

manifestURL
-
String Manifest URL for document in the given frame.
+
String Manifest URL for document in the given frame.

Code Example:

@@ -644,17 +710,17 @@ 

Code Example:

});
-
-

ApplicationCache.getApplicationCacheForFrame Command

+
+

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.
+
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.
+
ApplicationCache.ApplicationCache Relevant application cache data for the document in given frame.

Code Example:

@@ -664,15 +730,15 @@ 

Code Example:

});
-
-

ApplicationCache.applicationCacheStatusUpdated Event

+
+

ApplicationCache.applicationCacheStatusUpdated Event

frameId
-
Network.FrameId Identifier of the frame containing document whose application cache updated status.
+
Network.FrameId Identifier of the frame containing document whose application cache updated status.
manifestURL
-
String Manifest URL.
+
String Manifest URL.
status
-
Integer Updated application cache status.
+
Integer Updated application cache status.

Code Example:

@@ -682,8 +748,8 @@ 

Code Example:

}
-
-

ApplicationCache.networkStateUpdated Event

+
+

ApplicationCache.networkStateUpdated Event

isNowOnline
Boolean
@@ -697,266 +763,319 @@

Code Example:

-
+

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 +Type -Command +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.startSelectorProfiler
  • -
  • CSS.stopSelectorProfiler
  • +
  • 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.
  • +
  • CSS.getFlowByName: Returns the Named Flow identified by the given name
-Event +Event
    -
  • CSS.mediaQueryResultChanged: Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features.
  • -
  • CSS.styleSheetChanged: Fired whenever a stylesheet is changed as a result of the client operation.
  • +
  • CSS.mediaQueryResultChanged: Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features.
  • +
  • CSS.styleSheetChanged: Fired whenever a stylesheet is changed as a result of the client operation.
  • +
  • CSS.namedFlowCreated: Fires when a Named Flow is created.
  • +
  • CSS.namedFlowRemoved: Fires when a Named Flow is removed: has no associated content nodes and regions.
-
-

CSS.StyleSheetId Type

+
+

CSS.StyleSheetId Type

String
-
-

CSS.CSSStyleId Type

+
+

CSS.CSSStyleId Type

This object identifies a CSS style in a unique way.

styleSheetId
-
CSS.StyleSheetId Enclosing stylesheet identifier.
+
CSS.StyleSheetId Enclosing stylesheet identifier.
ordinal
-
Integer The style ordinal within the stylesheet.
+
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

+
+

CSS.CSSRuleId Type

This object identifies a CSS rule in a unique way.

styleSheetId
-
CSS.StyleSheetId Enclosing stylesheet identifier.
+
CSS.StyleSheetId Enclosing stylesheet identifier.
ordinal
-
Integer The rule ordinal within the stylesheet.
+
Integer The rule ordinal within the stylesheet.
-
-

CSS.PseudoIdRules Type

+
+

CSS.PseudoIdRules Type

CSS rule collection for a single pseudo style.

pseudoId
-
Integer Pseudo style identifier (see enum PseudoId in RenderStyleConstants.h).
+
Integer Pseudo style identifier (see enum PseudoId in RenderStyleConstants.h).
rules
-
[CSS.CSSRule] CSS rules applicable to the pseudo style.
+
[CSS.CSSRule] CSS rules applicable to the pseudo style.
-
-

CSS.InheritedStyleEntry Type

+
+

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.
+
CSS.CSSStyle The ancestor node's inline style, if any, in the style inheritance chain.
matchedCSSRules
-
[CSS.CSSRule] CSS rules matching the ancestor node in the style inheritance chain.
+
[CSS.CSSRule] CSS rules matching the ancestor node in the style inheritance chain.
-
-

CSS.CSSStyleAttribute Type

+
+

CSS.CSSStyleAttribute Type

CSS style information for a DOM style attribute.

name
-
String DOM attribute name (e.g. "width").
+
String DOM attribute name (e.g. "width").
style
-
CSS.CSSStyle CSS style generated by the respective DOM attribute.
+
CSS.CSSStyle CSS style generated by the respective DOM attribute.
-
-

CSS.CSSStyleSheetHeader Type

+
+

CSS.CSSStyleSheetHeader Type

CSS stylesheet metainformation.

styleSheetId
-
CSS.StyleSheetId The stylesheet identifier.
+
CSS.StyleSheetId The stylesheet identifier.
+
frameId
+
Network.FrameId Owner frame identifier.
sourceURL
-
String Stylesheet resource URL.
+
String Stylesheet resource URL.
+
origin
+
CSS.StyleSheetOrigin Stylesheet origin.
title
-
String Stylesheet title.
+
String Stylesheet title.
disabled
-
Boolean Denotes whether the stylesheet is disabled.
+
Boolean Denotes whether the stylesheet is disabled.
-
-

CSS.CSSStyleSheetBody Type

+
+

CSS.CSSStyleSheetBody Type

CSS stylesheet contents.

styleSheetId
-
CSS.StyleSheetId The stylesheet identifier.
+
CSS.StyleSheetId The stylesheet identifier.
rules
-
[CSS.CSSRule] Stylesheet resource URL.
+
[CSS.CSSRule] Stylesheet resource URL.
text (optional)
-
String Stylesheet resource contents (if available).
+
String Stylesheet resource contents (if available).
-
-

CSS.CSSRule Type

+
+

CSS.CSSRule Type

CSS rule representation.

ruleId (optional)
-
CSS.CSSRuleId The CSS rule identifier (absent for user agent stylesheet and user-specified stylesheet rules).
+
CSS.CSSRuleId The CSS rule identifier (absent for user agent stylesheet and user-specified stylesheet rules).
selectorText
-
String Rule selector.
+
String Rule selector.
sourceURL (optional)
-
String Parent stylesheet resource URL (for regular rules).
+
String Parent stylesheet resource URL (for regular rules).
sourceLine
-
Integer Line ordinal of the rule selector start character in the resource.
+
Integer Line ordinal of the rule selector start character in the resource.
origin
-
( user | user-agent | inspector | regular ) The parent stylesheet type: "user" for user stylesheets, "user-agent" for user-agent stylesheets, "inspector" for stylesheets created by the inspector (i.e. those holding new rules created with addRule()), "regular" for regular stylesheets.
+
CSS.StyleSheetOrigin Parent stylesheet's origin.
style
-
CSS.CSSStyle Associated style declaration.
+
CSS.CSSStyle Associated style declaration.
selectorRange (optional)
-
CSS.SourceRange The rule selector range in the underlying resource (if available).
+
CSS.SourceRange The rule selector range in the underlying resource (if available).
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.CSSMedia] Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards.
-
-

CSS.SourceRange Type

+
+

CSS.SourceRange Type

Text range within a resource.

start
-
Integer Start of range (inclusive).
+
Integer Start of range (inclusive).
end
-
Integer End of range (exclusive).
+
Integer End of range (exclusive).
-
-

CSS.ShorthandEntry Type

+
+

CSS.ShorthandEntry Type

-
-

CSS.CSSComputedStyleProperty Type

+
+

CSS.CSSPropertyInfo Type

name
-
String Computed style property 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.
+
String Computed style property value.
-
-

CSS.CSSStyle Type

+
+

CSS.CSSStyle Type

CSS style representation.

styleId (optional)
-
CSS.CSSStyleId The CSS style identifier (absent for attribute styles).
+
CSS.CSSStyleId The CSS style identifier (absent for attribute styles).
cssProperties
-
[CSS.CSSProperty] CSS properties in the style.
+
[CSS.CSSProperty] CSS properties in the style.
shorthandEntries
-
[CSS.ShorthandEntry] Computed values for all shorthands found in the style.
+
[CSS.ShorthandEntry] Computed values for all shorthands found in the style.
cssText (optional)
-
String Style declaration text (if available).
+
String Style declaration text (if available).
range (optional)
-
CSS.SourceRange Style declaration range in the enclosing stylesheet (if available).
+
CSS.SourceRange Style declaration range in the enclosing stylesheet (if available).
width (optional)
-
String The effective "width" property value from this style.
+
String The effective "width" property value from this style.
height (optional)
-
String The effective "height" property value from this style.
+
String The effective "height" property value from this style.
-
-

CSS.CSSProperty Type

+
+

CSS.CSSProperty Type

CSS style effective visual dimensions and source offsets.

name
-
String The property name.
+
String The property name.
value
-
String The property value.
+
String The property value.
priority (optional)
-
String The property priority (implies "" if absent).
+
String The property priority (implies "" if absent).
implicit (optional)
-
Boolean Whether the property is implicit (implies false if absent).
+
Boolean Whether the property is implicit (implies false if absent).
text (optional)
-
String The full property text as specified in the style.
+
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).
+
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.
-
shorthandName (optional)
-
String The related shorthand property name (absent if this property is not a longhand).
+
( 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.SourceRange The entire property range in the enclosing style declaration (if available).
-
-

CSS.CSSMedia Type

+
+

CSS.CSSMedia Type

CSS media query descriptor.

text
-
String Media query text.
+
String Media query text.
source
-
( mediaRule | importRule | linkedSheet | inlineSheet ) Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline stylesheet's STYLE tag.
+
( mediaRule | importRule | linkedSheet | inlineSheet ) Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline stylesheet's STYLE tag.
sourceURL (optional)
-
String URL of the document containing the media query description.
+
String URL of the document containing the media query description.
sourceLine (optional)
-
Integer Line in the document containing the media query (not defined for the "stylesheet" source).
+
Integer Line in the document containing the media query (not defined for the "stylesheet" source).
-
-

CSS.SelectorProfileEntry Type

+
+

CSS.SelectorProfileEntry Type

CSS selector profile entry.

selector
-
String CSS selector of the corresponding rule.
+
String CSS selector of the corresponding rule.
url
-
String URL of the resource containing the corresponding rule.
+
String URL of the resource containing the corresponding rule.
lineNumber
-
Integer Selector line number in the resource for the corresponding rule.
+
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.)
+
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.
+
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.
+
Integer Number of times this rule actually matched a DOM element.
-
-

CSS.SelectorProfile Type

+
+

CSS.SelectorProfile Type

totalTime
-
Number Total processing time for all selectors in the profile (in milliseconds.)
+
Number Total processing time for all selectors in the profile (in milliseconds.)
data
-
[CSS.SelectorProfileEntry] CSS selector profile entries.
+
[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.enable Command

+
+

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:

@@ -964,8 +1083,8 @@ 

Code Example:

CSS.enable();
-
-

CSS.disable Command

+
+

CSS.disable Command

Disables the CSS agent for the given page.

Code Example:

@@ -973,49 +1092,47 @@ 

Code Example:

CSS.disable();
-
-

CSS.getMatchedStylesForNode Command

+
+

CSS.getMatchedStylesForNode Command

Returns requested styles for a DOM node identified by nodeId.

nodeId
-
DOM.NodeId
-
forcedPseudoClasses (optional)
-
[( active | focus | hover | visited )] Element pseudo classes to force when computing applicable style rules.
+
DOM.NodeId
includePseudo (optional)
-
Boolean Whether to include pseudo styles (default: true).
+
Boolean Whether to include pseudo styles (default: true).
includeInherited (optional)
-
Boolean Whether to include inherited styles (default: true).
+
Boolean Whether to include inherited styles (default: true).

Callback Parameters:

matchedCSSRules (optional)
-
[CSS.CSSRule] CSS rules matching this node, from all applicable stylesheets.
+
[CSS.CSSRule] CSS rules matching this node, from all applicable stylesheets.
pseudoElements (optional)
-
[CSS.PseudoIdRules] Pseudo style rules for this node.
+
[CSS.PseudoIdRules] Pseudo style rules for this node.
inherited (optional)
-
[CSS.InheritedStyleEntry] A chain of inherited styles (from the immediate node parent up to the DOM tree root).
+
[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, forcedPseudoClasses, includePseudo, includeInherited, function callback(res) {
+CSS.getMatchedStylesForNode(nodeId, includePseudo, includeInherited, function callback(res) {
 	// res = {matchedCSSRules, pseudoElements, inherited}
 });
 
-
-

CSS.getInlineStylesForNode Command

+
+

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
+
DOM.NodeId

Callback Parameters:

inlineStyle (optional)
-
CSS.CSSStyle Inline style for the specified DOM node.
+
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%").
+
CSS.CSSStyle Attribute-defined element style (e.g. resulting from "width=20 height=100%").

Code Example:

@@ -1025,35 +1142,33 @@ 

Code Example:

});
-
-

CSS.getComputedStyleForNode Command

+
+

CSS.getComputedStyleForNode Command

Returns the computed style for a DOM node identified by nodeId.

nodeId
-
DOM.NodeId
-
forcedPseudoClasses (optional)
-
[( active | focus | hover | visited )] Element pseudo classes to force when computing applicable style rules.
+
DOM.NodeId

Callback Parameters:

computedStyle
-
[CSS.CSSComputedStyleProperty] Computed style for the specified DOM node.
+
[CSS.CSSComputedStyleProperty] Computed style for the specified DOM node.

Code Example:

 // WebInspector Command: CSS.getComputedStyleForNode
-CSS.getComputedStyleForNode(nodeId, forcedPseudoClasses, function callback(res) {
+CSS.getComputedStyleForNode(nodeId, function callback(res) {
 	// res = {computedStyle}
 });
 
-
-

CSS.getAllStyleSheets Command

+
+

CSS.getAllStyleSheets Command

Returns metainfo entries for all known stylesheets.

Callback Parameters:

headers
-
[CSS.CSSStyleSheetHeader] Descriptor entries for all available stylesheets.
+
[CSS.CSSStyleSheetHeader] Descriptor entries for all available stylesheets.

Code Example:

@@ -1063,17 +1178,17 @@ 

Code Example:

});
-
-

CSS.getStyleSheet Command

+
+

CSS.getStyleSheet Command

Returns stylesheet data for the specified styleSheetId.

styleSheetId
-
CSS.StyleSheetId
+
CSS.StyleSheetId

Callback Parameters:

styleSheet
-
CSS.CSSStyleSheetBody Stylesheet contents for the specified styleSheetId.
+
CSS.CSSStyleSheetBody Stylesheet contents for the specified styleSheetId.

Code Example:

@@ -1083,17 +1198,17 @@ 

Code Example:

});
-
-

CSS.getStyleSheetText Command

+
+

CSS.getStyleSheetText Command

Returns the current textual content and the URL for a stylesheet.

styleSheetId
-
CSS.StyleSheetId
+
CSS.StyleSheetId

Callback Parameters:

text
-
String The stylesheet text.
+
String The stylesheet text.

Code Example:

@@ -1103,12 +1218,12 @@ 

Code Example:

});
-
-

CSS.setStyleSheetText Command

+
+

CSS.setStyleSheetText Command

Sets the new stylesheet text, thereby invalidating all existing CSSStyleId's and CSSRuleId's contained by this stylesheet.

styleSheetId
-
CSS.StyleSheetId
+
CSS.StyleSheetId
text
String
@@ -1118,12 +1233,12 @@

Code Example:

CSS.setStyleSheetText(styleSheetId, text);
-
-

CSS.setPropertyText Command

+
+

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
+
CSS.CSSStyleId
propertyIndex
Integer
text
@@ -1134,7 +1249,7 @@

CSS.setPropertyText Command

Callback Parameters:

style
-
CSS.CSSStyle The resulting style after the property text modification.
+
CSS.CSSStyle The resulting style after the property text modification.

Code Example:

@@ -1144,12 +1259,12 @@ 

Code Example:

});
-
-

CSS.toggleProperty Command

+
+

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
+
CSS.CSSStyleId
propertyIndex
Integer
disable
@@ -1158,7 +1273,7 @@

CSS.toggleProperty Command

Callback Parameters:

style
-
CSS.CSSStyle The resulting style after the property toggling.
+
CSS.CSSStyle The resulting style after the property toggling.

Code Example:

@@ -1168,19 +1283,19 @@ 

Code Example:

});
-
-

CSS.setRuleSelector Command

+
+

CSS.setRuleSelector Command

Modifies the rule selector.

ruleId
-
CSS.CSSRuleId
+
CSS.CSSRuleId
selector
String

Callback Parameters:

rule
-
CSS.CSSRule The resulting rule after the selector modification.
+
CSS.CSSRule The resulting rule after the selector modification.

Code Example:

@@ -1190,19 +1305,19 @@ 

Code Example:

});
-
-

CSS.addRule Command

+
+

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
+
DOM.NodeId
selector
String

Callback Parameters:

rule
-
CSS.CSSRule The newly created rule.
+
CSS.CSSRule The newly created rule.

Code Example:

@@ -1212,13 +1327,13 @@ 

Code Example:

});
-
-

CSS.getSupportedCSSProperties Command

+
+

CSS.getSupportedCSSProperties Command

Returns all supported CSS property names.

Callback Parameters:

cssProperties
-
[String] Supported property names.
+
[CSS.CSSPropertyInfo] Supported property metainfo.

Code Example:

@@ -1228,20 +1343,35 @@ 

Code Example:

});
-
-

CSS.startSelectorProfiler Command

+
+

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

+
+

CSS.stopSelectorProfiler Command

Callback Parameters:

profile
-
CSS.SelectorProfile
+
CSS.SelectorProfile

Code Example:

@@ -1251,8 +1381,50 @@ 

Code Example:

});
-
-

CSS.mediaQueryResultChanged Event

+
+

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.getFlowByName Command

+

Returns the Named Flow identified by the given name

+
+
documentNodeId
+
DOM.NodeId The document node id.
+
name
+
String Named Flow identifier.
+
+

Callback Parameters:

+
+
namedFlow
+
CSS.NamedFlow A Named Flow.
+
+

Code Example:

+
+// WebInspector Command: CSS.getFlowByName
+CSS.getFlowByName(documentNodeId, name, function callback(res) {
+	// res = {namedFlow}
+});
+
+
+
+

CSS.mediaQueryResultChanged Event

Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features.

Code Example:

@@ -1262,12 +1434,12 @@ 

Code Example:

}
-
-

CSS.styleSheetChanged Event

+
+

CSS.styleSheetChanged Event

Fired whenever a stylesheet is changed as a result of the client operation.

styleSheetId
-
CSS.StyleSheetId
+
CSS.StyleSheetId

Code Example:

@@ -1277,80 +1449,114 @@ 

Code Example:

}
+
+

CSS.namedFlowCreated Event

+

Fires when a Named Flow is created.

+
+
documentNodeId
+
DOM.NodeId The document node id.
+
namedFlow
+
String Identifier of the new Named Flow.
+
+

Code Example:

+
+// WebInspector Event: CSS.namedFlowCreated
+function onNamedFlowCreated(res) {
+	// res = {documentNodeId, 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.
+
namedFlow
+
String Identifier of the removed Named Flow.
+
+

Code Example:

+
+// WebInspector Event: CSS.namedFlowRemoved
+function onNamedFlowRemoved(res) {
+	// res = {documentNodeId, 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 +Type -Command +Command -Event +Event -
-

Console.ConsoleMessage Type

+
+

Console.ConsoleMessage Type

Console message.

source
-
( html | wml | xml | javascript | network | console-api | other ) Message source.
+
( html | wml | xml | javascript | network | console-api | other ) Message source.
level
-
( tip | log | warning | error | debug ) Message severity.
+
( tip | log | warning | error | debug ) Message severity.
text
-
String Message text.
+
String Message text.
type (optional)
-
( log | dir | dirxml | trace | startGroup | startGroupCollapsed | endGroup | assert ) Console message type.
+
( log | dir | dirxml | trace | startGroup | startGroupCollapsed | endGroup | assert ) Console message type.
url (optional)
-
String URL of the message origin.
+
String URL of the message origin.
line (optional)
-
Integer Line number in the resource that generated this message.
+
Integer Line number in the resource that generated this message.
repeatCount (optional)
-
Integer Repeat count for repeated messages.
+
Integer Repeat count for repeated messages.
parameters (optional)
-
[Runtime.RemoteObject] Message parameters in case of the formatted message.
+
[Runtime.RemoteObject] Message parameters in case of the formatted message.
stackTrace (optional)
-
Console.StackTrace JavaScript stack trace for assertions and error messages.
+
Console.StackTrace JavaScript stack trace for assertions and error messages.
networkRequestId (optional)
-
Network.RequestId Identifier of the network request associated with this message.
+
Network.RequestId Identifier of the network request associated with this message.
-
-

Console.CallFrame Type

+
+

Console.CallFrame Type

Stack entry for console errors and assertions.

functionName
-
String JavaScript function name.
+
String JavaScript function name.
url
-
String JavaScript script name or url.
+
String JavaScript script name or url.
lineNumber
-
Integer JavaScript script line number.
+
Integer JavaScript script line number.
columnNumber
-
Integer JavaScript script column number.
+
Integer JavaScript script column number.
-
-

Console.StackTrace Type

+
+

Console.StackTrace Type

Call frames for assertions or error messages.

-
[Console.CallFrame]
+
[Console.CallFrame]
-
-

Console.enable Command

+
+

Console.enable Command

Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification.

Code Example:

@@ -1358,8 +1564,8 @@ 

Code Example:

Console.enable();
-
-

Console.disable Command

+
+

Console.disable Command

Disables console domain, prevents further console messages from being reported to the client.

Code Example:

@@ -1367,8 +1573,8 @@ 

Code Example:

Console.disable();
-
-

Console.clearMessages Command

+
+

Console.clearMessages Command

Clears console messages collected in the browser.

Code Example:

@@ -1376,12 +1582,12 @@ 

Code Example:

Console.clearMessages();
-
-

Console.setMonitoringXHREnabled Command

+
+

Console.setMonitoringXHREnabled Command

Toggles monitoring of XMLHttpRequest. If true, console will receive messages upon each XHR issued.

enabled
-
Boolean Monitoring enabled state.
+
Boolean Monitoring enabled state.

Code Example:

@@ -1389,12 +1595,12 @@ 

Code Example:

Console.setMonitoringXHREnabled(enabled);
-
-

Console.addInspectedNode Command

+
+

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.
+
DOM.NodeId DOM node id to be accessible by means of $x command line API.

Code Example:

@@ -1402,8 +1608,8 @@ 

Code Example:

Console.addInspectedNode(nodeId);
-
-

Console.addInspectedHeapObject Command

+
+

Console.addInspectedHeapObject Command

heapObjectId
Integer
@@ -1414,12 +1620,12 @@

Code Example:

Console.addInspectedHeapObject(heapObjectId);
-
-

Console.messageAdded Event

+
+

Console.messageAdded Event

Issued when new console message is added.

message
-
Console.ConsoleMessage Console message that has been added.
+
Console.ConsoleMessage Console message that has been added.

Code Example:

@@ -1429,12 +1635,12 @@ 

Code Example:

}
-
-

Console.messageRepeatCountUpdated Event

+
+

Console.messageRepeatCountUpdated Event

Issued when subsequent message(s) are equal to the previous one(s).

count
-
Integer New repeat count value.
+
Integer New repeat count value.

Code Example:

@@ -1444,8 +1650,8 @@ 

Code Example:

}
-
-

Console.messagesCleared Event

+
+

Console.messagesCleared Event

Issued when console is cleared. This happens either upon clearMessages command or after page navigation.

Code Example:

@@ -1456,166 +1662,165 @@ 

Code Example:

-
+

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 +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.
  • +
  • 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 +Command -Event +Event -
-

DOM.NodeId Type

+
+

DOM.NodeId Type

Unique DOM node identifier.

Integer
-
-

DOM.Node Type

+
+

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.
+
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.
+
Integer Node's nodeType.
nodeName
-
String Node's nodeName.
+
String Node's nodeName.
localName
-
String Node's localName.
+
String Node's localName.
nodeValue
-
String Node's nodeValue.
+
String Node's nodeValue.
childNodeCount (optional)
-
Integer Child count for Container nodes.
+
Integer Child count for Container nodes.
children (optional)
-
[DOM.Node] Child nodes of this node when requested with children.
+
[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].
+
[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.
+
String Document URL that Document or FrameOwner node points to.
publicId (optional)
-
String DocumentType's publicId.
+
String DocumentType's publicId.
systemId (optional)
-
String DocumentType's systemId.
+
String DocumentType's systemId.
internalSubset (optional)
-
String DocumentType's internalSubset.
+
String DocumentType's internalSubset.
xmlVersion (optional)
-
String Document's XML version in case of XML documents.
+
String Document's XML version in case of XML documents.
name (optional)
-
String Attr's name.
+
String Attr's name.
value (optional)
-
String Attr's value.
+
String Attr's value.
contentDocument (optional)
-
DOM.Node Content document for frame owner elements.
+
DOM.Node Content document for frame owner elements.
shadowRoots (optional)
-
[DOM.Node] Shadow root list for given element host.
+
[DOM.Node] Shadow root list for given element host.
-
-

DOM.EventListener Type

+
+

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.
+
String EventListener's type.
useCapture
-
Boolean EventListener's useCapture.
+
Boolean EventListener's useCapture.
isAttribute
-
Boolean EventListener's isAttribute.
+
Boolean EventListener's isAttribute.
nodeId
-
DOM.NodeId Target DOMNode id.
+
DOM.NodeId Target DOMNode id.
handlerBody
-
String Event handler function body.
+
String Event handler function body.
location (optional)
-
Debugger.Location Handler code location.
+
Debugger.Location Handler code location.
-
-

DOM.RGBA Type

+
+

DOM.RGBA Type

A structure holding an RGBA color.

r
-
Integer The red component, in the [0-255] range.
+
Integer The red component, in the [0-255] range.
g
-
Integer The green component, in the [0-255] range.
+
Integer The green component, in the [0-255] range.
b
-
Integer The blue component, in the [0-255] range.
+
Integer The blue component, in the [0-255] range.
a (optional)
-
Number The alpha component, in the [0-1] range (default: 1).
+
Number The alpha component, in the [0-1] range (default: 1).
-
-

DOM.HighlightConfig Type

+
+

DOM.HighlightConfig Type

Configuration data for the highlighting of page elements.

showInfo (optional)
-
Boolean Whether the node info tooltip should be shown (default: false).
+
Boolean Whether the node info tooltip should be shown (default: false).
contentColor (optional)
-
DOM.RGBA The content box highlight fill color (default: transparent).
+
DOM.RGBA The content box highlight fill color (default: transparent).
paddingColor (optional)
-
DOM.RGBA The padding highlight fill color (default: transparent).
+
DOM.RGBA The padding highlight fill color (default: transparent).
borderColor (optional)
-
DOM.RGBA The border highlight fill color (default: transparent).
+
DOM.RGBA The border highlight fill color (default: transparent).
marginColor (optional)
-
DOM.RGBA The margin highlight fill color (default: transparent).
+
DOM.RGBA The margin highlight fill color (default: transparent).
-
-

DOM.getDocument Command

+
+

DOM.getDocument Command

Returns the root DOM node to the caller.

Callback Parameters:

root
-
DOM.Node Resulting node.
+
DOM.Node Resulting node.

Code Example:

@@ -1625,12 +1830,12 @@ 

Code Example:

});
-
-

DOM.requestChildNodes Command

+
+

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.
+
DOM.NodeId Id of the node to get children for.

Code Example:

@@ -1638,19 +1843,19 @@ 

Code Example:

DOM.requestChildNodes(nodeId);
-
-

DOM.querySelector Command

+
+

DOM.querySelector Command

Executes querySelector on a given node.

nodeId
-
DOM.NodeId Id of the node to query upon.
+
DOM.NodeId Id of the node to query upon.
selector
-
String Selector string.
+
String Selector string.

Callback Parameters:

nodeId
-
DOM.NodeId Query selector result.
+
DOM.NodeId Query selector result.

Code Example:

@@ -1660,19 +1865,19 @@ 

Code Example:

});
-
-

DOM.querySelectorAll Command

+
+

DOM.querySelectorAll Command

Executes querySelectorAll on a given node.

nodeId
-
DOM.NodeId Id of the node to query upon.
+
DOM.NodeId Id of the node to query upon.
selector
-
String Selector string.
+
String Selector string.

Callback Parameters:

nodeIds
-
[DOM.NodeId] Query selector result.
+
[DOM.NodeId] Query selector result.

Code Example:

@@ -1682,19 +1887,19 @@ 

Code Example:

});
-
-

DOM.setNodeName Command

+
+

DOM.setNodeName Command

Sets node name for a node with given id.

nodeId
-
DOM.NodeId Id of the node to set name for.
+
DOM.NodeId Id of the node to set name for.
name
-
String New node's name.
+
String New node's name.

Callback Parameters:

nodeId
-
DOM.NodeId New node's id.
+
DOM.NodeId New node's id.

Code Example:

@@ -1704,14 +1909,14 @@ 

Code Example:

});
-
-

DOM.setNodeValue Command

+
+

DOM.setNodeValue Command

Sets node value for a node with given id.

nodeId
-
DOM.NodeId Id of the node to set value for.
+
DOM.NodeId Id of the node to set value for.
value
-
String New node's value.
+
String New node's value.

Code Example:

@@ -1719,12 +1924,12 @@ 

Code Example:

DOM.setNodeValue(nodeId, value);
-
-

DOM.removeNode Command

+
+

DOM.removeNode Command

Removes node with given id.

nodeId
-
DOM.NodeId Id of the node to remove.
+
DOM.NodeId Id of the node to remove.

Code Example:

@@ -1732,16 +1937,16 @@ 

Code Example:

DOM.removeNode(nodeId);
-
-

DOM.setAttributeValue Command

+
+

DOM.setAttributeValue Command

Sets attribute for an element with given id.

nodeId
-
DOM.NodeId Id of the element to set attribute for.
+
DOM.NodeId Id of the element to set attribute for.
name
-
String Attribute name.
+
String Attribute name.
value
-
String Attribute value.
+
String Attribute value.

Code Example:

@@ -1749,16 +1954,16 @@ 

Code Example:

DOM.setAttributeValue(nodeId, name, value);
-
-

DOM.setAttributesAsText Command

+
+

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.
+
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.
+
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.
+
String Attribute name to replace with new attributes derived from text in case text parsed successfully.

Code Example:

@@ -1766,14 +1971,14 @@ 

Code Example:

DOM.setAttributesAsText(nodeId, text, name);
-
-

DOM.removeAttribute Command

+
+

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.
+
DOM.NodeId Id of the element to remove attribute from.
name
-
String Name of the attribute to remove.
+
String Name of the attribute to remove.

Code Example:

@@ -1781,17 +1986,17 @@ 

Code Example:

DOM.removeAttribute(nodeId, name);
-
-

DOM.getEventListenersForNode Command

+
+

DOM.getEventListenersForNode Command

Returns event listeners relevant to the node.

nodeId
-
DOM.NodeId Id of the node to get listeners for.
+
DOM.NodeId Id of the node to get listeners for.

Callback Parameters:

listeners
-
[DOM.EventListener] Array of relevant listeners.
+
[DOM.EventListener] Array of relevant listeners.

Code Example:

@@ -1801,17 +2006,17 @@ 

Code Example:

});
-
-

DOM.getOuterHTML Command

+
+

DOM.getOuterHTML Command

Returns node's HTML markup.

nodeId
-
DOM.NodeId Id of the node to get markup for.
+
DOM.NodeId Id of the node to get markup for.

Callback Parameters:

outerHTML
-
String Outer HTML markup.
+
String Outer HTML markup.

Code Example:

@@ -1821,14 +2026,14 @@ 

Code Example:

});
-
-

DOM.setOuterHTML Command

+
+

DOM.setOuterHTML Command

Sets node HTML markup, returns new node id.

nodeId
-
DOM.NodeId Id of the node to set markup for.
+
DOM.NodeId Id of the node to set markup for.
outerHTML
-
String Outer HTML markup to set.
+
String Outer HTML markup to set.

Code Example:

@@ -1836,19 +2041,19 @@ 

Code Example:

DOM.setOuterHTML(nodeId, outerHTML);
-
-

DOM.performSearch Command

+
+

DOM.performSearch Command

Searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.

query
-
String Plain text or query selector or XPath search query.
+
String Plain text or query selector or XPath search query.

Callback Parameters:

searchId
-
String Unique search session identifier.
+
String Unique search session identifier.
resultCount
-
Integer Number of search results.
+
Integer Number of search results.

Code Example:

@@ -1858,21 +2063,21 @@ 

Code Example:

});
-
-

DOM.getSearchResults Command

+
+

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.
+
String Unique search session identifier.
fromIndex
-
Integer Start index of the search result to be returned.
+
Integer Start index of the search result to be returned.
toIndex
-
Integer End index of the search result to be returned.
+
Integer End index of the search result to be returned.

Callback Parameters:

nodeIds
-
[DOM.NodeId] Ids of the search result nodes.
+
[DOM.NodeId] Ids of the search result nodes.

Code Example:

@@ -1882,12 +2087,12 @@ 

Code Example:

});
-
-

DOM.discardSearchResults Command

+
+

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.
+
String Unique search session identifier.

Code Example:

@@ -1895,17 +2100,17 @@ 

Code Example:

DOM.discardSearchResults(searchId);
-
-

DOM.requestNode Command

+
+

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.
+
Runtime.RemoteObjectId JavaScript object id to convert into node.

Callback Parameters:

nodeId
-
DOM.NodeId Node id for given object.
+
DOM.NodeId Node id for given object.

Code Example:

@@ -1915,14 +2120,14 @@ 

Code Example:

});
-
-

DOM.setInspectModeEnabled Command

+
+

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.
+
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.
+
DOM.HighlightConfig A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false.

Code Example:

@@ -1930,22 +2135,22 @@ 

Code Example:

DOM.setInspectModeEnabled(enabled, highlightConfig);
-
-

DOM.highlightRect Command

+
+

DOM.highlightRect Command

Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.

x
-
Integer X coordinate
+
Integer X coordinate
y
-
Integer Y coordinate
+
Integer Y coordinate
width
-
Integer Rectangle width
+
Integer Rectangle width
height
-
Integer Rectangle height
+
Integer Rectangle height
color (optional)
-
DOM.RGBA The highlight fill color (default: transparent).
+
DOM.RGBA The highlight fill color (default: transparent).
outlineColor (optional)
-
DOM.RGBA The highlight outline color (default: transparent).
+
DOM.RGBA The highlight outline color (default: transparent).

Code Example:

@@ -1953,14 +2158,14 @@ 

Code Example:

DOM.highlightRect(x, y, width, height, color, outlineColor);
-
-

DOM.highlightNode Command

+
+

DOM.highlightNode Command

Highlights DOM node with given id.

nodeId
-
DOM.NodeId Identifier of the node to highlight.
+
DOM.NodeId Identifier of the node to highlight.
highlightConfig
-
DOM.HighlightConfig A descriptor for the highlight appearance.
+
DOM.HighlightConfig A descriptor for the highlight appearance.

Code Example:

@@ -1968,8 +2173,8 @@ 

Code Example:

DOM.highlightNode(nodeId, highlightConfig);
-
-

DOM.hideHighlight Command

+
+

DOM.hideHighlight Command

Hides DOM node highlight.

Code Example:

@@ -1977,16 +2182,16 @@ 

Code Example:

DOM.hideHighlight();
-
-

DOM.highlightFrame Command

+
+

DOM.highlightFrame Command

Highlights owner element of the frame with given id.

frameId
-
Network.FrameId Identifier of the frame to highlight.
+
Network.FrameId Identifier of the frame to highlight.
contentColor (optional)
-
DOM.RGBA The content box highlight fill color (default: transparent).
+
DOM.RGBA The content box highlight fill color (default: transparent).
contentOutlineColor (optional)
-
DOM.RGBA The content box highlight outline color (default: transparent).
+
DOM.RGBA The content box highlight outline color (default: transparent).

Code Example:

@@ -1994,17 +2199,17 @@ 

Code Example:

DOM.highlightFrame(frameId, contentColor, contentOutlineColor);
-
-

DOM.pushNodeByPathToFrontend Command

+
+

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.
+
String Path to node in the proprietary format.

Callback Parameters:

nodeId
-
DOM.NodeId Id of the node for given path.
+
DOM.NodeId Id of the node for given path.

Code Example:

@@ -2014,19 +2219,19 @@ 

Code Example:

});
-
-

DOM.resolveNode Command

+
+

DOM.resolveNode Command

Resolves JavaScript node object for given node id.

nodeId
-
DOM.NodeId Id of the node to resolve.
+
DOM.NodeId Id of the node to resolve.
objectGroup (optional)
-
String Symbolic group name that can be used to release multiple objects.
+
String Symbolic group name that can be used to release multiple objects.

Callback Parameters:

object
-
Runtime.RemoteObject JavaScript object wrapper for given node.
+
Runtime.RemoteObject JavaScript object wrapper for given node.

Code Example:

@@ -2036,17 +2241,17 @@ 

Code Example:

});
-
-

DOM.getAttributes Command

+
+

DOM.getAttributes Command

Returns attributes for the specified node.

nodeId
-
DOM.NodeId Id of the node to retrieve attibutes for.
+
DOM.NodeId Id of the node to retrieve attibutes for.

Callback Parameters:

attributes
-
[String] An interleaved array of node attribute names and values.
+
[String] An interleaved array of node attribute names and values.

Code Example:

@@ -2056,21 +2261,21 @@ 

Code Example:

});
-
-

DOM.moveTo Command

+
+

DOM.moveTo Command

Moves node into the new container, places it before the given anchor.

nodeId
-
DOM.NodeId Id of the node to drop.
+
DOM.NodeId Id of the node to drop.
targetNodeId
-
DOM.NodeId Id of the element to drop into.
+
DOM.NodeId Id of the element to drop into.
insertBeforeNodeId (optional)
-
DOM.NodeId Drop node before given one.
+
DOM.NodeId Drop node before given one.

Callback Parameters:

nodeId
-
DOM.NodeId New id of the moved node.
+
DOM.NodeId New id of the moved node.

Code Example:

@@ -2080,21 +2285,8 @@ 

Code Example:

});
-
-

DOM.setTouchEmulationEnabled Command

-

Toggles mouse event-based touch event emulation.

-
-
enabled
-
Boolean Whether the touch event emulation should be enabled.
-
-

Code Example:

-
-// WebInspector Command: DOM.setTouchEmulationEnabled
-DOM.setTouchEmulationEnabled(enabled);
-
-
-
-

DOM.undo Command

+
+

DOM.undo Command

Undoes the last performed action.

Code Example:

@@ -2102,8 +2294,8 @@ 

Code Example:

DOM.undo();
-
-

DOM.redo Command

+
+

DOM.redo Command

Re-does the last undone action.

Code Example:

@@ -2111,8 +2303,8 @@ 

Code Example:

DOM.redo();
-
-

DOM.markUndoableState Command

+
+

DOM.markUndoableState Command

Marks last undoable state.

Code Example:

@@ -2120,8 +2312,8 @@ 

Code Example:

DOM.markUndoableState();
-
-

DOM.documentUpdated Event

+
+

DOM.documentUpdated Event

Fired when Document has been totally updated. Node ids are no longer valid.

Code Example:

@@ -2131,14 +2323,14 @@ 

Code Example:

}
-
-

DOM.setChildNodes Event

+
+

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.
+
DOM.NodeId Parent node id to populate with children.
nodes
-
[DOM.Node] Child nodes array.
+
[DOM.Node] Child nodes array.

Code Example:

@@ -2148,16 +2340,16 @@ 

Code Example:

}
-
-

DOM.attributeModified Event

+
+

DOM.attributeModified Event

Fired when Element's attribute is modified.

nodeId
-
DOM.NodeId Id of the node that has changed.
+
DOM.NodeId Id of the node that has changed.
name
-
String Attribute name.
+
String Attribute name.
value
-
String Attribute value.
+
String Attribute value.

Code Example:

@@ -2167,14 +2359,14 @@ 

Code Example:

}
-
-

DOM.attributeRemoved Event

+
+

DOM.attributeRemoved Event

Fired when Element's attribute is removed.

nodeId
-
DOM.NodeId Id of the node that has changed.
+
DOM.NodeId Id of the node that has changed.
name
-
String A ttribute name.
+
String A ttribute name.

Code Example:

@@ -2184,12 +2376,12 @@ 

Code Example:

}
-
-

DOM.inlineStyleInvalidated Event

+
+

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.
+
[DOM.NodeId] Ids of the nodes for which the inline styles have been invalidated.

Code Example:

@@ -2199,14 +2391,14 @@ 

Code Example:

}
-
-

DOM.characterDataModified Event

+
+

DOM.characterDataModified Event

Mirrors DOMCharacterDataModified event.

nodeId
-
DOM.NodeId Id of the node that has changed.
+
DOM.NodeId Id of the node that has changed.
characterData
-
String New text value.
+
String New text value.

Code Example:

@@ -2216,14 +2408,14 @@ 

Code Example:

}
-
-

DOM.childNodeCountUpdated Event

+
+

DOM.childNodeCountUpdated Event

Fired when Container's child node count has changed.

nodeId
-
DOM.NodeId Id of the node that has changed.
+
DOM.NodeId Id of the node that has changed.
childNodeCount
-
Integer New node count.
+
Integer New node count.

Code Example:

@@ -2233,16 +2425,16 @@ 

Code Example:

}
-
-

DOM.childNodeInserted Event

+
+

DOM.childNodeInserted Event

Mirrors DOMNodeInserted event.

parentNodeId
-
DOM.NodeId Id of the node that has changed.
+
DOM.NodeId Id of the node that has changed.
previousNodeId
-
DOM.NodeId If of the previous siblint.
+
DOM.NodeId If of the previous siblint.
node
-
DOM.Node Inserted node data.
+
DOM.Node Inserted node data.

Code Example:

@@ -2252,14 +2444,14 @@ 

Code Example:

}
-
-

DOM.childNodeRemoved Event

+
+

DOM.childNodeRemoved Event

Mirrors DOMNodeRemoved event.

parentNodeId
-
DOM.NodeId Parent id.
+
DOM.NodeId Parent id.
nodeId
-
DOM.NodeId Id of the node that has been removed.
+
DOM.NodeId Id of the node that has been removed.

Code Example:

@@ -2269,14 +2461,14 @@ 

Code Example:

}
-
-

DOM.shadowRootPushed Event

+
+

DOM.shadowRootPushed Event

Called when shadow root is pushed into the element.

hostId
-
DOM.NodeId Host element id.
+
DOM.NodeId Host element id.
root
-
DOM.Node Shadow root.
+
DOM.Node Shadow root.

Code Example:

@@ -2286,14 +2478,14 @@ 

Code Example:

}
-
-

DOM.shadowRootPopped Event

+
+

DOM.shadowRootPopped Event

Called when shadow root is popped from the element.

hostId
-
DOM.NodeId Host element id.
+
DOM.NodeId Host element id.
rootId
-
DOM.NodeId Shadow root id.
+
DOM.NodeId Shadow root id.

Code Example:

@@ -2304,39 +2496,39 @@ 

Code Example:

-
+

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 +Type -Command +Command -
-

DOMDebugger.DOMBreakpointType Type

+
+

DOMDebugger.DOMBreakpointType Type

DOM breakpoint type.

( subtree-modified | attribute-modified | node-removed )
-
-

DOMDebugger.setDOMBreakpoint Command

+
+

DOMDebugger.setDOMBreakpoint Command

Sets breakpoint on particular operation with DOM.

nodeId
-
DOM.NodeId Identifier of the node to set breakpoint on.
+
DOM.NodeId Identifier of the node to set breakpoint on.
type
-
DOMDebugger.DOMBreakpointType Type of the operation to stop upon.
+
DOMDebugger.DOMBreakpointType Type of the operation to stop upon.

Code Example:

@@ -2344,14 +2536,14 @@ 

Code Example:

DOMDebugger.setDOMBreakpoint(nodeId, type);
-
-

DOMDebugger.removeDOMBreakpoint Command

+
+

DOMDebugger.removeDOMBreakpoint Command

Removes DOM breakpoint that was set using setDOMBreakpoint.

nodeId
-
DOM.NodeId Identifier of the node to remove breakpoint from.
+
DOM.NodeId Identifier of the node to remove breakpoint from.
type
-
DOMDebugger.DOMBreakpointType Type of the breakpoint to remove.
+
DOMDebugger.DOMBreakpointType Type of the breakpoint to remove.

Code Example:

@@ -2359,12 +2551,12 @@ 

Code Example:

DOMDebugger.removeDOMBreakpoint(nodeId, type);
-
-

DOMDebugger.setEventListenerBreakpoint Command

+
+

DOMDebugger.setEventListenerBreakpoint Command

Sets breakpoint on particular DOM event.

eventName
-
String DOM Event name to stop on (any DOM event will do).
+
String DOM Event name to stop on (any DOM event will do).

Code Example:

@@ -2372,12 +2564,12 @@ 

Code Example:

DOMDebugger.setEventListenerBreakpoint(eventName);
-
-

DOMDebugger.removeEventListenerBreakpoint Command

+
+

DOMDebugger.removeEventListenerBreakpoint Command

Removes breakpoint on particular DOM event.

eventName
-
String Event name.
+
String Event name.

Code Example:

@@ -2385,12 +2577,12 @@ 

Code Example:

DOMDebugger.removeEventListenerBreakpoint(eventName);
-
-

DOMDebugger.setInstrumentationBreakpoint Command

+
+

DOMDebugger.setInstrumentationBreakpoint Command

Sets breakpoint on particular native event.

eventName
-
String Instrumentation name to stop on.
+
String Instrumentation name to stop on.

Code Example:

@@ -2398,12 +2590,12 @@ 

Code Example:

DOMDebugger.setInstrumentationBreakpoint(eventName);
-
-

DOMDebugger.removeInstrumentationBreakpoint Command

+
+

DOMDebugger.removeInstrumentationBreakpoint Command

Sets breakpoint on particular native event.

eventName
-
String Instrumentation name to stop on.
+
String Instrumentation name to stop on.

Code Example:

@@ -2411,12 +2603,12 @@ 

Code Example:

DOMDebugger.removeInstrumentationBreakpoint(eventName);
-
-

DOMDebugger.setXHRBreakpoint Command

+
+

DOMDebugger.setXHRBreakpoint Command

Sets breakpoint on XMLHttpRequest.

url
-
String Resource URL substring. All XHRs having this substring in the URL will get stopped upon.
+
String Resource URL substring. All XHRs having this substring in the URL will get stopped upon.

Code Example:

@@ -2424,12 +2616,12 @@ 

Code Example:

DOMDebugger.setXHRBreakpoint(url);
-
-

DOMDebugger.removeXHRBreakpoint Command

+
+

DOMDebugger.removeXHRBreakpoint Command

Removes breakpoint from XMLHttpRequest.

url
-
String Resource URL substring.
+
String Resource URL substring.

Code Example:

@@ -2438,40 +2630,56 @@ 

Code Example:

-
+

DOMStorage

-Type +Type -Command +Command -Event +Event -
-

DOMStorage.Entry Type

+
+

DOMStorage.StorageId Type

+

Unique identifier of DOM storage entry.

+
+
String
+
+
+
+

DOMStorage.Entry Type

DOM Storage entry.

-
host
-
String Domain name.
+
origin
+
String Document origin.
isLocalStorage
-
Boolean True for local storage.
+
Boolean True for local storage.
id
-
Number Entry id for further reference.
+
DOMStorage.StorageId Entry id for further reference.
-
-

DOMStorage.enable Command

+
+

DOMStorage.Item Type

+

DOM Storage item.

+
+
[String]
+
+
+
+

DOMStorage.enable Command

Enables storage tracking, storage events will now be delivered to the client.

Code Example:

@@ -2479,8 +2687,8 @@ 

Code Example:

DOMStorage.enable();
-
-

DOMStorage.disable Command

+
+

DOMStorage.disable Command

Disables storage tracking, prevents storage events from being sent to the client.

Code Example:

@@ -2488,16 +2696,16 @@ 

Code Example:

DOMStorage.disable();
-
-

DOMStorage.getDOMStorageEntries Command

+
+

DOMStorage.getDOMStorageEntries Command

storageId
-
Integer
+
DOMStorage.StorageId

Callback Parameters:

entries
-
[DOMStorage.Entry]
+
[DOMStorage.Item]

Code Example:

@@ -2507,11 +2715,11 @@ 

Code Example:

});
-
-

DOMStorage.setDOMStorageItem Command

+
+

DOMStorage.setDOMStorageItem Command

storageId
-
Integer
+
DOMStorage.StorageId
key
String
value
@@ -2530,11 +2738,11 @@

Code Example:

});
-
-

DOMStorage.removeDOMStorageItem Command

+
+

DOMStorage.removeDOMStorageItem Command

storageId
-
Integer
+
DOMStorage.StorageId
key
String
@@ -2551,11 +2759,11 @@

Code Example:

});
-
-

DOMStorage.addDOMStorage Event

+
+

DOMStorage.addDOMStorage Event

storage
-
DOMStorage.Entry
+
DOMStorage.Entry

Code Example:

@@ -2565,62 +2773,70 @@ 

Code Example:

}
-
-

DOMStorage.updateDOMStorage Event

+
+

DOMStorage.domStorageUpdated Event

storageId
-
Integer
+
DOMStorage.StorageId

Code Example:

-// WebInspector Event: DOMStorage.updateDOMStorage
-function onUpdateDOMStorage(res) {
+// WebInspector Event: DOMStorage.domStorageUpdated
+function onDomStorageUpdated(res) {
 	// res = {storageId}
 }
 
-
+

Database

-Type +Type -Command +Command -Event +Event -
-

Database.Database Type

+
+

Database.DatabaseId Type

+

Unique identifier of Database object.

+
+
String
+
+
+
+

Database.Database Type

Database object.

id
-
String Database ID.
+
Database.DatabaseId Database ID.
domain
-
String Database domain.
+
String Database domain.
name
-
String Database name.
+
String Database name.
version
-
String Database version.
+
String Database version.
-
-

Database.Error Type

+
+

Database.Error Type

Database error.

-
-

Database.enable Command

+
+

Database.enable Command

Enables database tracking, database events will now be delivered to the client.

Code Example:

@@ -2628,8 +2844,8 @@ 

Code Example:

Database.enable();
-
-

Database.disable Command

+
+

Database.disable Command

Disables database tracking, prevents database events from being sent to the client.

Code Example:

@@ -2637,11 +2853,11 @@ 

Code Example:

Database.disable();
-
-

Database.getDatabaseTableNames Command

+
+

Database.getDatabaseTableNames Command

databaseId
-
Integer
+
Database.DatabaseId

Callback Parameters:

@@ -2656,11 +2872,11 @@

Code Example:

});
-
-

Database.executeSQL Command

+
+

Database.executeSQL Command

databaseId
-
Integer
+
Database.DatabaseId
query
String
@@ -2679,11 +2895,11 @@

Code Example:

});
-
-

Database.addDatabase Event

+
+

Database.addDatabase Event

database
-
Database.Database
+
Database.Database

Code Example:

@@ -2693,8 +2909,8 @@ 

Code Example:

}
-
-

Database.sqlTransactionSucceeded Event

+
+

Database.sqlTransactionSucceeded Event

transactionId
Integer
@@ -2711,13 +2927,13 @@

Code Example:

}
-
-

Database.sqlTransactionFailed Event

+
+

Database.sqlTransactionFailed Event

transactionId
Integer
sqlError
-
Database.Error
+
Database.Error

Code Example:

@@ -2728,132 +2944,138 @@ 

Code Example:

-
+

Debugger

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

-Type +Type -Command +Command -Event +Event -
-

Debugger.BreakpointId Type

+
+

Debugger.BreakpointId Type

Breakpoint identifier.

String
-
-

Debugger.ScriptId Type

+
+

Debugger.ScriptId Type

Unique script identifier.

String
-
-

Debugger.CallFrameId Type

+
+

Debugger.CallFrameId Type

Call frame identifier.

String
-
-

Debugger.Location Type

+
+

Debugger.Location Type

Location in the source code.

scriptId
-
Debugger.ScriptId Script identifier as reported in the Debugger.scriptParsed.
+
Debugger.ScriptId Script identifier as reported in the Debugger.scriptParsed.
lineNumber
-
Integer Line number in the script.
+
Integer Line number in the script.
columnNumber (optional)
-
Integer Column number in the script.
+
Integer Column number in the script.
-
-

Debugger.FunctionDetails Type

+
+

Debugger.FunctionDetails Type

Information about the function.

location
-
Debugger.Location Location of the function.
+
Debugger.Location Location of the function.
name (optional)
-
String Name of the function. Not present for anonymous functions.
+
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).
+
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.
+
String Name of the function inferred from its initial assignment.
+
scopeChain (optional)
+
[Debugger.Scope] Scope chain for this closure.
-
-

Debugger.CallFrame Type

+
+

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.
+
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.
+
String Name of the JavaScript function called on this call frame.
location
-
Debugger.Location Location in the source code.
+
Debugger.Location Location in the source code.
scopeChain
-
[Debugger.Scope] Scope chain for this call frame.
+
[Debugger.Scope] Scope chain for this call frame.
this
-
Runtime.RemoteObject this object for this call frame.
+
Runtime.RemoteObject this object for this call frame.
-
-

Debugger.Scope Type

+
+

Debugger.Scope Type

Scope description.

type
-
( global | local | with | closure | catch ) Scope 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.
+
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

+
+

Debugger.causesRecompilation Command

Tells whether enabling debugger causes scripts recompilation.

Callback Parameters:

result
-
Boolean True if enabling debugger causes scripts recompilation.
+
Boolean True if enabling debugger causes scripts recompilation.

Code Example:

@@ -2863,24 +3085,24 @@ 

Code Example:

});
-
-

Debugger.supportsNativeBreakpoints Command

-

Tells whether debugger supports native breakpoints.

+
+

Debugger.supportsSeparateScriptCompilationAndExecution Command

+

Tells whether debugger supports separate script compilation and execution.

Callback Parameters:

result
-
Boolean True if debugger supports native breakpoints.
+
Boolean True if debugger supports separate script compilation and execution.

Code Example:

-// WebInspector Command: Debugger.supportsNativeBreakpoints
-Debugger.supportsNativeBreakpoints(function callback(res) {
+// WebInspector Command: Debugger.supportsSeparateScriptCompilationAndExecution
+Debugger.supportsSeparateScriptCompilationAndExecution(function callback(res) {
 	// res = {result}
 });
 
-
-

Debugger.enable Command

+
+

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:

@@ -2888,8 +3110,8 @@ 

Code Example:

Debugger.enable();
-
-

Debugger.disable Command

+
+

Debugger.disable Command

Disables debugger for given page.

Code Example:

@@ -2897,12 +3119,12 @@ 

Code Example:

Debugger.disable();
-
-

Debugger.setBreakpointsActive Command

+
+

Debugger.setBreakpointsActive Command

Activates / deactivates all breakpoints on the page.

active
-
Boolean New value for breakpoints active state.
+
Boolean New value for breakpoints active state.

Code Example:

@@ -2910,27 +3132,27 @@ 

Code Example:

Debugger.setBreakpointsActive(active);
-
-

Debugger.setBreakpointByUrl Command

+
+

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.
+
Integer Line number to set breakpoint at.
url (optional)
-
String URL of the resources to set breakpoint on.
+
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.
+
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.
+
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.
+
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 (optional)
-
[Debugger.Location] List of the locations this breakpoint resolved into upon addition.
+
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:

@@ -2940,21 +3162,21 @@ 

Code Example:

});
-
-

Debugger.setBreakpoint Command

+
+

Debugger.setBreakpoint Command

Sets JavaScript breakpoint at a given location.

location
-
Debugger.Location Location to set breakpoint in.
+
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.
+
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.
+
Debugger.BreakpointId Id of the created breakpoint for further reference.
actualLocation
-
Debugger.Location Location this breakpoint resolved into.
+
Debugger.Location Location this breakpoint resolved into.

Code Example:

@@ -2964,12 +3186,12 @@ 

Code Example:

});
-
-

Debugger.removeBreakpoint Command

+
+

Debugger.removeBreakpoint Command

Removes JavaScript breakpoint.

breakpointId
-
Debugger.BreakpointId
+
Debugger.BreakpointId

Code Example:

@@ -2977,12 +3199,12 @@ 

Code Example:

Debugger.removeBreakpoint(breakpointId);
-
-

Debugger.continueToLocation Command

+
+

Debugger.continueToLocation Command

Continues execution until specific location is reached.

location
-
Debugger.Location Location to continue to.
+
Debugger.Location Location to continue to.

Code Example:

@@ -2990,8 +3212,8 @@ 

Code Example:

Debugger.continueToLocation(location);
-
-

Debugger.stepOver Command

+
+

Debugger.stepOver Command

Steps over the statement.

Code Example:

@@ -2999,8 +3221,8 @@ 

Code Example:

Debugger.stepOver();
-
-

Debugger.stepInto Command

+
+

Debugger.stepInto Command

Steps into the function call.

Code Example:

@@ -3008,8 +3230,8 @@ 

Code Example:

Debugger.stepInto();
-
-

Debugger.stepOut Command

+
+

Debugger.stepOut Command

Steps out of the function call.

Code Example:

@@ -3017,8 +3239,8 @@ 

Code Example:

Debugger.stepOut();
-
-

Debugger.pause Command

+
+

Debugger.pause Command

Stops on the next JavaScript statement.

Code Example:

@@ -3026,8 +3248,8 @@ 

Code Example:

Debugger.pause();
-
-

Debugger.resume Command

+
+

Debugger.resume Command

Resumes JavaScript execution.

Code Example:

@@ -3035,23 +3257,23 @@ 

Code Example:

Debugger.resume();
-
-

Debugger.searchInContent Command

+
+

Debugger.searchInContent Command

Searches for given string in script content.

scriptId
-
Debugger.ScriptId Id of the script to search in.
+
Debugger.ScriptId Id of the script to search in.
query
-
String String to search for.
+
String String to search for.
caseSensitive (optional)
-
Boolean If true, search is case sensitive.
+
Boolean If true, search is case sensitive.
isRegex (optional)
-
Boolean If true, treats string parameter as regex.
+
Boolean If true, treats string parameter as regex.

Callback Parameters:

result
-
[Page.SearchMatch] List of search matches.
+
[Page.SearchMatch] List of search matches.

Code Example:

@@ -3061,13 +3283,13 @@ 

Code Example:

});
-
-

Debugger.canSetScriptSource Command

+
+

Debugger.canSetScriptSource Command

Tells whether setScriptSource is supported.

Callback Parameters:

result
-
Boolean True if setScriptSource is supported.
+
Boolean True if setScriptSource is supported.

Code Example:

@@ -3077,23 +3299,23 @@ 

Code Example:

});
-
-

Debugger.setScriptSource Command

+
+

Debugger.setScriptSource Command

Edits JavaScript source live.

scriptId
-
Debugger.ScriptId Id of the script to edit.
+
Debugger.ScriptId Id of the script to edit.
scriptSource
-
String New content of the script.
+
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.
+
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.
+
[Debugger.CallFrame] New stack trace in case editing has happened while VM was stopped.
result (optional)
-
Object VM-specific description of the changes applied.
+
Object VM-specific description of the changes applied.

Code Example:

@@ -3103,17 +3325,39 @@ 

Code Example:

});
-
-

Debugger.getScriptSource Command

+
+

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.
+
Debugger.ScriptId Id of the script to get source for.

Callback Parameters:

scriptSource
-
String Script source.
+
String Script source.

Code Example:

@@ -3123,17 +3367,17 @@ 

Code Example:

});
-
-

Debugger.getFunctionDetails Command

+
+

Debugger.getFunctionDetails Command

Returns detailed informtation on given function.

functionId
-
Runtime.RemoteObjectId Id of the function to get location for.
+
Runtime.RemoteObjectId Id of the function to get location for.

Callback Parameters:

details
-
Debugger.FunctionDetails Information about the function.
+
Debugger.FunctionDetails Information about the function.

Code Example:

@@ -3143,12 +3387,12 @@ 

Code Example:

});
-
-

Debugger.setPauseOnExceptions Command

+
+

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.
+
( none | uncaught | all ) Pause on exceptions mode.

Code Example:

@@ -3156,38 +3400,105 @@ 

Code Example:

Debugger.setPauseOnExceptions(state);
-
-

Debugger.evaluateOnCallFrame Command

+
+

Debugger.evaluateOnCallFrame Command

Evaluates expression on a given call frame.

callFrameId
-
Debugger.CallFrameId Call frame identifier to evaluate on.
+
Debugger.CallFrameId Call frame identifier to evaluate on.
expression
-
String Expression to evaluate.
+
String Expression to evaluate.
objectGroup (optional)
-
String String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup).
+
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.
+
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.
+
Boolean Whether the result is expected to be a JSON object that should be sent by value.

Callback Parameters:

result
-
Runtime.RemoteObject Object wrapper for the evaluation result.
+
Runtime.RemoteObject Object wrapper for the evaluation result.
wasThrown (optional)
-
Boolean True if the result was thrown during the evaluation.
+
Boolean True if the result was thrown during the evaluation.

Code Example:

 // WebInspector Command: Debugger.evaluateOnCallFrame
-Debugger.evaluateOnCallFrame(callFrameId, expression, objectGroup, includeCommandLineAPI, returnByValue, function callback(res) {
+Debugger.evaluateOnCallFrame(callFrameId, expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, 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.globalObjectCleared Event

+
+

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:

@@ -3197,26 +3508,26 @@ 

Code Example:

}
-
-

Debugger.scriptParsed Event

+
+

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.
+
Debugger.ScriptId Identifier of the script parsed.
url
-
String URL or name of the script parsed (if any).
+
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).
+
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.
+
Integer Column offset of the script within the resource with given URL.
endLine
-
Integer Last line of the script.
+
Integer Last line of the script.
endColumn
-
Integer Length of the last line of the script.
+
Integer Length of the last line of the script.
isContentScript (optional)
-
Boolean Determines whether this script is a user extension script.
+
Boolean Determines whether this script is a user extension script.
sourceMapURL (optional)
-
String URL of source map associated with script (if any).
+
String URL of source map associated with script (if any).

Code Example:

@@ -3226,20 +3537,20 @@ 

Code Example:

}
-
-

Debugger.scriptFailedToParse Event

+
+

Debugger.scriptFailedToParse Event

Fired when virtual machine fails to parse the script.

url
-
String URL of the script that failed to parse.
+
String URL of the script that failed to parse.
scriptSource
-
String Source text of the script that failed to parse.
+
String Source text of the script that failed to parse.
startLine
-
Integer Line offset of the script within the resource.
+
Integer Line offset of the script within the resource.
errorLine
-
Integer Line with error.
+
Integer Line with error.
errorMessage
-
String Parse error message.
+
String Parse error message.

Code Example:

@@ -3249,14 +3560,14 @@ 

Code Example:

}
-
-

Debugger.breakpointResolved Event

+
+

Debugger.breakpointResolved Event

Fired when breakpoint is resolved to an actual script and location.

breakpointId
-
Debugger.BreakpointId Breakpoint unique identifier.
+
Debugger.BreakpointId Breakpoint unique identifier.
location
-
Debugger.Location Actual breakpoint location.
+
Debugger.Location Actual breakpoint location.

Code Example:

@@ -3266,16 +3577,16 @@ 

Code Example:

}
-
-

Debugger.paused Event

+
+

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.
+
[Debugger.CallFrame] Call stack the virtual machine stopped on.
reason
-
( XHR | DOM | EventListener | exception | other ) Pause reason.
+
( XHR | DOM | EventListener | exception | other ) Pause reason.
data (optional)
-
Object Object containing break-specific auxiliary properties.
+
Object Object containing break-specific auxiliary properties.

Code Example:

@@ -3285,8 +3596,8 @@ 

Code Example:

}
-
-

Debugger.resumed Event

+
+

Debugger.resumed Event

Fired when the virtual machine resumed execution.

Code Example:

@@ -3297,16 +3608,68 @@ 

Code Example:

-
+

FileSystem

-Command +Type + +Command -
-

FileSystem.enable Command

+Event + +
+

FileSystem.RequestId Type

+

Request Identifier to glue a request and its completion event.

+
+
Integer
+
+
+
+

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.Metadata Type

+

Represents metadata of a file or entry.

+
+
modificationTime
+
Number Modification time.
+
size
+
Number File size. This field is always zero for directories.
+
+
+
+

FileSystem.enable Command

Enables events from backend.

Code Example:

@@ -3314,136 +3677,319 @@ 

Code Example:

FileSystem.enable();
-
-

FileSystem.disable Command

-

Disables events from backend..

+
+

FileSystem.disable Command

+

Disables events from backend.

Code Example:

 // WebInspector Command: FileSystem.disable
 FileSystem.disable();
 
+
+

FileSystem.requestFileSystemRoot Command

+

Returns root directory of the FileSystem as fileSystemRootReceived event, 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:

+
+
requestId
+
FileSystem.RequestId Request identifier. Corresponding fileSystemRootReceived event should have same requestId with this.
+
+

Code Example:

+
+// WebInspector Command: FileSystem.requestFileSystemRoot
+FileSystem.requestFileSystemRoot(origin, type, function callback(res) {
+	// res = {requestId}
+});
+
+
+
+

FileSystem.requestDirectoryContent Command

+

Returns content of the directory as directoryContentReceived event.

+
+
url
+
String URL of the directory that the frontend is requesting to read from.
+
+

Callback Parameters:

+
+
requestId
+
FileSystem.RequestId Request identifier. Corresponding directoryContentReceived event should have same requestId with this.
+
+

Code Example:

+
+// WebInspector Command: FileSystem.requestDirectoryContent
+FileSystem.requestDirectoryContent(url, function callback(res) {
+	// res = {requestId}
+});
+
+
+
+

FileSystem.requestMetadata Command

+

Returns metadata of the entry as metadataReceived event.

+
+
url
+
String URL of the entry that the frontend is requesting to get metadata from.
+
+

Callback Parameters:

+
+
requestId
+
FileSystem.RequestId Request identifier. Corresponding metadataReceived event should have same requestId with this.
+
+

Code Example:

+
+// WebInspector Command: FileSystem.requestMetadata
+FileSystem.requestMetadata(url, function callback(res) {
+	// res = {requestId}
+});
+
+
+
+

FileSystem.requestFileContent Command

+

Returns content of the file as fileContentReceived event. 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:

+
+
requestId
+
FileSystem.RequestId Request identifier. Corresponding fileContentReceived event should have same requestId with this.
+
+

Code Example:

+
+// WebInspector Command: FileSystem.requestFileContent
+FileSystem.requestFileContent(url, readAsText, start, end, charset, function callback(res) {
+	// res = {requestId}
+});
+
+
+
+

FileSystem.fileSystemRootReceived Event

+

Completion event of requestFileSystemRoot command.

+
+
requestId
+
Integer Request Identifier that was returned by corresponding requestFileSystemRoot command.
+
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 Event: FileSystem.fileSystemRootReceived
+function onFileSystemRootReceived(res) {
+	// res = {requestId, errorCode, root}
+}
+
+
+
+

FileSystem.directoryContentReceived Event

+

Completion event of requestDirectoryContent command.

+
+
requestId
+
Integer Request Identifier that was returned by corresponding requestDirectoryContent command.
+
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 Event: FileSystem.directoryContentReceived
+function onDirectoryContentReceived(res) {
+	// res = {requestId, errorCode, entries}
+}
+
+
+
+

FileSystem.metadataReceived Event

+

Completion event of requestMetadata command.

+
+
requestId
+
Integer Request Identifier that was returned in response to the corresponding requestMetadata command.
+
errorCode
+
Integer 0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value.
+
metadata (optional)
+
FileSystem.Metadata Contains metadata of the entry if the command completed successfully.
+
+

Code Example:

+
+// WebInspector Event: FileSystem.metadataReceived
+function onMetadataReceived(res) {
+	// res = {requestId, errorCode, metadata}
+}
+
+
+
+

FileSystem.fileContentReceived Event

+

Completion event of requestFileContent command.

+
+
requestId
+
Integer Request Identifier that was returned in response to the corresponding requestFileContent command.
+
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 Event: FileSystem.fileContentReceived
+function onFileContentReceived(res) {
+	// res = {requestId, errorCode, content, charset}
+}
+
+
-
+

IndexedDB

-Type +Type -Command +Command -Event +Event -
-

IndexedDB.SecurityOriginWithDatabaseNames Type

+
+

IndexedDB.SecurityOriginWithDatabaseNames Type

Security origin with database names.

securityOrigin
-
String Security origin.
+
String Security origin.
databaseNames
-
[String] Database names for this origin.
+
[String] Database names for this origin.
-
-

IndexedDB.DatabaseWithObjectStores Type

+
+

IndexedDB.DatabaseWithObjectStores Type

Database with an array of object stores.

name
-
String Database name.
+
String Database name.
version
-
String Database version.
+
String Database version.
objectStores
-
[IndexedDB.ObjectStore] Object stores in this database.
+
[IndexedDB.ObjectStore] Object stores in this database.
-
-

IndexedDB.ObjectStore Type

+
+

IndexedDB.ObjectStore Type

Object store.

name
-
String Object store name.
+
String Object store name.
keyPath
-
String Object store key path.
+
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] Indexes in this object store.
-
-

IndexedDB.ObjectStoreIndex Type

+
+

IndexedDB.ObjectStoreIndex Type

Object store index.

name
-
String Index name.
+
String Index name.
keyPath
-
String Index key path.
+
IndexedDB.KeyPath Index key path.
unique
-
Boolean If true, index is unique.
+
Boolean If true, index is unique.
multiEntry
-
Boolean If true, index allows multiple entries for a key.
+
Boolean If true, index allows multiple entries for a key.
-
-

IndexedDB.Key Type

+
+

IndexedDB.Key Type

Key.

type
-
( number | string | date | array ) Key type.
+
( number | string | date | array ) Key type.
number (optional)
-
Number Number value.
+
Number Number value.
string (optional)
-
String String value.
+
String String value.
date (optional)
-
Number Date value.
+
Number Date value.
array (optional)
-
[IndexedDB.Key] Array value.
+
[IndexedDB.Key] Array value.
-
-

IndexedDB.KeyRange Type

+
+

IndexedDB.KeyRange Type

Key range.

lower (optional)
-
IndexedDB.Key Lower bound.
+
IndexedDB.Key Lower bound.
upper (optional)
-
IndexedDB.Key Upper bound.
+
IndexedDB.Key Upper bound.
lowerOpen
-
Boolean If true lower bound is open.
+
Boolean If true lower bound is open.
upperOpen
-
Boolean If true upper bound is open.
+
Boolean If true upper bound is open.
-
-

IndexedDB.DataEntry Type

-

Key.

+
+

IndexedDB.DataEntry Type

+

Data entry.

key
-
IndexedDB.Key Key.
+
IndexedDB.Key Key.
primaryKey
-
IndexedDB.Key Primary key.
+
IndexedDB.Key Primary key.
value
-
Runtime.RemoteObject Value.
+
Runtime.RemoteObject Value.
-
-

IndexedDB.enable Command

+
+

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:

@@ -3451,8 +3997,8 @@ 

Code Example:

IndexedDB.enable();
-
-

IndexedDB.disable Command

+
+

IndexedDB.disable Command

Disables events from backend.

Code Example:

@@ -3460,14 +4006,14 @@ 

Code Example:

IndexedDB.disable();
-
-

IndexedDB.requestDatabaseNamesForFrame Command

+
+

IndexedDB.requestDatabaseNamesForFrame Command

Requests database names for given frame's security origin.

requestId
-
Integer Request id.
+
Integer Request id.
frameId
-
Network.FrameId Frame id.
+
Network.FrameId Frame id.

Code Example:

@@ -3475,16 +4021,16 @@ 

Code Example:

IndexedDB.requestDatabaseNamesForFrame(requestId, frameId);
-
-

IndexedDB.requestDatabase Command

+
+

IndexedDB.requestDatabase Command

Requests database with given name in given frame.

requestId
-
Integer Request id.
+
Integer Request id.
frameId
-
Network.FrameId Frame id.
+
Network.FrameId Frame id.
databaseName
-
String Database name.
+
String Database name.

Code Example:

@@ -3492,26 +4038,26 @@ 

Code Example:

IndexedDB.requestDatabase(requestId, frameId, databaseName);
-
-

IndexedDB.requestData Command

+
+

IndexedDB.requestData Command

Requests data from object store or index.

requestId
-
Integer Request id.
+
Integer Request id.
frameId
-
Network.FrameId Frame id.
+
Network.FrameId Frame id.
databaseName
-
String Database name.
+
String Database name.
objectStoreName
-
String Object store name.
+
String Object store name.
indexName
-
String Index name, empty string for object store data requests.
+
String Index name, empty string for object store data requests.
skipCount
-
Integer Number of records to skip.
+
Integer Number of records to skip.
pageSize
-
Integer Number of records to fetch.
+
Integer Number of records to fetch.
keyRange (optional)
-
IndexedDB.KeyRange Key range.
+
IndexedDB.KeyRange Key range.

Code Example:

@@ -3519,13 +4065,13 @@ 

Code Example:

IndexedDB.requestData(requestId, frameId, databaseName, objectStoreName, indexName, skipCount, pageSize, keyRange);
-
-

IndexedDB.databaseNamesLoaded Event

+
+

IndexedDB.databaseNamesLoaded Event

requestId
-
Number Request id.
+
Number Request id.
securityOriginWithDatabaseNames
-
IndexedDB.SecurityOriginWithDatabaseNames Frame with database names.
+
IndexedDB.SecurityOriginWithDatabaseNames Frame with database names.

Code Example:

@@ -3535,13 +4081,13 @@ 

Code Example:

}
-
-

IndexedDB.databaseLoaded Event

+
+

IndexedDB.databaseLoaded Event

requestId
-
Integer Request id.
+
Integer Request id.
databaseWithObjectStores
-
IndexedDB.DatabaseWithObjectStores Database with an array of object stores.
+
IndexedDB.DatabaseWithObjectStores Database with an array of object stores.

Code Example:

@@ -3551,15 +4097,15 @@ 

Code Example:

}
-
-

IndexedDB.objectStoreDataLoaded Event

+
+

IndexedDB.objectStoreDataLoaded Event

requestId
-
Integer Request id.
+
Integer Request id.
objectStoreDataEntries
-
[IndexedDB.DataEntry] Array of object store data entries.
+
[IndexedDB.DataEntry] Array of object store data entries.
hasMore
-
Boolean If true, there are more entries to fetch in the given range.
+
Boolean If true, there are more entries to fetch in the given range.

Code Example:

@@ -3569,15 +4115,15 @@ 

Code Example:

}
-
-

IndexedDB.indexDataLoaded Event

+
+

IndexedDB.indexDataLoaded Event

requestId
-
Integer Request id.
+
Integer Request id.
indexDataEntries
-
[IndexedDB.DataEntry] Array of index data entries.
+
[IndexedDB.DataEntry] Array of index data entries.
hasMore
-
Boolean If true, there are more entries to fetch in the given range.
+
Boolean If true, there are more entries to fetch in the given range.

Code Example:

@@ -3588,23 +4134,21 @@ 

Code Example:

-
+

Inspector

-Command +Command -Event +Event -
-

Inspector.enable Command

+
+

Inspector.enable Command

Enables inspector domain notifications.

Code Example:

@@ -3612,8 +4156,8 @@ 

Code Example:

Inspector.enable();
-
-

Inspector.disable Command

+
+

Inspector.disable Command

Disables inspector domain notifications.

Code Example:

@@ -3621,8 +4165,8 @@ 

Code Example:

Inspector.disable();
-
-

Inspector.evaluateForTestInFrontend Event

+
+

Inspector.evaluateForTestInFrontend Event

testCallId
Integer
@@ -3637,11 +4181,11 @@

Code Example:

}
-
-

Inspector.inspect Event

+
+

Inspector.inspect Event

object
-
Runtime.RemoteObject
+
Runtime.RemoteObject
hints
Object
@@ -3653,55 +4197,25 @@

Code Example:

}
-
-

Inspector.didCreateWorker Event

-
-
id
-
Integer
-
url
-
String
-
isShared
-
Boolean
-
-

Code Example:

-
-// WebInspector Event: Inspector.didCreateWorker
-function onDidCreateWorker(res) {
-	// res = {id, url, isShared}
-}
-
-
-
-

Inspector.didDestroyWorker Event

-
-
id
-
Integer
-
-

Code Example:

-
-// WebInspector Event: Inspector.didDestroyWorker
-function onDidDestroyWorker(res) {
-	// res = {id}
-}
-
-
-
+

Memory

-Type +Type -Command +Command -
-

Memory.NodeCount Type

+
+

Memory.NodeCount Type

Number of nodes with given name.

nodeName
@@ -3710,8 +4224,8 @@

Memory.NodeCount Type

Integer
-
-

Memory.ListenerCount Type

+
+

Memory.ListenerCount Type

Number of JS event listeners by event type.

type
@@ -3720,8 +4234,8 @@

Memory.ListenerCount Type

Integer
-
-

Memory.StringStatistics Type

+
+

Memory.StringStatistics Type

Character data statistics for the page.

dom
@@ -3732,8 +4246,8 @@

Memory.StringStatistics Type

Integer
-
-

Memory.DOMGroup Type

+
+

Memory.DOMGroup Type

size
Integer
@@ -3742,19 +4256,30 @@

Memory.DOMGroup Type

documentURI (optional)
String
nodeCount
-
[Memory.NodeCount]
+
[Memory.NodeCount]
listenerCount
-
[Memory.ListenerCount]
+
[Memory.ListenerCount]
-
-

Memory.getDOMNodeCount Command

+
+

Memory.MemoryBlock Type

+
+
size (optional)
+
Number Size of the block in bytes if available
+
name
+
String Unique name used to identify the component that allocated this block
+
children (optional)
+
[Memory.MemoryBlock]
+
+
+
+

Memory.getDOMNodeCount Command

Callback Parameters:

domGroups
-
[Memory.DOMGroup]
+
[Memory.DOMGroup]
strings
-
Memory.StringStatistics
+
Memory.StringStatistics

Code Example:

@@ -3764,212 +4289,243 @@ 

Code Example:

});
+
+

Memory.getProcessMemoryDistribution Command

+

Callback Parameters:

+
+
distribution
+
Memory.MemoryBlock An object describing all memory allocated by the process
+
+

Code Example:

+
+// WebInspector Command: Memory.getProcessMemoryDistribution
+Memory.getProcessMemoryDistribution(function callback(res) {
+	// res = {distribution}
+});
+
+
-
+

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 +Type -Command +Command -Event +Event -
-

Network.LoaderId Type

+
+

Network.LoaderId Type

Unique loader identifier.

String
-
-

Network.FrameId Type

+
+

Network.FrameId Type

Unique frame identifier.

String
-
-

Network.RequestId Type

+
+

Network.RequestId Type

Unique request identifier.

String
-
-

Network.Timestamp Type

+
+

Network.Timestamp Type

Number of seconds since epoch.

Number
-
-

Network.Headers Type

+
+

Network.Headers Type

Request / response headers as keys / values of JSON object.

-
-

Network.ResourceTiming Type

+
+

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.
+
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.
+
Number Started resolving proxy.
proxyEnd
-
Number Finished resolving proxy.
+
Number Finished resolving proxy.
dnsStart
-
Number Started DNS address resolve.
+
Number Started DNS address resolve.
dnsEnd
-
Number Finished DNS address resolve.
+
Number Finished DNS address resolve.
connectStart
-
Number Started connecting to the remote host.
+
Number Started connecting to the remote host.
connectEnd
-
Number Connected to the remote host.
+
Number Connected to the remote host.
sslStart
-
Number Started SSL handshake.
+
Number Started SSL handshake.
sslEnd
-
Number Finished SSL handshake.
+
Number Finished SSL handshake.
sendStart
-
Number Started sending request.
+
Number Started sending request.
sendEnd
-
Number Finished sending request.
+
Number Finished sending request.
receiveHeadersEnd
-
Number Finished receiving response headers.
+
Number Finished receiving response headers.
-
-

Network.Request Type

+
+

Network.Request Type

HTTP request data.

url
-
String Request URL.
+
String Request URL.
method
-
String HTTP request method.
+
String HTTP request method.
headers
-
Network.Headers HTTP request headers.
+
Network.Headers HTTP request headers.
postData (optional)
-
String HTTP POST request data.
+
String HTTP POST request data.
-
-

Network.Response Type

+
+

Network.Response Type

HTTP response data.

url
-
String Response URL.
+
String Response URL.
status
-
Number HTTP response status code.
+
Number HTTP response status code.
statusText
-
String HTTP response status text.
+
String HTTP response status text.
headers
-
Network.Headers HTTP response headers.
+
Network.Headers HTTP response headers.
headersText (optional)
-
String HTTP response headers text.
+
String HTTP response headers text.
mimeType
-
String Resource mimeType as determined by the browser.
+
String Resource mimeType as determined by the browser.
requestHeaders (optional)
-
Network.Headers Refined HTTP request headers that were actually transmitted over the network.
+
Network.Headers Refined HTTP request headers that were actually transmitted over the network.
requestHeadersText (optional)
-
String HTTP request headers text.
+
String HTTP request headers text.
connectionReused
-
Boolean Specifies whether physical connection was actually reused for this request.
+
Boolean Specifies whether physical connection was actually reused for this request.
connectionId
-
Number Physical connection id that was actually used for this request.
+
Number Physical connection id that was actually used for this request.
fromDiskCache (optional)
-
Boolean Specifies that the request was served from the disk cache.
+
Boolean Specifies that the request was served from the disk cache.
timing (optional)
-
Network.ResourceTiming Timing information for the given request.
+
Network.ResourceTiming Timing information for the given request.
-
-

Network.WebSocketRequest Type

+
+

Network.WebSocketRequest Type

WebSocket request data.

requestKey3
-
String HTTP response status text.
+
String HTTP response status text.
headers
-
Network.Headers HTTP response headers.
+
Network.Headers HTTP response headers.
-
-

Network.WebSocketResponse Type

+
+

Network.WebSocketResponse Type

WebSocket response data.

status
-
Number HTTP response status code.
+
Number HTTP response status code.
statusText
-
String HTTP response status text.
+
String HTTP response status text.
headers
-
Network.Headers HTTP response headers.
+
Network.Headers HTTP response headers.
challengeResponse
-
String Challenge response.
+
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

+
+

Network.CachedResource Type

Information about the cached resource.

url
-
String Resource URL.
+
String Resource URL.
type
-
Page.ResourceType Type of this resource.
+
Page.ResourceType Type of this resource.
response (optional)
-
Network.Response Cached response data.
+
Network.Response Cached response data.
bodySize
-
Number Cached response body size.
+
Number Cached response body size.
-
-

Network.Initiator Type

+
+

Network.Initiator Type

Information about the request initiator.

type
-
( parser | script | other ) Type of this initiator.
+
( parser | script | other ) Type of this initiator.
stackTrace (optional)
-
Console.StackTrace Initiator JavaScript stack trace, set for Script only.
+
Console.StackTrace Initiator JavaScript stack trace, set for Script only.
url (optional)
-
String Initiator URL, set for Parser type only.
+
String Initiator URL, set for Parser type only.
lineNumber (optional)
-
Number Initiator line number, set for Parser type only.
+
Number Initiator line number, set for Parser type only.
-
-

Network.enable Command

+
+

Network.enable Command

Enables network tracking, network events will now be delivered to the client.

Code Example:

@@ -3977,8 +4533,8 @@ 

Code Example:

Network.enable();
-
-

Network.disable Command

+
+

Network.disable Command

Disables network tracking, prevents network events from being sent to the client.

Code Example:

@@ -3986,12 +4542,12 @@ 

Code Example:

Network.disable();
-
-

Network.setUserAgentOverride Command

+
+

Network.setUserAgentOverride Command

Allows overriding user agent with the given string.

userAgent
-
String User agent to use.
+
String User agent to use.

Code Example:

@@ -3999,12 +4555,12 @@ 

Code Example:

Network.setUserAgentOverride(userAgent);
-
-

Network.setExtraHTTPHeaders Command

+
+

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.
+
Network.Headers Map with extra HTTP headers.

Code Example:

@@ -4012,19 +4568,19 @@ 

Code Example:

Network.setExtraHTTPHeaders(headers);
-
-

Network.getResponseBody Command

+
+

Network.getResponseBody Command

Returns content served for the given request.

requestId
-
Network.RequestId Identifier of the network request to get content for.
+
Network.RequestId Identifier of the network request to get content for.

Callback Parameters:

body
-
String Response body.
+
String Response body.
base64Encoded
-
Boolean True, if content was sent as base64.
+
Boolean True, if content was sent as base64.

Code Example:

@@ -4034,13 +4590,13 @@ 

Code Example:

});
-
-

Network.canClearBrowserCache Command

+
+

Network.canClearBrowserCache Command

Tells whether clearing browser cache is supported.

Callback Parameters:

result
-
Boolean True if browser cache can be cleared.
+
Boolean True if browser cache can be cleared.

Code Example:

@@ -4050,8 +4606,8 @@ 

Code Example:

});
-
-

Network.clearBrowserCache Command

+
+

Network.clearBrowserCache Command

Clears browser cache.

Code Example:

@@ -4059,13 +4615,13 @@ 

Code Example:

Network.clearBrowserCache();
-
-

Network.canClearBrowserCookies Command

+
+

Network.canClearBrowserCookies Command

Tells whether clearing browser cookies is supported.

Callback Parameters:

result
-
Boolean True if browser cookies can be cleared.
+
Boolean True if browser cookies can be cleared.

Code Example:

@@ -4075,8 +4631,8 @@ 

Code Example:

});
-
-

Network.clearBrowserCookies Command

+
+

Network.clearBrowserCookies Command

Clears browser cookies.

Code Example:

@@ -4084,12 +4640,12 @@ 

Code Example:

Network.clearBrowserCookies();
-
-

Network.setCacheDisabled Command

+
+

Network.setCacheDisabled Command

Toggles ignoring cache for each request. If true, cache will not be used.

cacheDisabled
-
Boolean Cache disabled state.
+
Boolean Cache disabled state.

Code Example:

@@ -4097,43 +4653,41 @@ 

Code Example:

Network.setCacheDisabled(cacheDisabled);
-
-

Network.requestWillBeSent Event

+
+

Network.requestWillBeSent Event

Fired when page is about to send HTTP request.

requestId
-
Network.RequestId Request identifier.
+
Network.RequestId Request identifier.
frameId
-
Network.FrameId Frame identifier.
+
Network.FrameId Frame identifier.
loaderId
-
Network.LoaderId Loader identifier.
+
Network.LoaderId Loader identifier.
documentURL
-
String URL of the document this request is loaded for.
+
String URL of the document this request is loaded for.
request
-
Network.Request Request data.
+
Network.Request Request data.
timestamp
-
Network.Timestamp Timestamp.
+
Network.Timestamp Timestamp.
initiator
-
Network.Initiator Request initiator.
-
stackTrace (optional)
-
Console.StackTrace JavaScript stack trace upon issuing this request.
+
Network.Initiator Request initiator.
redirectResponse (optional)
-
Network.Response Redirect response data.
+
Network.Response Redirect response data.

Code Example:

 // WebInspector Event: Network.requestWillBeSent
 function onRequestWillBeSent(res) {
-	// res = {requestId, frameId, loaderId, documentURL, request, timestamp, initiator, stackTrace, redirectResponse}
+	// res = {requestId, frameId, loaderId, documentURL, request, timestamp, initiator, redirectResponse}
 }
 
-
-

Network.requestServedFromCache Event

+
+

Network.requestServedFromCache Event

Fired if request ended up loading from cache.

requestId
-
Network.RequestId Request identifier.
+
Network.RequestId Request identifier.

Code Example:

@@ -4143,22 +4697,22 @@ 

Code Example:

}
-
-

Network.responseReceived Event

+
+

Network.responseReceived Event

Fired when HTTP response is available.

requestId
-
Network.RequestId Request identifier.
+
Network.RequestId Request identifier.
frameId
-
Network.FrameId Frame identifier.
+
Network.FrameId Frame identifier.
loaderId
-
Network.LoaderId Loader identifier.
+
Network.LoaderId Loader identifier.
timestamp
-
Network.Timestamp Timestamp.
+
Network.Timestamp Timestamp.
type
-
Page.ResourceType Resource type.
+
Page.ResourceType Resource type.
response
-
Network.Response Response data.
+
Network.Response Response data.

Code Example:

@@ -4168,18 +4722,18 @@ 

Code Example:

}
-
-

Network.dataReceived Event

+
+

Network.dataReceived Event

Fired when data chunk was received over the network.

requestId
-
Network.RequestId Request identifier.
+
Network.RequestId Request identifier.
timestamp
-
Network.Timestamp Timestamp.
+
Network.Timestamp Timestamp.
dataLength
-
Integer Data chunk length.
+
Integer Data chunk length.
encodedDataLength
-
Integer Actual bytes received (might be less than dataLength for compressed encodings).
+
Integer Actual bytes received (might be less than dataLength for compressed encodings).

Code Example:

@@ -4189,14 +4743,14 @@ 

Code Example:

}
-
-

Network.loadingFinished Event

+
+

Network.loadingFinished Event

Fired when HTTP request has finished loading.

requestId
-
Network.RequestId Request identifier.
+
Network.RequestId Request identifier.
timestamp
-
Network.Timestamp Timestamp.
+
Network.Timestamp Timestamp.

Code Example:

@@ -4206,18 +4760,18 @@ 

Code Example:

}
-
-

Network.loadingFailed Event

+
+

Network.loadingFailed Event

Fired when HTTP request has failed to load.

requestId
-
Network.RequestId Request identifier.
+
Network.RequestId Request identifier.
timestamp
-
Network.Timestamp Timestamp.
+
Network.Timestamp Timestamp.
errorText
-
String User friendly error message.
+
String User friendly error message.
canceled (optional)
-
Boolean True if loading was canceled.
+
Boolean True if loading was canceled.

Code Example:

@@ -4227,24 +4781,24 @@ 

Code Example:

}
-
-

Network.requestServedFromMemoryCache Event

+
+

Network.requestServedFromMemoryCache Event

Fired when HTTP request has been served from memory cache.

requestId
-
Network.RequestId Request identifier.
+
Network.RequestId Request identifier.
frameId
-
Network.FrameId Frame identifier.
+
Network.FrameId Frame identifier.
loaderId
-
Network.LoaderId Loader identifier.
+
Network.LoaderId Loader identifier.
documentURL
-
String URL of the document this request is loaded for.
+
String URL of the document this request is loaded for.
timestamp
-
Network.Timestamp Timestamp.
+
Network.Timestamp Timestamp.
initiator
-
Network.Initiator Request initiator.
+
Network.Initiator Request initiator.
resource
-
Network.CachedResource Cached resource data.
+
Network.CachedResource Cached resource data.

Code Example:

@@ -4254,16 +4808,16 @@ 

Code Example:

}
-
-

Network.webSocketWillSendHandshakeRequest Event

+
+

Network.webSocketWillSendHandshakeRequest Event

Fired when WebSocket is about to initiate handshake.

requestId
-
Network.RequestId Request identifier.
+
Network.RequestId Request identifier.
timestamp
-
Network.Timestamp Timestamp.
+
Network.Timestamp Timestamp.
request
-
Network.WebSocketRequest WebSocket request data.
+
Network.WebSocketRequest WebSocket request data.

Code Example:

@@ -4273,16 +4827,16 @@ 

Code Example:

}
-
-

Network.webSocketHandshakeResponseReceived Event

+
+

Network.webSocketHandshakeResponseReceived Event

Fired when WebSocket handshake response becomes available.

requestId
-
Network.RequestId Request identifier.
+
Network.RequestId Request identifier.
timestamp
-
Network.Timestamp Timestamp.
+
Network.Timestamp Timestamp.
response
-
Network.WebSocketResponse WebSocket response data.
+
Network.WebSocketResponse WebSocket response data.

Code Example:

@@ -4292,14 +4846,14 @@ 

Code Example:

}
-
-

Network.webSocketCreated Event

+
+

Network.webSocketCreated Event

Fired upon WebSocket creation.

requestId
-
Network.RequestId Request identifier.
+
Network.RequestId Request identifier.
url
-
String WebSocket request URL.
+
String WebSocket request URL.

Code Example:

@@ -4309,14 +4863,14 @@ 

Code Example:

}
-
-

Network.webSocketClosed Event

+
+

Network.webSocketClosed Event

Fired when WebSocket is closed.

requestId
-
Network.RequestId Request identifier.
+
Network.RequestId Request identifier.
timestamp
-
Network.Timestamp Timestamp.
+
Network.Timestamp Timestamp.

Code Example:

@@ -4326,139 +4880,206 @@ 

Code Example:

}
+
+

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 +Type -Command +Command -Event +Event -
-

Page.ResourceType Type

+
+

Page.ResourceType Type

Resource type as it was perceived by the rendering engine.

( Document | Stylesheet | Image | Font | Script | XHR | WebSocket | Other )
-
-

Page.Frame Type

+
+

Page.Frame Type

Information about the Frame on the page.

id
-
String Frame unique identifier.
+
String Frame unique identifier.
parentId (optional)
-
String Parent frame identifier.
+
String Parent frame identifier.
loaderId
-
Network.LoaderId Identifier of the loader associated with this frame.
+
Network.LoaderId Identifier of the loader associated with this frame.
name (optional)
-
String Frame's name as specified in the tag.
+
String Frame's name as specified in the tag.
url
-
String Frame document's URL.
+
String Frame document's URL.
securityOrigin (optional)
-
String Frame document's security origin.
+
String Frame document's security origin.
mimeType
-
String Frame document's mimeType as determined by the browser.
+
String Frame document's mimeType as determined by the browser.
-
-

Page.FrameResourceTree Type

+
+

Page.FrameResourceTree Type

Information about the Frame hierarchy along with their cached resources.

frame
-
Page.Frame Frame information for this tree item.
+
Page.Frame Frame information for this tree item.
childFrames (optional)
-
[Page.FrameResourceTree] Child frames.
+
[Page.FrameResourceTree] Child frames.
resources
-
[Object] Information about frame resources.
+
[Object] Information about frame resources.
-
-

Page.SearchMatch Type

+
+

Page.SearchMatch Type

Search match for resource.

lineNumber
-
Number Line number in resource content.
+
Number Line number in resource content.
lineContent
-
String Line with match content.
+
String Line with match content.
-
-

Page.SearchResult Type

+
+

Page.SearchResult Type

Search result for resource.

url
-
String Resource URL.
+
String Resource URL.
frameId
-
Network.FrameId Resource frame id.
+
Network.FrameId Resource frame id.
matchesCount
-
Number Number of matches in the resource content.
+
Number Number of matches in the resource content.
-
-
+

Profiler

-Type +Type -Command +Command -Event +Event -
-

Profiler.Profile Type

+
+

Profiler.ProfileHeader Type

+

Profile header.

+
+
typeId
+
( CPU | CSS | HEAP ) Profile type name.
+
title
+
String Profile title.
+
uid
+
Integer Unique identifier of the profile.
+
maxJSObjectId (optional)
+
Integer Last seen JS object Id.
+
+
+
+

Profiler.Profile Type

Profile.

+
+
head (optional)
+
Object
+
bottomUpHead (optional)
+
Object
+
-
-

Profiler.ProfileHeader Type

-

Profile header.

+
+

Profiler.HeapSnapshotObjectId Type

+

Heap snashot object id.

+
+
String
+
-
-

Profiler.causesRecompilation Command

+
+

Profiler.causesRecompilation Command

Callback Parameters:

result
@@ -4818,8 +5610,8 @@

Code Example:

});
-
-

Profiler.isSampling Command

+
+

Profiler.isSampling Command

Callback Parameters:

result
@@ -4833,8 +5625,8 @@

Code Example:

});
-
-

Profiler.hasHeapProfiler Command

+
+

Profiler.hasHeapProfiler Command

Callback Parameters:

result
@@ -4848,44 +5640,44 @@

Code Example:

});
-
-

Profiler.enable Command

+
+

Profiler.enable Command

Code Example:

 // WebInspector Command: Profiler.enable
 Profiler.enable();
 
-
-

Profiler.disable Command

+
+

Profiler.disable Command

Code Example:

 // WebInspector Command: Profiler.disable
 Profiler.disable();
 
-
-

Profiler.start Command

+
+

Profiler.start Command

Code Example:

 // WebInspector Command: Profiler.start
 Profiler.start();
 
-
-

Profiler.stop Command

+
+

Profiler.stop Command

Code Example:

 // WebInspector Command: Profiler.stop
 Profiler.stop();
 
-
-

Profiler.getProfileHeaders Command

+
+

Profiler.getProfileHeaders Command

Callback Parameters:

headers
-
[Profiler.ProfileHeader]
+
[Profiler.ProfileHeader]

Code Example:

@@ -4895,8 +5687,8 @@ 

Code Example:

});
-
-

Profiler.getProfile Command

+
+

Profiler.getProfile Command

type
String
@@ -4906,7 +5698,7 @@

Profiler.getProfile Command

Callback Parameters:

profile
-
Profiler.Profile
+
Profiler.Profile

Code Example:

@@ -4916,8 +5708,8 @@ 

Code Example:

});
-
-

Profiler.removeProfile Command

+
+

Profiler.removeProfile Command

type
String
@@ -4930,42 +5722,42 @@

Code Example:

Profiler.removeProfile(type, uid);
-
-

Profiler.clearProfiles Command

+
+

Profiler.clearProfiles Command

Code Example:

 // WebInspector Command: Profiler.clearProfiles
 Profiler.clearProfiles();
 
-
-

Profiler.takeHeapSnapshot Command

+
+

Profiler.takeHeapSnapshot Command

Code Example:

 // WebInspector Command: Profiler.takeHeapSnapshot
 Profiler.takeHeapSnapshot();
 
-
-

Profiler.collectGarbage Command

+
+

Profiler.collectGarbage Command

Code Example:

 // WebInspector Command: Profiler.collectGarbage
 Profiler.collectGarbage();
 
-
-

Profiler.getObjectByHeapObjectId Command

+
+

Profiler.getObjectByHeapObjectId Command

objectId
-
Integer
+
Profiler.HeapSnapshotObjectId
objectGroup (optional)
-
String Symbolic group name that can be used to release multiple objects.
+
String Symbolic group name that can be used to release multiple objects.

Callback Parameters:

result
-
Runtime.RemoteObject Evaluation result.
+
Runtime.RemoteObject Evaluation result.

Code Example:

@@ -4975,11 +5767,30 @@ 

Code Example:

});
-
-

Profiler.addProfileHeader Event

+
+

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
+
Profiler.ProfileHeader

Code Example:

@@ -4989,8 +5800,8 @@ 

Code Example:

}
-
-

Profiler.addHeapSnapshotChunk Event

+
+

Profiler.addHeapSnapshotChunk Event

uid
Integer
@@ -5005,8 +5816,8 @@

Code Example:

}
-
-

Profiler.finishHeapSnapshot Event

+
+

Profiler.finishHeapSnapshot Event

uid
Integer
@@ -5019,8 +5830,8 @@

Code Example:

}
-
-

Profiler.setRecordingProfile Event

+
+

Profiler.setRecordingProfile Event

isProfiling
Boolean
@@ -5033,8 +5844,8 @@

Code Example:

}
-
-

Profiler.resetProfiles Event

+
+

Profiler.resetProfiles Event

Code Example:

 // WebInspector Event: Profiler.resetProfiles
@@ -5043,8 +5854,8 @@ 

Code Example:

}
-
-

Profiler.reportHeapSnapshotProgress Event

+
+

Profiler.reportHeapSnapshotProgress Event

done
Integer
@@ -5060,155 +5871,214 @@

Code Example:

-
+

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 +Type + +Command -Command +Event -
-

Runtime.RemoteObjectId Type

+
+

Runtime.RemoteObjectId Type

Unique object identifier.

String
-
-

Runtime.RemoteObject Type

+
+

Runtime.RemoteObject Type

Mirror object referencing original JavaScript object.

type
-
( object | function | undefined | string | number | boolean ) 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.
+
( 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.
+
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).
+
Any Remote object value (in case of primitive values or JSON values if it was requested).
description (optional)
-
String String representation of the object.
+
String String representation of the object.
objectId (optional)
-
Runtime.RemoteObjectId Unique object identifier (for non-primitive values).
+
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.PropertyDescriptor Type

+
+

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.
+
String Property name.
value (optional)
-
Runtime.RemoteObject The value associated with the property.
+
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).
+
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).
+
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).
+
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.
+
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.
+
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.
+
Boolean True if the result was thrown during the evaluation.
-
-

Runtime.CallArgument Type

+
+

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.
+
Any Primitive value.
objectId (optional)
-
Runtime.RemoteObjectId Remote object handle.
+
Runtime.RemoteObjectId Remote object handle.
+
+
+
+

Runtime.ExecutionContextId Type

+

Id of an execution context.

+
+
Integer
-
-

Runtime.evaluate Command

+
+

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.
+
String Expression to evaluate.
objectGroup (optional)
-
String Symbolic group name that can be used to release multiple objects.
+
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.
-
doNotPauseOnExceptions (optional)
-
Boolean Specifies whether evaluation should stop on exceptions. Overrides setPauseOnException state.
-
frameId (optional)
-
Network.FrameId Specifies in which frame to perform evaluation.
+
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.
+
Boolean Whether the result is expected to be a JSON object that should be sent by value.

Callback Parameters:

result
-
Runtime.RemoteObject Evaluation result.
+
Runtime.RemoteObject Evaluation result.
wasThrown (optional)
-
Boolean True if the result was thrown during the evaluation.
+
Boolean True if the result was thrown during the evaluation.

Code Example:

 // WebInspector Command: Runtime.evaluate
-Runtime.evaluate(expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptions, frameId, returnByValue, function callback(res) {
+Runtime.evaluate(expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, contextId, returnByValue, function callback(res) {
 	// res = {result, wasThrown}
 });
 
-
-

Runtime.callFunctionOn Command

+
+

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.
+
Runtime.RemoteObjectId Identifier of the object to call function on.
functionDeclaration
-
String Declaration of the function to call.
+
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.
+
[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.
+
Boolean Whether the result is expected to be a JSON object which should be sent by value.

Callback Parameters:

result
-
Runtime.RemoteObject Call result.
+
Runtime.RemoteObject Call result.
wasThrown (optional)
-
Boolean True if the result was thrown during the evaluation.
+
Boolean True if the result was thrown during the evaluation.

Code Example:

 // WebInspector Command: Runtime.callFunctionOn
-Runtime.callFunctionOn(objectId, functionDeclaration, arguments, returnByValue, function callback(res) {
+Runtime.callFunctionOn(objectId, functionDeclaration, arguments, doNotPauseOnExceptionsAndMuteConsole, returnByValue, function callback(res) {
 	// res = {result, wasThrown}
 });
 
-
-

Runtime.getProperties Command

+
+

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.
+
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.
+
Boolean If true, returns properties belonging only to the element itself, not to its prototype chain.

Callback Parameters:

result
-
[Runtime.PropertyDescriptor] Object properties.
+
[Runtime.PropertyDescriptor] Object properties.

Code Example:

@@ -5218,12 +6088,12 @@ 

Code Example:

});
-
-

Runtime.releaseObject Command

+
+

Runtime.releaseObject Command

Releases remote object with given id.

objectId
-
Runtime.RemoteObjectId Identifier of the object to release.
+
Runtime.RemoteObjectId Identifier of the object to release.

Code Example:

@@ -5231,12 +6101,12 @@ 

Code Example:

Runtime.releaseObject(objectId);
-
-

Runtime.releaseObjectGroup Command

+
+

Runtime.releaseObjectGroup Command

Releases all remote objects that belong to a given group.

objectGroup
-
String Symbolic object group name.
+
String Symbolic object group name.

Code Example:

@@ -5244,8 +6114,8 @@ 

Code Example:

Runtime.releaseObjectGroup(objectGroup);
-
-

Runtime.run Command

+
+

Runtime.run Command

Tells inspected instance(worker or page) that it can run in case it was started paused.

Code Example:

@@ -5253,42 +6123,71 @@ 

Code Example:

Runtime.run();
+
+

Runtime.setReportExecutionContextCreation Command

+

Enables reporting about creation of isolated contexts by means of isolatedContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing isolated context.

+
+
enabled
+
Boolean Reporting enabled state.
+
+

Code Example:

+
+// WebInspector Command: Runtime.setReportExecutionContextCreation
+Runtime.setReportExecutionContextCreation(enabled);
+
+
+
+

Runtime.isolatedContextCreated Event

+

Issued when new isolated context is created.

+
+
context
+
Runtime.ExecutionContextDescription A newly created isolated contex.
+
+

Code Example:

+
+// WebInspector Event: Runtime.isolatedContextCreated
+function onIsolatedContextCreated(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 +Type -Command +Command -Event +Event -
-

Timeline.TimelineEvent Type

+
+

Timeline.TimelineEvent Type

Timeline record contains information about the recorded activity.

type
-
String Event type.
+
String Event type.
data
-
Object Event data.
+
Object Event data.
children (optional)
-
[Timeline.TimelineEvent] Nested records.
+
[Timeline.TimelineEvent] Nested records.
-
-

Timeline.start Command

+
+

Timeline.start Command

Starts capturing instrumentation events.

maxCallStackDepth (optional)
-
Integer Samples JavaScript stack traces up to maxCallStackDepth, defaults to 5.
+
Integer Samples JavaScript stack traces up to maxCallStackDepth, defaults to 5.

Code Example:

@@ -5296,8 +6195,8 @@ 

Code Example:

Timeline.start(maxCallStackDepth);
-
-

Timeline.stop Command

+
+

Timeline.stop Command

Stops capturing instrumentation events.

Code Example:

@@ -5305,12 +6204,12 @@ 

Code Example:

Timeline.stop();
-
-

Timeline.setIncludeMemoryDetails Command

+
+

Timeline.setIncludeMemoryDetails Command

Starts calculating various DOM statistics and sending them as part of timeline events.

enabled
-
Boolean True to start collecting DOM counters.
+
Boolean True to start collecting DOM counters.

Code Example:

@@ -5318,12 +6217,28 @@ 

Code Example:

Timeline.setIncludeMemoryDetails(enabled);
-
-

Timeline.eventRecorded Event

+
+

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.eventRecorded Event

Fired for every instrumentation event while timeline is started.

record
-
Timeline.TimelineEvent Timeline event record data.
+
Timeline.TimelineEvent Timeline event record data.

Code Example:

@@ -5334,38 +6249,70 @@ 

Code Example:

-
+
+

WebGL

+

+Command + +
+

WebGL.enable Command

+

Enables WebGL inspection.

+

Code Example:

+
+// WebInspector Command: WebGL.enable
+WebGL.enable();
+
+
+
+

WebGL.disable Command

+

Disables WebGL inspection.

+

Code Example:

+
+// WebInspector Command: WebGL.disable
+WebGL.disable();
+
+
+
+

Worker

-Command +Command -Event +Event -
-

Worker.setWorkerInspectionEnabled Command

-
-
value
-
Boolean
-
+
+

Worker.enable Command

+

Code Example:

+
+// WebInspector Command: Worker.enable
+Worker.enable();
+
+
+
+

Worker.disable Command

Code Example:

-// WebInspector Command: Worker.setWorkerInspectionEnabled
-Worker.setWorkerInspectionEnabled(value);
+// WebInspector Command: Worker.disable
+Worker.disable();
 
-
-

Worker.sendMessageToWorker Command

+
+

Worker.sendMessageToWorker Command

workerId
Integer
@@ -5378,8 +6325,8 @@

Code Example:

Worker.sendMessageToWorker(workerId, message);
-
-

Worker.connectToWorker Command

+
+

Worker.connectToWorker Command

workerId
Integer
@@ -5390,8 +6337,8 @@

Code Example:

Worker.connectToWorker(workerId);
-
-

Worker.disconnectFromWorker Command

+
+

Worker.disconnectFromWorker Command

workerId
Integer
@@ -5402,8 +6349,8 @@

Code Example:

Worker.disconnectFromWorker(workerId);
-
-

Worker.setAutoconnectToWorkers Command

+
+

Worker.setAutoconnectToWorkers Command

value
Boolean
@@ -5414,8 +6361,8 @@

Code Example:

Worker.setAutoconnectToWorkers(value);
-
-

Worker.workerCreated Event

+
+

Worker.workerCreated Event

workerId
Integer
@@ -5432,8 +6379,8 @@

Code Example:

}
-
-

Worker.workerTerminated Event

+
+

Worker.workerTerminated Event

workerId
Integer
@@ -5446,8 +6393,8 @@

Code Example:

}
-
-

Worker.dispatchMessageFromWorker Event

+
+

Worker.dispatchMessageFromWorker Event

workerId
Integer
@@ -5462,8 +6409,8 @@

Code Example:

}
-
-

Worker.disconnectedFromWorker Event

+
+

Worker.disconnectedFromWorker Event

Code Example:

 // WebInspector Event: Worker.disconnectedFromWorker
@@ -5475,8 +6422,8 @@ 

Code Example:

-

Generated from Inspector.json v1.0 on 2012-03-18 22:23:32-0700

-

Implementation by Jonathan Diehl

+

Generated from Inspector.json v1.0 on 2012-08-17 16:44:25+0200

+

Implementation by Jonathan Diehl

diff --git a/src/LiveDevelopment/LiveDevelopment.js b/src/LiveDevelopment/LiveDevelopment.js index b25790d4d29..6a4c2f2eec3 100644 --- a/src/LiveDevelopment/LiveDevelopment.js +++ b/src/LiveDevelopment/LiveDevelopment.js @@ -53,6 +53,13 @@ define(function LiveDevelopment(require, exports, module) { "use strict"; + // Status Codes + var STATUS_ERROR = exports.STATUS_ERROR = -1; + var STATUS_INACTIVE = exports.STATUS_INACTIVE = 0; + var STATUS_CONNECTING = exports.STATUS_CONNECTING = 1; + var STATUS_LOADING_AGENTS = exports.STATUS_LOADING_AGENTS = 2; + var STATUS_ACTIVE = exports.STATUS_ACTIVE = 3; + var DocumentManager = require("document/DocumentManager"); var EditorManager = require("editor/EditorManager"); var NativeApp = require("utils/NativeApp"); @@ -106,14 +113,14 @@ define(function LiveDevelopment(require, exports, module) { var matches = /^(.*\/)(.+\.([^.]+))$/.exec(doc.file.fullPath); if (matches) { var prefix = "file://"; - + // The file.fullPath on Windows starts with a drive letter ("C:"). // In order to make it a valid file: URL we need to add an // additional slash to the prefix. if (brackets.platform === "win") { prefix += "/"; } - + doc.extension = matches[3]; doc.url = encodeURI(prefix + doc.file.fullPath); @@ -123,7 +130,7 @@ define(function LiveDevelopment(require, exports, module) { doc.root = {url: encodeURI(prefix + matches[1] + fileName)}; } } - + /** Get the current document from the document manager * _adds extension, url and root to the document */ @@ -152,10 +159,10 @@ define(function LiveDevelopment(require, exports, module) { throw "Invalid document type: " + doc.extension; */ } - + return null; } - + /** * Removes the given CSS/JSDocument from _relatedDocuments. Signals that the * given file is no longer associated with the HTML document that is live (e.g. @@ -183,7 +190,7 @@ define(function LiveDevelopment(require, exports, module) { _relatedDocuments = undefined; } } - + /** Create a live version of a Brackets document */ function _createDocument(doc, editor) { var DocClass = _classForDocument(doc); @@ -193,7 +200,7 @@ define(function LiveDevelopment(require, exports, module) { return null; } } - + /** Convert a file: URL to a local full file path */ function _urlToPath(url) { var path; @@ -282,7 +289,7 @@ define(function LiveDevelopment(require, exports, module) { } /** Triggered by Inspector.error */ - function _onError(error) { + function _onError(event, error) { var message = error.message; // Additional information, like exactly which parameter could not be processed. @@ -294,7 +301,7 @@ define(function LiveDevelopment(require, exports, module) { // Show the message, but include the error object for further information (e.g. error code) console.error(message, error); } - + /** Run when all agents are loaded */ function _onLoad() { var doc = _getCurrentDocument(); @@ -302,56 +309,60 @@ define(function LiveDevelopment(require, exports, module) { var editor = EditorManager.getCurrentFullEditor(); _openDocument(doc, editor); } - _setStatus(3); + _setStatus(STATUS_ACTIVE); } /** Triggered by Inspector.connect */ - function _onConnect() { + function _onConnect(event) { var promises = loadAgents(); - _setStatus(2); + _setStatus(STATUS_LOADING_AGENTS); $.when.apply(undefined, promises).then(_onLoad, _onError); } /** Triggered by Inspector.disconnect */ - function _onDisconnect() { + function _onDisconnect(event) { unloadAgents(); _closeDocument(); - _setStatus(0); + _setStatus(STATUS_INACTIVE); } /** Open the Connection and go live */ function open() { + var result = new $.Deferred(), + promise = result.promise(); var doc = _getCurrentDocument(); var browserStarted = false; var retryCount = 0; - + function showWrongDocError() { Dialogs.showModalDialog( Dialogs.DIALOG_ID_ERROR, Strings.LIVE_DEVELOPMENT_ERROR_TITLE, Strings.LIVE_DEV_NEED_HTML_MESSAGE ); + result.reject("WRONG_DOC"); } - + if (!doc || !doc.root) { showWrongDocError(); - + } else { // For Sprint 6, we only open live development connections for HTML files // FUTURE: Remove this test when we support opening connections for different // file types. if (!doc.extension || doc.extension.indexOf("htm") !== 0) { showWrongDocError(); - return; + return promise; } - - _setStatus(1); - Inspector.connectToURL(doc.root.url).fail(function onConnectFail(err) { + + _setStatus(STATUS_CONNECTING); + Inspector.connectToURL(doc.root.url).then(result.resolve, function onConnectFail(err) { if (err === "CANCEL") { + result.reject(err); return; } if (retryCount > 6) { - _setStatus(-1); + _setStatus(STATUS_ERROR); Dialogs.showModalDialog( Dialogs.DIALOG_ID_LIVE_DEVELOPMENT, Strings.LIVE_DEVELOPMENT_ERROR_TITLE, @@ -359,24 +370,29 @@ define(function LiveDevelopment(require, exports, module) { ).done(function (id) { if (id === Dialogs.DIALOG_BTN_OK) { // User has chosen to reload Chrome, quit the running instance - _setStatus(0); + _setStatus(STATUS_INACTIVE); NativeApp.closeLiveBrowser() .done(function () { browserStarted = false; - window.setTimeout(open); + window.setTimeout(function () { + open().then(result.resolve, result.reject); + }); }) .fail(function (err) { // Report error? - _setStatus(-1); + _setStatus(STATUS_ERROR); browserStarted = false; + result.reject("CLOSE_LIVE_BROWSER"); }); + } else { + result.reject("CANCEL"); } }); return; } retryCount++; - - if (!browserStarted && exports.status !== -1) { + + if (!browserStarted && exports.status !== STATUS_ERROR) { // If err === FileError.ERR_NOT_FOUND, it means a remote debugger connection // is available, but the requested URL is not loaded in the browser. In that // case we want to launch the live browser (to open the url in a new tab) @@ -392,29 +408,33 @@ define(function LiveDevelopment(require, exports, module) { }) .fail(function (err) { var message; - - _setStatus(-1); + + _setStatus(STATUS_ERROR); if (err === FileError.NOT_FOUND_ERR) { message = Strings.ERROR_CANT_FIND_CHROME; } else { message = StringUtils.format(Strings.ERROR_LAUNCHING_BROWSER, err); } - + Dialogs.showModalDialog( Dialogs.DIALOG_ID_ERROR, Strings.ERROR_LAUNCHING_BROWSER_TITLE, message ); + + result.reject("OPEN_LIVE_BROWSER"); }); } - - if (exports.status !== -1) { + + if (exports.status !== STATUS_ERROR) { window.setTimeout(function retryConnect() { - Inspector.connectToURL(doc.root.url).fail(onConnectFail); + Inspector.connectToURL(doc.root.url).then(result.resolve, onConnectFail); }, 500); } }); } + + return promise; } /** Close the Connection */ @@ -423,7 +443,7 @@ define(function LiveDevelopment(require, exports, module) { Inspector.Runtime.evaluate("window.close()"); } Inspector.disconnect(); - _setStatus(0); + _setStatus(STATUS_INACTIVE); } /** Triggered by a document change from the DocumentManager */ @@ -432,7 +452,7 @@ define(function LiveDevelopment(require, exports, module) { if (!doc) { return; } - + if (Inspector.connected()) { if (agents.network && agents.network.wasURLRequested(doc.url)) { _closeDocument(); @@ -450,7 +470,7 @@ define(function LiveDevelopment(require, exports, module) { window.setTimeout(open); } } - + function getLiveDocForPath(path) { var docsToSearch = []; if (_relatedDocuments) { @@ -467,7 +487,7 @@ define(function LiveDevelopment(require, exports, module) { } return false; }); - + return foundDoc; } @@ -481,10 +501,9 @@ define(function LiveDevelopment(require, exports, module) { /** Initialize the LiveDevelopment Session */ function init(theConfig) { exports.config = theConfig; - Inspector.on("connect", _onConnect); - Inspector.on("disconnect", _onDisconnect); - Inspector.on("error", _onError); - Inspector.on("load", _onLoad); + $(Inspector).on("connect", _onConnect) + .on("disconnect", _onDisconnect) + .on("error", _onError); $(DocumentManager).on("currentDocumentChange", _onDocumentChange); } diff --git a/src/LiveDevelopment/main.js b/src/LiveDevelopment/main.js index b82326aaa91..e28ab4ff434 100644 --- a/src/LiveDevelopment/main.js +++ b/src/LiveDevelopment/main.js @@ -63,7 +63,7 @@ define(function main(require, exports, module) { Strings.LIVE_DEV_STATUS_TIP_PROGRESS2, Strings.LIVE_DEV_STATUS_TIP_CONNECTED]; // Status indicator tooltip var _statusStyle = ["warning", "", "info", "info", "success"]; // Status indicator's CSS class var _allStatusStyles = _statusStyle.join(" "); - + var _$btnGoLive; // reference to the GoLive button var _$btnHighlight; // reference to the HighlightButton @@ -90,7 +90,7 @@ define(function main(require, exports, module) { // Clear text/styles from previous status $("span", $btn).remove(); $btn.removeClass(_allStatusStyles); - + // Set text/styles for new status if (text && text.length > 0) { $("") @@ -100,7 +100,7 @@ define(function main(require, exports, module) { } else { $btn.addClass(style); } - + if (tooltip) { $btn.attr("title", tooltip); } @@ -108,7 +108,7 @@ define(function main(require, exports, module) { /** Toggles LiveDevelopment and synchronizes the state of UI elements that reports LiveDevelopment status */ function _handleGoLiveCommand() { - if (LiveDevelopment.status > 0) { + if (LiveDevelopment.status >= LiveDevelopment.STATUS_CONNECTING) { LiveDevelopment.close(); // TODO Ty: when checkmark support lands, remove checkmark } else { @@ -129,7 +129,7 @@ define(function main(require, exports, module) { // various status codes. _setLabel(_$btnGoLive, null, _statusStyle[status + 1], _statusTooltip[status + 1]); }); - + // Initialize tooltip for 'not connected' state _setLabel(_$btnGoLive, null, _statusStyle[1], _statusTooltip[1]); }