diff --git a/src/LiveDevelopment/Agents/DOMAgent.js b/src/LiveDevelopment/Agents/DOMAgent.js index da7950e0792..f34e030f48a 100644 --- a/src/LiveDevelopment/Agents/DOMAgent.js +++ b/src/LiveDevelopment/Agents/DOMAgent.js @@ -209,7 +209,9 @@ define(function DOMAgent(require, exports, module) { // WebInspector Event: Page.frameNavigated function _onFrameNavigated(event, res) { // res = {frame} - exports.url = _cleanURL(res.frame.url); + if (!res.frame.parentId) { + exports.url = _cleanURL(res.frame.url); + } } // WebInspector Event: DOM.documentUpdated @@ -291,6 +293,9 @@ define(function DOMAgent(require, exports, module) { if (n.location > node.location) { n.location += delta; } + if (n.closeLocation !== undefined && n.closeLocation > node.location) { + n.closeLocation += delta; + } }); } } diff --git a/src/LiveDevelopment/Agents/RemoteFunctions.js b/src/LiveDevelopment/Agents/RemoteFunctions.js index d3831e5b22d..f06a1b1c581 100644 --- a/src/LiveDevelopment/Agents/RemoteFunctions.js +++ b/src/LiveDevelopment/Agents/RemoteFunctions.js @@ -38,6 +38,17 @@ function RemoteFunctions(experimental) { var HIGHLIGHT_CLASSNAME = "__brackets-ld-highlight", KEEP_ALIVE_TIMEOUT = 3000; // Keep alive timeout value, in milliseconds + // determine whether an event should be processed for Live Development + function _validEvent(event) { + if (navigator.platform.substr(0, 3) === "Mac") { + // Mac + return event.metaKey; + } else { + // Windows + return event.ctrlKey; + } + } + // determine the color for a type function _typeColor(type, highlight) { switch (type) { @@ -297,6 +308,12 @@ function RemoteFunctions(experimental) { for (i = 0; i < highlights.length; i++) { body.removeChild(highlights[i]); } + + if (this.trigger) { + for (i = 0; i < this.elements.length; i++) { + _trigger(this.elements[i], "highlight", 0); + } + } this.elements = []; }, @@ -340,17 +357,15 @@ function RemoteFunctions(experimental) { /** Event Handlers ***********************************************************/ function onMouseOver(event) { - if (!event.metaKey) { - return; + if (_validEvent(event)) { + _localHighlight.add(event.target, true); } - _localHighlight.add(event.target, true); } function onMouseOut(event) { - if (!event.metaKey) { - return; + if (_validEvent(event)) { + _localHighlight.clear(); } - _localHighlight.clear(); } function onMouseMove(event) { @@ -359,20 +374,19 @@ function RemoteFunctions(experimental) { } function onClick(event) { - if (!event.metaKey) { - return; - } - event.preventDefault(); - event.stopPropagation(); - if (event.altKey) { - _toggleEditor(event.target); - } else { - _toggleMenu(event.target); + if (_validEvent(event)) { + event.preventDefault(); + event.stopPropagation(); + if (event.altKey) { + _toggleEditor(event.target); + } else { + _toggleMenu(event.target); + } } } function onKeyUp(event) { - if (_setup && !event.metaKey) { + if (_setup && !_validEvent(event)) { document.removeEventListener("keyup", onKeyUp); document.removeEventListener("mouseover", onMouseOver); document.removeEventListener("mouseout", onMouseOut); @@ -385,7 +399,7 @@ function RemoteFunctions(experimental) { } function onKeyDown(event) { - if (!_setup && event.metaKey) { + if (!_setup && _validEvent(event)) { document.addEventListener("keyup", onKeyUp); document.addEventListener("mouseover", onMouseOver); document.addEventListener("mouseout", onMouseOut); diff --git a/src/LiveDevelopment/Inspector/Inspector.json b/src/LiveDevelopment/Inspector/Inspector.json index 51566ad332f..8dfdc55c001 100644 --- a/src/LiveDevelopment/Inspector/Inspector.json +++ b/src/LiveDevelopment/Inspector/Inspector.json @@ -89,6 +89,16 @@ { "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" }} ] + }, + { + "id": "HeapSnapshotChunk", + "type": "object", + "properties": [ + { "name": "strings", "type": "array", "items": { "type": "string" }, "description": "An array of strings that were found since last update." }, + { "name": "nodes", "type": "array", "items": { "type": "integer" }, "description": "An array of nodes that were found since last update." }, + { "name": "edges", "type": "array", "items": { "type": "integer" }, "description": "An array of edges that were found since last update." }, + { "name": "baseToRealNodeId", "type": "array", "items": { "type": "integer" }, "description": "An array of integers for nodeId remapping. Even nodeId has to be mapped to the following odd nodeId." } + ] } ], "commands": [ @@ -99,12 +109,31 @@ { "name": "strings", "$ref": "StringStatistics" } ] }, + { + "name": "getDOMCounters", + "returns": [ + { "name": "documents", "type": "integer" }, + { "name": "nodes", "type": "integer" }, + { "name": "jsEventListeners", "type": "integer" } + ] + }, { "name": "getProcessMemoryDistribution", + "parameters": [ + { "name": "reportGraph", "type": "boolean", "optional": true, "description": "Whether native memory graph should be reported in addition to aggregated statistics." } + ], "returns": [ { "name": "distribution", "$ref": "MemoryBlock", "description": "An object describing all memory allocated by the process"} ] } + ], + "events": [ + { + "name": "addNativeSnapshotChunk", + "parameters": [ + { "name": "chunk", "$ref": "HeapSnapshotChunk", "description": "A chunk of the serialized the snapshot." } + ] + } ] }, { @@ -230,7 +259,8 @@ "name": "reload", "parameters": [ { "name": "ignoreCache", "type": "boolean", "optional": true, "description": "If true, browser cache is ignored (as if the user pressed Shift+refresh)." }, - { "name": "scriptToEvaluateOnLoad", "type": "string", "optional": true, "description": "If set, the script will be injected into all frames of the inspected page after reload." } + { "name": "scriptToEvaluateOnLoad", "type": "string", "optional": true, "description": "If set, the script will be injected into all frames of the inspected page after reload." }, + { "name": "scriptPreprocessor", "type": "string", "optional": true, "description": "Script body that should evaluate to function that will preprocess all the scripts before their compilation.", "hidden": true } ], "description": "Reloads given page optionally ignoring the cache." }, @@ -254,9 +284,9 @@ "name": "deleteCookie", "parameters": [ { "name": "cookieName", "type": "string", "description": "Name of the cookie to remove." }, - { "name": "domain", "type": "string", "description": "Domain of the cookie to remove." } + { "name": "url", "type": "string", "description": "URL to match cooke domain and path." } ], - "description": "Deletes browser cookie with given name for the given domain.", + "description": "Deletes browser cookie with given name, domain and path.", "hidden": true }, { @@ -344,6 +374,54 @@ ], "hidden": true }, + { + "name": "canShowDebugBorders", + "description": "Tells if backend supports debug borders on layers", + "returns": [ + { "name": "show", "type": "boolean", "description": "True if the debug borders can be shown" } + ], + "hidden": true + }, + { + "name": "setShowDebugBorders", + "description": "Requests that backend shows debug borders on layers", + "parameters": [ + { "name": "show", "type": "boolean", "description": "True for showing debug borders" } + ], + "hidden": true + }, + { + "name": "canShowFPSCounter", + "description": "Tells if backend supports a FPS counter display", + "returns": [ + { "name": "show", "type": "boolean", "description": "True if the FPS count can be shown" } + ], + "hidden": true + }, + { + "name": "setShowFPSCounter", + "description": "Requests that backend shows the FPS counter", + "parameters": [ + { "name": "show", "type": "boolean", "description": "True for showing the FPS counter" } + ], + "hidden": true + }, + { + "name": "canContinuouslyPaint", + "description": "Tells if backend supports continuous painting", + "returns": [ + { "name": "value", "type": "boolean", "description": "True if continuous painting is available" } + ], + "hidden": true + }, + { + "name": "setContinuousPaintingEnabled", + "description": "Requests that backend enables continuous painting", + "parameters": [ + { "name": "enabled", "type": "boolean", "description": "True for enabling cointinuous painting" } + ], + "hidden": true + }, { "name": "getScriptExecutionStatus", "description": "Determines if scripts can be executed in the page.", @@ -412,6 +490,14 @@ "description": "Toggles mouse event-based touch event emulation.", "hidden": true }, + { + "name": "setEmulatedMedia", + "parameters": [ + { "name": "media", "type": "string", "description": "Media type to emulate. Empty string disables the override." } + ], + "description": "Emulates the given media for CSS media queries.", + "hidden": true + }, { "name": "getCompositingBordersVisible", "description": "Indicates the visibility of compositing borders.", @@ -427,6 +513,22 @@ { "name": "visible", "type": "boolean", "description": "True for showing compositing borders." } ], "hidden": true + }, + { + "name": "captureScreenshot", + "description": "Capture page screenshot.", + "returns": [ + { "name": "data", "type": "string", "description": "Base64-encoded image data (PNG)." } + ], + "hidden": true + }, + { + "name": "handleJavaScriptDialog", + "description": "Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).", + "parameters": [ + { "name": "accept", "type": "boolean", "description": "Whether to accept or dismiss the dialog." } + ], + "hidden": true } ], "events": [ @@ -457,6 +559,52 @@ { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has been detached." } ], "hidden": true + }, + { + "name": "frameStartedLoading", + "description": "Fired when frame has started loading.", + "parameters": [ + { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has started loading." } + ], + "hidden": true + }, + { + "name": "frameStoppedLoading", + "description": "Fired when frame has stopped loading.", + "parameters": [ + { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has stopped loading." } + ], + "hidden": true + }, + { + "name": "frameScheduledNavigation", + "description": "Fired when frame schedules a potential navigation.", + "parameters": [ + { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has scheduled a navigation." }, + { "name": "delay", "type": "number", "description": "Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start." } + ], + "hidden": true + }, + { + "name": "frameClearedScheduledNavigation", + "description": "Fired when frame no longer has a scheduled navigation.", + "parameters": [ + { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has cleared its scheduled navigation." } + ], + "hidden": true + }, + { + "name": "javascriptDialogOpening", + "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.", + "parameters": [ + { "name": "message", "type": "string", "description": "Message that will be displayed by the dialog." } + ], + "hidden": true + }, + { + "name": "javascriptDialogClosed", + "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.", + "hidden": true } ] }, @@ -659,7 +807,7 @@ { "name": "source", "type": "string", "enum": ["html", "wml", "xml", "javascript", "network", "console-api", "other"], "description": "Message source." }, { "name": "level", "type": "string", "enum": ["tip", "log", "warning", "error", "debug"], "description": "Message severity." }, { "name": "text", "type": "string", "description": "Message text." }, - { "name": "type", "type": "string", "optional": true, "enum": ["log", "dir", "dirxml", "trace", "startGroup", "startGroupCollapsed", "endGroup", "assert"], "description": "Console message type." }, + { "name": "type", "type": "string", "optional": true, "enum": ["log", "dir", "dirxml", "trace", "clear", "startGroup", "startGroupCollapsed", "endGroup", "assert", "timing"], "description": "Console message type." }, { "name": "url", "type": "string", "optional": true, "description": "URL of the message origin." }, { "name": "line", "type": "integer", "optional": true, "description": "Line number in the resource that generated this message." }, { "name": "repeatCount", "type": "integer", "optional": true, "description": "Repeat count for repeated messages." }, @@ -689,22 +837,22 @@ "commands": [ { "name": "enable", - "description": "Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification." + "description": "Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification." }, { "name": "disable", - "description": "Disables console domain, prevents further console messages from being reported to the client." + "description": "Disables console domain, prevents further console messages from being reported to the client." }, { "name": "clearMessages", - "description": "Clears console messages collected in the browser." + "description": "Clears console messages collected in the browser." }, { "name": "setMonitoringXHREnabled", "parameters": [ { "name": "enabled", "type": "boolean", "description": "Monitoring enabled state." } ], - "description": "Toggles monitoring of XMLHttpRequest. If true, console will receive messages upon each XHR issued.", + "description": "Toggles monitoring of XMLHttpRequest. If true, console will receive messages upon each XHR issued.", "hidden": true }, { @@ -808,7 +956,7 @@ "type": "object", "description": "HTTP response data.", "properties": [ - { "name": "url", "type": "string", "description": "Response URL." }, + { "name": "url", "type": "string", "description": "Response URL. This URL can be different from CachedResource.url in case of redirect." }, { "name": "status", "type": "number", "description": "HTTP response status code." }, { "name": "statusText", "type": "string", "description": "HTTP response status text." }, { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." }, @@ -828,7 +976,6 @@ "description": "WebSocket request data.", "hidden": true, "properties": [ - { "name": "requestKey3", "type": "string", "description": "HTTP response status text." }, { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." } ] }, @@ -840,8 +987,7 @@ "properties": [ { "name": "status", "type": "number", "description": "HTTP response status code." }, { "name": "statusText", "type": "string", "description": "HTTP response status text." }, - { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." }, - { "name": "challengeResponse", "type": "string", "description": "Challenge response." } + { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." } ] }, { @@ -860,7 +1006,7 @@ "type": "object", "description": "Information about the cached resource.", "properties": [ - { "name": "url", "type": "string", "description": "Resource URL." }, + { "name": "url", "type": "string", "description": "Resource URL. This is the url of the original network request." }, { "name": "type", "$ref": "Page.ResourceType", "description": "Type of this resource." }, { "name": "response", "$ref": "Response", "optional": true, "description": "Cached response data." }, { "name": "bodySize", "type": "number", "description": "Cached response body size." } @@ -947,7 +1093,7 @@ "parameters": [ { "name": "cacheDisabled", "type": "boolean", "description": "Cache disabled state." } ], - "description": "Toggles ignoring cache for each request. If true, cache will not be used." + "description": "Toggles ignoring cache for each request. If true, cache will not be used." } ], "events": [ @@ -1242,8 +1388,8 @@ "type": "object", "description": "Data entry.", "properties": [ - { "name": "key", "$ref": "Key", "description": "Key." }, - { "name": "primaryKey", "$ref": "Key", "description": "Primary key." }, + { "name": "key", "$ref": "Runtime.RemoteObject", "description": "Key." }, + { "name": "primaryKey", "$ref": "Runtime.RemoteObject", "description": "Primary key." }, { "name": "value", "$ref": "Runtime.RemoteObject", "description": "Value." } ] }, @@ -1387,10 +1533,34 @@ ] }, { - "name": "domStorageUpdated", + "name": "domStorageItemsCleared", "parameters": [ { "name": "storageId", "$ref": "StorageId" } ] + }, + { + "name": "domStorageItemRemoved", + "parameters": [ + { "name": "storageId", "$ref": "StorageId" }, + { "name": "key", "type": "string" } + ] + }, + { + "name": "domStorageItemAdded", + "parameters": [ + { "name": "storageId", "$ref": "StorageId" }, + { "name": "key", "type": "string" }, + { "name": "newValue", "type": "string" } + ] + }, + { + "name": "domStorageItemUpdated", + "parameters": [ + { "name": "storageId", "$ref": "StorageId" }, + { "name": "key", "type": "string" }, + { "name": "oldValue", "type": "string" }, + { "name": "newValue", "type": "string" } + ] } ] }, @@ -1613,8 +1783,10 @@ { "name": "xmlVersion", "type": "string", "optional": true, "description": "Document's XML version in case of XML documents." }, { "name": "name", "type": "string", "optional": true, "description": "Attr's name." }, { "name": "value", "type": "string", "optional": true, "description": "Attr's value." }, + { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "Frame ID for frame owner elements." }, { "name": "contentDocument", "$ref": "Node", "optional": true, "description": "Content document for frame owner elements." }, - { "name": "shadowRoots", "type": "array", "optional": true, "items": { "$ref": "Node" }, "description": "Shadow root list for given element host." } + { "name": "shadowRoots", "type": "array", "optional": true, "items": { "$ref": "Node" }, "description": "Shadow root list for given element host." }, + { "name": "templateContent", "$ref": "Node", "optional": true, "description": "Content document fragment for template elements" } ], "description": "DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type." }, @@ -1668,9 +1840,10 @@ { "name": "requestChildNodes", "parameters": [ - { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to get children for." } + { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to get children for." }, + { "name": "depth", "type": "integer", "optional": true, "description": "The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0." } ], - "description": "Requests that children of the node with given id are returned to the caller in form of setChildNodes events." + "description": "Requests that children of the node with given id are returned to the caller in form of setChildNodes events where not only immediate children are retrieved, but all children down to the specified depth." }, { "name": "querySelector", @@ -1842,10 +2015,11 @@ { "name": "highlightNode", "parameters": [ - { "name": "nodeId", "$ref": "NodeId", "description": "Identifier of the node to highlight." }, - { "name": "highlightConfig", "$ref": "HighlightConfig", "description": "A descriptor for the highlight appearance." } + { "name": "highlightConfig", "$ref": "HighlightConfig", "description": "A descriptor for the highlight appearance." }, + { "name": "nodeId", "$ref": "NodeId", "optional": true, "description": "Identifier of the node to highlight." }, + { "name": "objectId", "$ref": "Runtime.RemoteObjectId", "optional": true, "description": "JavaScript object id of the node to be highlighted." } ], - "description": "Highlights DOM node with given id." + "description": "Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified." }, { "name": "hideHighlight", @@ -1919,6 +2093,14 @@ "name": "markUndoableState", "description": "Marks last undoable state.", "hidden": true + }, + { + "name": "focus", + "parameters": [ + { "name": "nodeId", "$ref": "DOM.NodeId", "description": "Id of the node to focus." } + ], + "description": "Focuses the given element.", + "hidden": true } ], "events": [ @@ -2791,6 +2973,18 @@ ], "hidden": true, "description": "Sets overlay message." + }, + { + "name": "setVariableValue", + "parameters": [ + { "name": "callFrameId", "$ref": "CallFrameId", "optional": true, "description": "Id of callframe that holds variable." }, + { "name": "functionObjectId", "$ref": "Runtime.RemoteObjectId", "optional": true, "description": "Object id of closure (function) that holds variable." }, + { "name": "scopeNumber", "type": "integer", "description": "0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually." }, + { "name": "variableName", "type": "string", "description": "Variable name." }, + { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New variable value." } + ], + "hidden": true, + "description": "Changes value of variable in a callframe or a closure. Either callframe or function must be specified. Object-based scopes are not supported and must be mutated manually." } ], "events": [ @@ -2937,12 +3131,29 @@ ] }, { - "id": "Profile", + "id": "CPUProfileNode", + "type": "object", + "description": "CPU Profile node. Holds callsite information, execution statistics and child nodes.", + "properties": [ + { "name": "functionName", "type": "string", "description": "Function name." }, + { "name": "url", "type": "string", "description": "URL." }, + { "name": "lineNumber", "type": "integer", "description": "Line number." }, + { "name": "totalTime", "type": "number", "description": "Total execution time." }, + { "name": "selfTime", "type": "number", "description": "Self time." }, + { "name": "numberOfCalls", "type": "integer", "description": "Number of calls." }, + { "name": "visible", "type": "boolean", "description": "Visibility." }, + { "name": "callUID", "type": "number", "description": "Call UID." }, + { "name": "children", "type": "array", "items": { "$ref": "CPUProfileNode" }, "description": "Child nodes." } + ] + }, + { + "id": "CPUProfile", "type": "object", "description": "Profile.", "properties": [ - { "name": "head", "type": "object", "optional": true }, - { "name": "bottomUpHead", "type": "object", "optional": true } + { "name": "head", "$ref": "CPUProfileNode", "optional": true }, + { "name": "bottomUpHead", "$ref": "CPUProfileNode", "optional": true }, + { "name": "idleTime", "type": "number", "optional": true } ] }, { @@ -2989,13 +3200,18 @@ ] }, { - "name": "getProfile", + "name": "getCPUProfile", "parameters": [ - { "name": "type", "type": "string" }, { "name": "uid", "type": "integer" } ], "returns": [ - { "name": "profile", "$ref": "Profile" } + { "name": "profile", "$ref": "CPUProfile" } + ] + }, + { + "name": "getHeapSnapshot", + "parameters": [ + { "name": "uid", "type": "integer" } ] }, { @@ -3009,7 +3225,10 @@ "name": "clearProfiles" }, { - "name": "takeHeapSnapshot" + "name": "takeHeapSnapshot", + "parameters": [ + { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken." } + ] }, { "name": "collectGarbage" @@ -3141,30 +3360,64 @@ "hidden": true, "types": [ { - "id": "TraceLogId", + "id": "ResourceId", "type": "string", - "description": "Unique object identifier." + "description": "Unique resource identifier." + }, + { + "id": "ResourceInfo", + "type": "object", + "properties": [ + { "name": "id", "$ref": "ResourceId" }, + { "name": "description", "type": "string" } + ] + }, + { + "id": "ResourceState", + "type": "object", + "properties": [ + { "name": "id", "$ref": "ResourceId" }, + { "name": "traceLogId", "$ref": "TraceLogId" }, + { "name": "imageURL", "type": "string", "optional": true, "description": "Screenshot image data URL." } + ] + }, + { + "id": "CallArgument", + "type": "object", + "properties": [ + { "name": "description", "type": "string" } + ] }, { "id": "Call", "type": "object", "properties": [ + { "name": "contextId", "$ref": "ResourceId" }, { "name": "functionName", "type": "string", "optional": true }, - { "name": "arguments", "type": "array", "items": { "type": "string" }, "optional": true }, + { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument" }, "optional": true }, + { "name": "result", "$ref": "CallArgument", "optional": true }, + { "name": "isDrawingCall", "type": "boolean", "optional": true }, { "name": "property", "type": "string", "optional": true }, - { "name": "value", "type": "string", "optional": true }, - { "name": "result", "type": "string", "optional": true }, + { "name": "value", "$ref": "CallArgument", "optional": true }, { "name": "sourceURL", "type": "string", "optional": true }, { "name": "lineNumber", "type": "integer", "optional": true }, { "name": "columnNumber", "type": "integer", "optional": true } ] }, + { + "id": "TraceLogId", + "type": "string", + "description": "Unique trace log identifier." + }, { "id": "TraceLog", "type": "object", "properties": [ { "name": "id", "$ref": "TraceLogId" }, - { "name": "calls", "type": "array", "items": { "$ref": "Call" } } + { "name": "calls", "type": "array", "items": { "$ref": "Call" } }, + { "name": "startOffset", "type": "integer" }, + { "name": "alive", "type": "boolean" }, + { "name": "totalAvailableCalls", "type": "number" } ] } ], @@ -3183,16 +3436,45 @@ { "name": "traceLogId", "$ref": "TraceLogId" } ] }, + { + "name": "hasUninstrumentedCanvases", + "returns": [ + { "name": "result", "type": "boolean" } + ], + "description": "Checks if there is any uninstrumented canvas in the inspected page." + }, { "name": "captureFrame", + "parameters": [ + { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "Identifier of the frame containing document whose canvases are to be captured. If omitted, main frame is assumed." } + ], + "returns": [ + { "name": "traceLogId", "$ref": "TraceLogId", "description": "Identifier of the trace log containing captured canvas calls." } + ], + "description": "Starts (or continues) a canvas frame capturing which will be stopped automatically after the next frame is prepared." + }, + { + "name": "startCapturing", + "parameters": [ + { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "Identifier of the frame containing document whose canvases are to be captured. If omitted, main frame is assumed." } + ], "returns": [ + { "name": "traceLogId", "$ref": "TraceLogId", "description": "Identifier of the trace log containing captured canvas calls." } + ], + "description": "Starts (or continues) consecutive canvas frames capturing. The capturing is stopped by the corresponding stopCapturing command." + }, + { + "name": "stopCapturing", + "parameters": [ { "name": "traceLogId", "$ref": "TraceLogId" } ] }, { "name": "getTraceLog", "parameters": [ - { "name": "traceLogId", "$ref": "TraceLogId" } + { "name": "traceLogId", "$ref": "TraceLogId" }, + { "name": "startOffset", "type": "integer", "optional": true }, + { "name": "maxLength", "type": "integer", "optional": true } ], "returns": [ { "name": "traceLog", "$ref": "TraceLog" } @@ -3205,10 +3487,152 @@ { "name": "stepNo", "type": "integer" } ], "returns": [ - { "name": "screenshotDataUrl", "type": "string" } + { "name": "resourceState", "$ref": "ResourceState" } + ] + }, + { + "name": "getResourceInfo", + "parameters": [ + { "name": "resourceId", "$ref": "ResourceId" } + ], + "returns": [ + { "name": "resourceInfo", "$ref": "ResourceInfo" } + ] + }, + { + "name": "getResourceState", + "parameters": [ + { "name": "traceLogId", "$ref": "TraceLogId" }, + { "name": "resourceId", "$ref": "ResourceId" } + ], + "returns": [ + { "name": "resourceState", "$ref": "ResourceState" } ] } ], + "events": [ + { + "name": "contextCreated", + "parameters": [ + { "name": "frameId", "$ref": "Network.FrameId", "description": "Identifier of the frame containing a canvas with a context." } + ], + "description": "Fired when a canvas context has been created in the given frame. The context may not be instrumented (see hasUninstrumentedCanvases command)." + }, + { + "name": "traceLogsRemoved", + "parameters": [ + { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "If given, trace logs from the given frame were removed." }, + { "name": "traceLogId", "$ref": "TraceLogId", "optional": true, "description": "If given, trace log with the given ID was removed." } + ], + "description": "Fired when a set of trace logs were removed from the backend. If no parameters are given, all trace logs were removed." + } + ] + }, + { + "domain": "Input", + "hidden": true, + "types": [], + "commands": [ + { + "name": "dispatchKeyEvent", + "parameters": [ + { "name": "type", "type": "string", "enum": ["keyDown", "keyUp", "rawKeyDown", "char"], "description": "Type of the key event." }, + { "name": "modifiers", "type": "integer", "optional": true, "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0)." }, + { "name": "timestamp", "type": "number", "optional": true, "description": "Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time)." }, + { "name": "text", "type": "string", "optional": true, "description": "Text as generated by processing a virtual key code with a keyboard layout. Not needed for for keyUp and rawKeyDown events (default: \"\")" }, + { "name": "unmodifiedText", "type": "string", "optional": true, "description": "Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: \"\")." }, + { "name": "keyIdentifier", "type": "string", "optional": true, "description": "Unique key identifier (e.g., 'U+0041') (default: \"\")." }, + { "name": "windowsVirtualKeyCode", "type": "integer", "optional": true, "description": "Windows virtual key code (default: 0)." }, + { "name": "nativeVirtualKeyCode", "type": "integer", "optional": true, "description": "Native virtual key code (default: 0)." }, + { "name": "macCharCode", "type": "integer", "optional": true, "description": "Mac character code (default: 0)." }, + { "name": "autoRepeat", "type": "boolean", "optional": true, "description": "Whether the event was generated from auto repeat (default: false)." }, + { "name": "isKeypad", "type": "boolean", "optional": true, "description": "Whether the event was generated from the keypad (default: false)." }, + { "name": "isSystemKey", "type": "boolean", "optional": true, "description": "Whether the event was a system key event (default: false)." } + ], + "description": "Dispatches a key event to the page." + }, + { + "name": "dispatchMouseEvent", + "parameters": [ + { "name": "type", "type": "string", "enum": ["mousePressed", "mouseReleased", "mouseMoved"], "description": "Type of the mouse event." }, + { "name": "x", "type": "integer", "description": "X coordinate of the event relative to the main frame's viewport."}, + { "name": "y", "type": "integer", "description": "Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport."}, + { "name": "modifiers", "type": "integer", "optional": true, "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0)." }, + { "name": "timestamp", "type": "number", "optional": true, "description": "Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time)." }, + { "name": "button", "type": "string", "enum": ["none", "left", "middle", "right"], "optional": true, "description": "Mouse button (default: \"none\")." }, + { "name": "clickCount", "type": "integer", "optional": true, "description": "Number of times the mouse button was clicked (default: 0)." } + ], + "description": "Dispatches a mouse event to the page." + } + ], "events": [] + }, + { + "domain": "LayerTree", + "hidden": true, + "types": [ + { + "id": "LayerId", + "type": "string", + "description": "Unique RenderLayer identifier." + }, + { + "id": "IntRect", + "type": "object", + "description": "A rectangle.", + "properties": [ + { "name": "x", "type": "integer", "description": "The x position." }, + { "name": "y", "type": "integer", "description": "The y position." }, + { "name": "width", "type": "integer", "description": "The width metric." }, + { "name": "height", "type": "integer", "description": "The height metric." } + ] + }, + { + "id": "Layer", + "type": "object", + "description": "Information about a compositing layer.", + "properties": [ + { "name": "layerId", "$ref": "LayerId", "description": "The unique id for this layer." }, + { "name": "bounds", "$ref": "IntRect", "description": "Bounds of the layer." }, + { "name": "isComposited", "type": "boolean", "description": "Indicates whether this layer is composited." }, + { "name": "paintCount", "type": "integer", "optional": true, "description": "Indicates how many time this layer has painted." }, + { "name": "memory", "type": "integer", "optional": true, "description": "Estimated memory used by this layer." }, + { "name": "compositedBounds", "$ref": "IntRect", "optional": true, "description": "The bounds of the composited layer." }, + { "name": "childLayers", "type": "array", "optional": true, "items": { "$ref": "Layer" }, "description": "Child layers." } + ] + } + ], + "commands": [ + { + "name": "enable", + "description": "Enables compositing tree inspection." + }, + { + "name": "disable", + "description": "Disables compositing tree inspection." + }, + { + "name": "getLayerTree", + "description": "Returns the layer tree structure of the current page.", + "returns": [ + { "name": "layerTree", "$ref": "Layer", "description": "Layer tree structure of the current page." } + ] + }, + { + "name": "nodeIdForLayerId", + "description": "Returns the node id for a given layer id.", + "parameters": [ + { "name": "layerId", "$ref": "LayerId" } + ], + "returns": [ + { "name": "nodeId", "$ref": "DOM.NodeId", "description": "The node id for the given layer id." } + ] + } + ], + "events": [ + { + "name": "layerTreeDidChange" + } + ] }] } diff --git a/src/LiveDevelopment/Inspector/inspector.html b/src/LiveDevelopment/Inspector/inspector.html index 62e662b2c8e..c7036efa9e2 100644 --- a/src/LiveDevelopment/Inspector/inspector.html +++ b/src/LiveDevelopment/Inspector/inspector.html @@ -65,7 +65,9 @@
  • Debugger
  • FileSystem
  • IndexedDB
  • +
  • Input
  • Inspector
  • +
  • LayerTree
  • Memory
  • Network
  • Page
  • @@ -160,8 +162,12 @@

    CSS

    Canvas

    Type Command @@ -169,9 +175,19 @@

    Canvas

  • Canvas.enable: Enables Canvas inspection.
  • Canvas.disable: Disables Canvas inspection.
  • Canvas.dropTraceLog
  • -
  • Canvas.captureFrame
  • +
  • Canvas.hasUninstrumentedCanvases: Checks if there is any uninstrumented canvas in the inspected page.
  • +
  • Canvas.captureFrame: Starts (or continues) a canvas frame capturing which will be stopped automatically after the next frame is prepared.
  • +
  • Canvas.startCapturing: Starts (or continues) consecutive canvas frames capturing. The capturing is stopped by the corresponding stopCapturing command.
  • +
  • Canvas.stopCapturing
  • Canvas.getTraceLog
  • Canvas.replayTraceLog
  • +
  • Canvas.getResourceInfo
  • +
  • Canvas.getResourceState
  • + +Event +

    Console

    Type @@ -207,7 +223,7 @@

    DOM

    Command Event Event +

    Input

    +Command +

    Inspector

    Command +

    LayerTree

    +Type + +Command + +Event +

    Memory

    Type Command +Event +

    Network

    Type Event

    Profiler

    Type Command @@ -527,7 +594,8 @@

    Profiler

  • Profiler.start
  • Profiler.stop
  • Profiler.getProfileHeaders
  • -
  • Profiler.getProfile
  • +
  • Profiler.getCPUProfile
  • +
  • Profiler.getHeapSnapshot
  • Profiler.removeProfile
  • Profiler.clearProfiles
  • Profiler.takeHeapSnapshot
  • @@ -1511,8 +1579,12 @@

    Canvas

    Type Command @@ -1520,30 +1592,71 @@

    Canvas

  • Canvas.enable: Enables Canvas inspection.
  • Canvas.disable: Disables Canvas inspection.
  • Canvas.dropTraceLog
  • -
  • Canvas.captureFrame
  • +
  • Canvas.hasUninstrumentedCanvases: Checks if there is any uninstrumented canvas in the inspected page.
  • +
  • Canvas.captureFrame: Starts (or continues) a canvas frame capturing which will be stopped automatically after the next frame is prepared.
  • +
  • Canvas.startCapturing: Starts (or continues) consecutive canvas frames capturing. The capturing is stopped by the corresponding stopCapturing command.
  • +
  • Canvas.stopCapturing
  • Canvas.getTraceLog
  • Canvas.replayTraceLog
  • +
  • Canvas.getResourceInfo
  • +
  • Canvas.getResourceState
  • -
    -

    Canvas.TraceLogId Type

    -

    Unique object identifier.

    +Event + +
    +

    Canvas.ResourceId Type

    +

    Unique resource identifier.

    +
    +
    String
    +
    +
    +
    +

    Canvas.ResourceInfo Type

    +
    +
    id
    +
    Canvas.ResourceId
    +
    description
    +
    String
    +
    +
    +
    +

    Canvas.ResourceState Type

    +
    +
    id
    +
    Canvas.ResourceId
    +
    traceLogId
    +
    Canvas.TraceLogId
    +
    imageURL (optional)
    +
    String Screenshot image data URL.
    +
    +
    +
    +

    Canvas.CallArgument Type

    +
    description
    String

    Canvas.Call Type

    +
    contextId
    +
    Canvas.ResourceId
    functionName (optional)
    String
    arguments (optional)
    -
    [String]
    +
    [Canvas.CallArgument]
    +
    result (optional)
    +
    Canvas.CallArgument
    +
    isDrawingCall (optional)
    +
    Boolean
    property (optional)
    String
    value (optional)
    -
    String
    -
    result (optional)
    -
    String
    +
    Canvas.CallArgument
    sourceURL (optional)
    String
    lineNumber (optional)
    @@ -1552,6 +1665,13 @@

    Canvas.Call Type

    Integer
    +
    +

    Canvas.TraceLogId Type

    +

    Unique trace log identifier.

    +
    +
    String
    +
    +

    Canvas.TraceLog Type

    @@ -1559,6 +1679,12 @@

    Canvas.TraceLog Type

    Canvas.TraceLogId
    calls
    [Canvas.Call]
    +
    startOffset
    +
    Integer
    +
    alive
    +
    Boolean
    +
    totalAvailableCalls
    +
    Number
    @@ -1591,26 +1717,83 @@

    Code Example:

    Canvas.dropTraceLog(traceLogId);
    +
    +

    Canvas.hasUninstrumentedCanvases Command

    +

    Checks if there is any uninstrumented canvas in the inspected page.

    +

    Callback Parameters:

    +
    +
    result
    +
    Boolean
    +
    +

    Code Example:

    +
    +// WebInspector Command: Canvas.hasUninstrumentedCanvases
    +Canvas.hasUninstrumentedCanvases(function callback(res) {
    +	// res = {result}
    +});
    +
    +

    Canvas.captureFrame Command

    +

    Starts (or continues) a canvas frame capturing which will be stopped automatically after the next frame is prepared.

    +
    +
    frameId (optional)
    +
    Network.FrameId Identifier of the frame containing document whose canvases are to be captured. If omitted, main frame is assumed.
    +

    Callback Parameters:

    traceLogId
    -
    Canvas.TraceLogId
    +
    Canvas.TraceLogId Identifier of the trace log containing captured canvas calls.

    Code Example:

     // WebInspector Command: Canvas.captureFrame
    -Canvas.captureFrame(function callback(res) {
    +Canvas.captureFrame(frameId, function callback(res) {
     	// res = {traceLogId}
     });
     
    +
    +

    Canvas.startCapturing Command

    +

    Starts (or continues) consecutive canvas frames capturing. The capturing is stopped by the corresponding stopCapturing command.

    +
    +
    frameId (optional)
    +
    Network.FrameId Identifier of the frame containing document whose canvases are to be captured. If omitted, main frame is assumed.
    +
    +

    Callback Parameters:

    +
    +
    traceLogId
    +
    Canvas.TraceLogId Identifier of the trace log containing captured canvas calls.
    +
    +

    Code Example:

    +
    +// WebInspector Command: Canvas.startCapturing
    +Canvas.startCapturing(frameId, function callback(res) {
    +	// res = {traceLogId}
    +});
    +
    +
    +
    +

    Canvas.stopCapturing Command

    +
    +
    traceLogId
    +
    Canvas.TraceLogId
    +
    +

    Code Example:

    +
    +// WebInspector Command: Canvas.stopCapturing
    +Canvas.stopCapturing(traceLogId);
    +
    +

    Canvas.getTraceLog Command

    traceLogId
    Canvas.TraceLogId
    +
    startOffset (optional)
    +
    Integer
    +
    maxLength (optional)
    +
    Integer

    Callback Parameters:

    @@ -1620,7 +1803,7 @@

    Callback Parameters:

    Code Example:

     // WebInspector Command: Canvas.getTraceLog
    -Canvas.getTraceLog(traceLogId, function callback(res) {
    +Canvas.getTraceLog(traceLogId, startOffset, maxLength, function callback(res) {
     	// res = {traceLog}
     });
     
    @@ -1635,17 +1818,89 @@

    Canvas.replayTraceLog Command

    Callback Parameters:

    -
    screenshotDataUrl
    -
    String
    +
    resourceState
    +
    Canvas.ResourceState

    Code Example:

     // WebInspector Command: Canvas.replayTraceLog
     Canvas.replayTraceLog(traceLogId, stepNo, function callback(res) {
    -	// res = {screenshotDataUrl}
    +	// res = {resourceState}
     });
     
    +
    +

    Canvas.getResourceInfo Command

    +
    +
    resourceId
    +
    Canvas.ResourceId
    +
    +

    Callback Parameters:

    +
    +
    resourceInfo
    +
    Canvas.ResourceInfo
    +
    +

    Code Example:

    +
    +// WebInspector Command: Canvas.getResourceInfo
    +Canvas.getResourceInfo(resourceId, function callback(res) {
    +	// res = {resourceInfo}
    +});
    +
    +
    +
    +

    Canvas.getResourceState Command

    +
    +
    traceLogId
    +
    Canvas.TraceLogId
    +
    resourceId
    +
    Canvas.ResourceId
    +
    +

    Callback Parameters:

    +
    +
    resourceState
    +
    Canvas.ResourceState
    +
    +

    Code Example:

    +
    +// WebInspector Command: Canvas.getResourceState
    +Canvas.getResourceState(traceLogId, resourceId, function callback(res) {
    +	// res = {resourceState}
    +});
    +
    +
    +
    +

    Canvas.contextCreated Event

    +

    Fired when a canvas context has been created in the given frame. The context may not be instrumented (see hasUninstrumentedCanvases command).

    +
    +
    frameId
    +
    Network.FrameId Identifier of the frame containing a canvas with a context.
    +
    +

    Code Example:

    +
    +// WebInspector Event: Canvas.contextCreated
    +function onContextCreated(res) {
    +	// res = {frameId}
    +}
    +
    +
    +
    +

    Canvas.traceLogsRemoved Event

    +

    Fired when a set of trace logs were removed from the backend. If no parameters are given, all trace logs were removed.

    +
    +
    frameId (optional)
    +
    Network.FrameId If given, trace logs from the given frame were removed.
    +
    traceLogId (optional)
    +
    Canvas.TraceLogId If given, trace log with the given ID was removed.
    +
    +

    Code Example:

    +
    +// WebInspector Event: Canvas.traceLogsRemoved
    +function onTraceLogsRemoved(res) {
    +	// res = {frameId, traceLogId}
    +}
    +
    +

    Console

    @@ -1682,7 +1937,7 @@

    Console.ConsoleMessage Type

    text
    String Message text.
    type (optional)
    -
    ( log | dir | dirxml | trace | startGroup | startGroupCollapsed | endGroup | assert ) Console message type.
    +
    ( log | dir | dirxml | trace | clear | startGroup | startGroupCollapsed | endGroup | assert | timing ) Console message type.
    url (optional)
    String URL of the message origin.
    line (optional)
    @@ -1839,7 +2094,7 @@

    DOM

    Command Event
    @@ -1999,15 +2259,17 @@

    Code Example:

    DOM.requestChildNodes Command

    -

    Requests that children of the node with given id are returned to the caller in form of setChildNodes events.

    +

    Requests that children of the node with given id are returned to the caller in form of setChildNodes events where not only immediate children are retrieved, but all children down to the specified depth.

    nodeId
    DOM.NodeId Id of the node to get children for.
    +
    depth (optional)
    +
    Integer The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.

    Code Example:

     // WebInspector Command: DOM.requestChildNodes
    -DOM.requestChildNodes(nodeId);
    +DOM.requestChildNodes(nodeId, depth);
     
    @@ -2327,17 +2589,19 @@

    Code Example:

    DOM.highlightNode Command

    -

    Highlights DOM node with given id.

    +

    Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.

    -
    nodeId
    -
    DOM.NodeId Identifier of the node to highlight.
    highlightConfig
    DOM.HighlightConfig A descriptor for the highlight appearance.
    +
    nodeId (optional)
    +
    DOM.NodeId Identifier of the node to highlight.
    +
    objectId (optional)
    +
    Runtime.RemoteObjectId JavaScript object id of the node to be highlighted.

    Code Example:

     // WebInspector Command: DOM.highlightNode
    -DOM.highlightNode(nodeId, highlightConfig);
    +DOM.highlightNode(highlightConfig, nodeId, objectId);
     
    @@ -2479,6 +2743,19 @@

    Code Example:

    DOM.markUndoableState();
    +
    +

    DOM.focus Command

    +

    Focuses the given element.

    +
    +
    nodeId
    +
    DOM.NodeId Id of the node to focus.
    +
    +

    Code Example:

    +
    +// WebInspector Command: DOM.focus
    +DOM.focus(nodeId);
    +
    +

    DOM.documentUpdated Event

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

    @@ -2817,7 +3094,10 @@

    DOMStorage

    Event

    DOMStorage.StorageId Type

    @@ -2940,20 +3220,74 @@

    Code Example:

    }
    -
    -

    DOMStorage.domStorageUpdated Event

    +
    +

    DOMStorage.domStorageItemsCleared Event

    storageId
    DOMStorage.StorageId

    Code Example:

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

    DOMStorage.domStorageItemRemoved Event

    +
    +
    storageId
    +
    DOMStorage.StorageId
    +
    key
    +
    String
    +
    +

    Code Example:

    +
    +// WebInspector Event: DOMStorage.domStorageItemRemoved
    +function onDomStorageItemRemoved(res) {
    +	// res = {storageId, key}
    +}
    +
    +
    +
    +

    DOMStorage.domStorageItemAdded Event

    +
    +
    storageId
    +
    DOMStorage.StorageId
    +
    key
    +
    String
    +
    newValue
    +
    String
    +
    +

    Code Example:

    +
    +// WebInspector Event: DOMStorage.domStorageItemAdded
    +function onDomStorageItemAdded(res) {
    +	// res = {storageId, key, newValue}
    +}
    +
    +
    +
    +

    DOMStorage.domStorageItemUpdated Event

    +
    +
    storageId
    +
    DOMStorage.StorageId
    +
    key
    +
    String
    +
    oldValue
    +
    String
    +
    newValue
    +
    String
    +
    +

    Code Example:

    +
    +// WebInspector Event: DOMStorage.domStorageItemUpdated
    +function onDomStorageItemUpdated(res) {
    +	// res = {storageId, key, oldValue, newValue}
    +}
    +
    +

    Database

    @@ -3123,6 +3457,7 @@

    Debugger

  • Debugger.compileScript: Compiles expression.
  • Debugger.runScript: Runs script with given id in a given context.
  • Debugger.setOverlayMessage: Sets overlay message.
  • +
  • Debugger.setVariableValue: Changes value of variable in a callframe or a closure. Either callframe or function must be specified. Object-based scopes are not supported and must be mutated manually.
  • Event
      @@ -3638,6 +3973,27 @@

      Code Example:

      Debugger.setOverlayMessage(message);
    +
    +

    Debugger.setVariableValue Command

    +

    Changes value of variable in a callframe or a closure. Either callframe or function must be specified. Object-based scopes are not supported and must be mutated manually.

    +
    +
    callFrameId (optional)
    +
    Debugger.CallFrameId Id of callframe that holds variable.
    +
    functionObjectId (optional)
    +
    Runtime.RemoteObjectId Object id of closure (function) that holds variable.
    +
    scopeNumber
    +
    Integer 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
    +
    variableName
    +
    String Variable name.
    +
    newValue
    +
    Runtime.CallArgument New variable value.
    +
    +

    Code Example:

    +
    +// WebInspector Command: Debugger.setVariableValue
    +Debugger.setVariableValue(callFrameId, functionObjectId, scopeNumber, variableName, newValue);
    +
    +

    Debugger.globalObjectCleared Event

    Called when global has been cleared and debugger client should reset its state. Happens upon navigation or reload.

    @@ -4045,9 +4401,9 @@

    IndexedDB.DataEntry Type

    Data entry.

    key
    -
    IndexedDB.Key Key.
    +
    Runtime.RemoteObject Key.
    primaryKey
    -
    IndexedDB.Key Primary key.
    +
    Runtime.RemoteObject Primary key.
    value
    Runtime.RemoteObject Value.
    @@ -4159,6 +4515,75 @@

    Code Example:

    +
    +

    Input

    +

    +Command + +
    +

    Input.dispatchKeyEvent Command

    +

    Dispatches a key event to the page.

    +
    +
    type
    +
    ( keyDown | keyUp | rawKeyDown | char ) Type of the key event.
    +
    modifiers (optional)
    +
    Integer Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
    +
    timestamp (optional)
    +
    Number Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).
    +
    text (optional)
    +
    String Text as generated by processing a virtual key code with a keyboard layout. Not needed for for keyUp and rawKeyDown events (default: "")
    +
    unmodifiedText (optional)
    +
    String Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").
    +
    keyIdentifier (optional)
    +
    String Unique key identifier (e.g., 'U+0041') (default: "").
    +
    windowsVirtualKeyCode (optional)
    +
    Integer Windows virtual key code (default: 0).
    +
    nativeVirtualKeyCode (optional)
    +
    Integer Native virtual key code (default: 0).
    +
    macCharCode (optional)
    +
    Integer Mac character code (default: 0).
    +
    autoRepeat (optional)
    +
    Boolean Whether the event was generated from auto repeat (default: false).
    +
    isKeypad (optional)
    +
    Boolean Whether the event was generated from the keypad (default: false).
    +
    isSystemKey (optional)
    +
    Boolean Whether the event was a system key event (default: false).
    +
    +

    Code Example:

    +
    +// WebInspector Command: Input.dispatchKeyEvent
    +Input.dispatchKeyEvent(type, modifiers, timestamp, text, unmodifiedText, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, macCharCode, autoRepeat, isKeypad, isSystemKey);
    +
    +
    +
    +

    Input.dispatchMouseEvent Command

    +

    Dispatches a mouse event to the page.

    +
    +
    type
    +
    ( mousePressed | mouseReleased | mouseMoved ) Type of the mouse event.
    +
    x
    +
    Integer X coordinate of the event relative to the main frame's viewport.
    +
    y
    +
    Integer Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
    +
    modifiers (optional)
    +
    Integer Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
    +
    timestamp (optional)
    +
    Number Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time).
    +
    button (optional)
    +
    ( none | left | middle | right ) Mouse button (default: "none").
    +
    clickCount (optional)
    +
    Integer Number of times the mouse button was clicked (default: 0).
    +
    +

    Code Example:

    +
    +// WebInspector Command: Input.dispatchMouseEvent
    +Input.dispatchMouseEvent(type, x, y, modifiers, timestamp, button, clickCount);
    +
    +
    +

    Inspector

    @@ -4239,6 +4664,132 @@

    Code Example:

    +
    +

    LayerTree

    +

    +Type + +Command + +Event + +
    +

    LayerTree.LayerId Type

    +

    Unique RenderLayer identifier.

    +
    +
    String
    +
    +
    +
    +

    LayerTree.IntRect Type

    +

    A rectangle.

    +
    +
    x
    +
    Integer The x position.
    +
    y
    +
    Integer The y position.
    +
    width
    +
    Integer The width metric.
    +
    height
    +
    Integer The height metric.
    +
    +
    +
    +

    LayerTree.Layer Type

    +

    Information about a compositing layer.

    +
    +
    layerId
    +
    LayerTree.LayerId The unique id for this layer.
    +
    bounds
    +
    LayerTree.IntRect Bounds of the layer.
    +
    isComposited
    +
    Boolean Indicates whether this layer is composited.
    +
    paintCount (optional)
    +
    Integer Indicates how many time this layer has painted.
    +
    memory (optional)
    +
    Integer Estimated memory used by this layer.
    +
    compositedBounds (optional)
    +
    LayerTree.IntRect The bounds of the composited layer.
    +
    childLayers (optional)
    +
    [LayerTree.Layer] Child layers.
    +
    +
    +
    +

    LayerTree.enable Command

    +

    Enables compositing tree inspection.

    +

    Code Example:

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

    LayerTree.disable Command

    +

    Disables compositing tree inspection.

    +

    Code Example:

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

    LayerTree.getLayerTree Command

    +

    Returns the layer tree structure of the current page.

    +

    Callback Parameters:

    +
    +
    layerTree
    +
    LayerTree.Layer Layer tree structure of the current page.
    +
    +

    Code Example:

    +
    +// WebInspector Command: LayerTree.getLayerTree
    +LayerTree.getLayerTree(function callback(res) {
    +	// res = {layerTree}
    +});
    +
    +
    +
    +

    LayerTree.nodeIdForLayerId Command

    +

    Returns the node id for a given layer id.

    +
    +
    layerId
    +
    LayerTree.LayerId
    +
    +

    Callback Parameters:

    +
    +
    nodeId
    +
    DOM.NodeId The node id for the given layer id.
    +
    +

    Code Example:

    +
    +// WebInspector Command: LayerTree.nodeIdForLayerId
    +LayerTree.nodeIdForLayerId(layerId, function callback(res) {
    +	// res = {nodeId}
    +});
    +
    +
    +
    +

    LayerTree.layerTreeDidChange Event

    +

    Code Example:

    +
    +// WebInspector Event: LayerTree.layerTreeDidChange
    +function onLayerTreeDidChange(res) {
    +	// res = {}
    +}
    +
    +
    +

    Memory

    @@ -4249,12 +4800,18 @@

    Memory

  • Memory.StringStatistics: Character data statistics for the page.
  • Memory.DOMGroup
  • Memory.MemoryBlock
  • +
  • Memory.HeapSnapshotChunk
  • Command +Event +

    Memory.NodeCount Type

    Number of nodes with given name.

    @@ -4313,6 +4870,19 @@

    Memory.MemoryBlock Type

    [Memory.MemoryBlock]
    +
    +

    Memory.HeapSnapshotChunk Type

    +
    +
    strings
    +
    [String] An array of strings that were found since last update.
    +
    nodes
    +
    [Integer] An array of nodes that were found since last update.
    +
    edges
    +
    [Integer] An array of edges that were found since last update.
    +
    baseToRealNodeId
    +
    [Integer] An array of integers for nodeId remapping. Even nodeId has to be mapped to the following odd nodeId.
    +
    +

    Memory.getDOMNodeCount Command

    Callback Parameters:

    @@ -4330,8 +4900,31 @@

    Code Example:

    });
    +
    +

    Memory.getDOMCounters Command

    +

    Callback Parameters:

    +
    +
    documents
    +
    Integer
    +
    nodes
    +
    Integer
    +
    jsEventListeners
    +
    Integer
    +
    +

    Code Example:

    +
    +// WebInspector Command: Memory.getDOMCounters
    +Memory.getDOMCounters(function callback(res) {
    +	// res = {documents, nodes, jsEventListeners}
    +});
    +
    +

    Memory.getProcessMemoryDistribution Command

    +
    +
    reportGraph (optional)
    +
    Boolean Whether native memory graph should be reported in addition to aggregated statistics.
    +

    Callback Parameters:

    distribution
    @@ -4340,11 +4933,25 @@

    Callback Parameters:

    Code Example:

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

    Memory.addNativeSnapshotChunk Event

    +
    +
    chunk
    +
    Memory.HeapSnapshotChunk A chunk of the serialized the snapshot.
    +
    +

    Code Example:

    +
    +// WebInspector Event: Memory.addNativeSnapshotChunk
    +function onAddNativeSnapshotChunk(res) {
    +	// res = {chunk}
    +}
    +
    +

    Network

    @@ -4477,7 +5084,7 @@

    Network.Response Type

    HTTP response data.

    url
    -
    String Response URL.
    +
    String Response URL. This URL can be different from CachedResource.url in case of redirect.
    status
    Number HTTP response status code.
    statusText
    @@ -4506,8 +5113,6 @@

    Network.Response Type

    Network.WebSocketRequest Type

    WebSocket request data.

    -
    requestKey3
    -
    String HTTP response status text.
    headers
    Network.Headers HTTP response headers.
    @@ -4522,8 +5127,6 @@

    Network.WebSocketResponse Type

    String HTTP response status text.
    headers
    Network.Headers HTTP response headers.
    -
    challengeResponse
    -
    String Challenge response.
    @@ -4543,7 +5146,7 @@

    Network.CachedResource Type

    Information about the cached resource.

    url
    -
    String Resource URL.
    +
    String Resource URL. This is the url of the original network request.
    type
    Page.ResourceType Type of this resource.
    response (optional)
    @@ -5015,7 +5618,7 @@

    Page

  • Page.reload: Reloads given page optionally ignoring the cache.
  • Page.navigate: Navigates current page to the given URL.
  • Page.getCookies: Returns all browser cookies. Depending on the backend support, will either return detailed cookie information in the cookie field or string cookie representation using cookieString.
  • -
  • Page.deleteCookie: Deletes browser cookie with given name for the given domain.
  • +
  • Page.deleteCookie: Deletes browser cookie with given name, domain and path.
  • Page.getResourceTree: Returns present frame / resource tree structure.
  • Page.getResourceContent: Returns content of the given resource.
  • Page.searchInResource: Searches for given string in resource content.
  • @@ -5024,6 +5627,12 @@

    Page

  • Page.canOverrideDeviceMetrics: Checks whether setDeviceMetricsOverride can be invoked.
  • Page.setDeviceMetricsOverride: 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.
  • Page.setShowPaintRects: Requests that backend shows paint rectangles
  • +
  • Page.canShowDebugBorders: Tells if backend supports debug borders on layers
  • +
  • Page.setShowDebugBorders: Requests that backend shows debug borders on layers
  • +
  • Page.canShowFPSCounter: Tells if backend supports a FPS counter display
  • +
  • Page.setShowFPSCounter: Requests that backend shows the FPS counter
  • +
  • Page.canContinuouslyPaint: Tells if backend supports continuous painting
  • +
  • Page.setContinuousPaintingEnabled: Requests that backend enables continuous painting
  • Page.getScriptExecutionStatus: Determines if scripts can be executed in the page.
  • Page.setScriptExecutionDisabled: Switches script execution in the page.
  • Page.setGeolocationOverride: Overrides the Geolocation Position or Error.
  • @@ -5033,8 +5642,11 @@

    Page

  • Page.clearDeviceOrientationOverride: Clears the overridden Device Orientation.
  • Page.canOverrideDeviceOrientation: Check the backend if Web Inspector can override the device orientation.
  • Page.setTouchEmulationEnabled: Toggles mouse event-based touch event emulation.
  • +
  • Page.setEmulatedMedia: Emulates the given media for CSS media queries.
  • Page.getCompositingBordersVisible: Indicates the visibility of compositing borders.
  • Page.setCompositingBordersVisible: Controls the visibility of compositing borders.
  • +
  • Page.captureScreenshot: Capture page screenshot.
  • +
  • Page.handleJavaScriptDialog: Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).
  • Event

    Page.ResourceType Type

    @@ -5192,11 +5810,13 @@

    Page.reload Command

    Boolean If true, browser cache is ignored (as if the user pressed Shift+refresh).
    scriptToEvaluateOnLoad (optional)
    String If set, the script will be injected into all frames of the inspected page after reload.
    +
    scriptPreprocessor (optional)
    +
    String Script body that should evaluate to function that will preprocess all the scripts before their compilation.

    Code Example:

     // WebInspector Command: Page.reload
    -Page.reload(ignoreCache, scriptToEvaluateOnLoad);
    +Page.reload(ignoreCache, scriptToEvaluateOnLoad, scriptPreprocessor);
     

    Page.deleteCookie Command

    -

    Deletes browser cookie with given name for the given domain.

    +

    Deletes browser cookie with given name, domain and path.

    cookieName
    String Name of the cookie to remove.
    -
    domain
    -
    String Domain of the cookie to remove.
    +
    url
    +
    String URL to match cooke domain and path.

    Code Example:

     // WebInspector Command: Page.deleteCookie
    -Page.deleteCookie(cookieName, domain);
    +Page.deleteCookie(cookieName, url);
     
    @@ -5400,6 +6020,93 @@

    Code Example:

    Page.setShowPaintRects(result);
    +
    +

    Page.canShowDebugBorders Command

    +

    Tells if backend supports debug borders on layers

    +

    Callback Parameters:

    +
    +
    show
    +
    Boolean True if the debug borders can be shown
    +
    +

    Code Example:

    +
    +// WebInspector Command: Page.canShowDebugBorders
    +Page.canShowDebugBorders(function callback(res) {
    +	// res = {show}
    +});
    +
    +
    +
    +

    Page.setShowDebugBorders Command

    +

    Requests that backend shows debug borders on layers

    +
    +
    show
    +
    Boolean True for showing debug borders
    +
    +

    Code Example:

    +
    +// WebInspector Command: Page.setShowDebugBorders
    +Page.setShowDebugBorders(show);
    +
    +
    +
    +

    Page.canShowFPSCounter Command

    +

    Tells if backend supports a FPS counter display

    +

    Callback Parameters:

    +
    +
    show
    +
    Boolean True if the FPS count can be shown
    +
    +

    Code Example:

    +
    +// WebInspector Command: Page.canShowFPSCounter
    +Page.canShowFPSCounter(function callback(res) {
    +	// res = {show}
    +});
    +
    +
    +
    +

    Page.setShowFPSCounter Command

    +

    Requests that backend shows the FPS counter

    +
    +
    show
    +
    Boolean True for showing the FPS counter
    +
    +

    Code Example:

    +
    +// WebInspector Command: Page.setShowFPSCounter
    +Page.setShowFPSCounter(show);
    +
    +
    +
    +

    Page.canContinuouslyPaint Command

    +

    Tells if backend supports continuous painting

    +

    Callback Parameters:

    +
    +
    value
    +
    Boolean True if continuous painting is available
    +
    +

    Code Example:

    +
    +// WebInspector Command: Page.canContinuouslyPaint
    +Page.canContinuouslyPaint(function callback(res) {
    +	// res = {value}
    +});
    +
    +
    +
    +

    Page.setContinuousPaintingEnabled Command

    +

    Requests that backend enables continuous painting

    +
    +
    enabled
    +
    Boolean True for enabling cointinuous painting
    +
    +

    Code Example:

    +
    +// WebInspector Command: Page.setContinuousPaintingEnabled
    +Page.setContinuousPaintingEnabled(enabled);
    +
    +

    Page.getScriptExecutionStatus Command

    Determines if scripts can be executed in the page.

    @@ -5526,6 +6233,19 @@

    Code Example:

    Page.setTouchEmulationEnabled(enabled);
    +
    +

    Page.setEmulatedMedia Command

    +

    Emulates the given media for CSS media queries.

    +
    +
    media
    +
    String Media type to emulate. Empty string disables the override.
    +
    +

    Code Example:

    +
    +// WebInspector Command: Page.setEmulatedMedia
    +Page.setEmulatedMedia(media);
    +
    +

    Page.getCompositingBordersVisible Command

    Indicates the visibility of compositing borders.

    @@ -5555,6 +6275,35 @@

    Code Example:

    Page.setCompositingBordersVisible(visible);
    +
    +

    Page.captureScreenshot Command

    +

    Capture page screenshot.

    +

    Callback Parameters:

    +
    +
    data
    +
    String Base64-encoded image data (PNG).
    +
    +

    Code Example:

    +
    +// WebInspector Command: Page.captureScreenshot
    +Page.captureScreenshot(function callback(res) {
    +	// res = {data}
    +});
    +
    +
    +
    +

    Page.handleJavaScriptDialog Command

    +

    Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).

    +
    +
    accept
    +
    Boolean Whether to accept or dismiss the dialog.
    +
    +

    Code Example:

    +
    +// WebInspector Command: Page.handleJavaScriptDialog
    +Page.handleJavaScriptDialog(accept);
    +
    +

    Page.domContentEventFired Event

    @@ -5613,6 +6362,94 @@

    Code Example:

    }
    +
    +

    Page.frameStartedLoading Event

    +

    Fired when frame has started loading.

    +
    +
    frameId
    +
    Network.FrameId Id of the frame that has started loading.
    +
    +

    Code Example:

    +
    +// WebInspector Event: Page.frameStartedLoading
    +function onFrameStartedLoading(res) {
    +	// res = {frameId}
    +}
    +
    +
    +
    +

    Page.frameStoppedLoading Event

    +

    Fired when frame has stopped loading.

    +
    +
    frameId
    +
    Network.FrameId Id of the frame that has stopped loading.
    +
    +

    Code Example:

    +
    +// WebInspector Event: Page.frameStoppedLoading
    +function onFrameStoppedLoading(res) {
    +	// res = {frameId}
    +}
    +
    +
    +
    +

    Page.frameScheduledNavigation Event

    +

    Fired when frame schedules a potential navigation.

    +
    +
    frameId
    +
    Network.FrameId Id of the frame that has scheduled a navigation.
    +
    delay
    +
    Number Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start.
    +
    +

    Code Example:

    +
    +// WebInspector Event: Page.frameScheduledNavigation
    +function onFrameScheduledNavigation(res) {
    +	// res = {frameId, delay}
    +}
    +
    +
    +
    +

    Page.frameClearedScheduledNavigation Event

    +

    Fired when frame no longer has a scheduled navigation.

    +
    +
    frameId
    +
    Network.FrameId Id of the frame that has cleared its scheduled navigation.
    +
    +

    Code Example:

    +
    +// WebInspector Event: Page.frameClearedScheduledNavigation
    +function onFrameClearedScheduledNavigation(res) {
    +	// res = {frameId}
    +}
    +
    +
    +
    +

    Page.javascriptDialogOpening Event

    +

    Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.

    +
    +
    message
    +
    String Message that will be displayed by the dialog.
    +
    +

    Code Example:

    +
    +// WebInspector Event: Page.javascriptDialogOpening
    +function onJavascriptDialogOpening(res) {
    +	// res = {message}
    +}
    +
    +
    +
    +

    Page.javascriptDialogClosed Event

    +

    Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.

    +

    Code Example:

    +
    +// WebInspector Event: Page.javascriptDialogClosed
    +function onJavascriptDialogClosed(res) {
    +	// res = {}
    +}
    +
    +

    Profiler

    @@ -5620,7 +6457,8 @@

    Profiler

    Type Command @@ -5633,7 +6471,8 @@

    Profiler

  • Profiler.start
  • Profiler.stop
  • Profiler.getProfileHeaders
  • -
  • Profiler.getProfile
  • +
  • Profiler.getCPUProfile
  • +
  • Profiler.getHeapSnapshot
  • Profiler.removeProfile
  • Profiler.clearProfiles
  • Profiler.takeHeapSnapshot
  • @@ -5664,14 +6503,40 @@

    Profiler.ProfileHeader Type

    Integer Last seen JS object Id.
    -
    -

    Profiler.Profile Type

    +
    +

    Profiler.CPUProfileNode Type

    +

    CPU Profile node. Holds callsite information, execution statistics and child nodes.

    +
    +
    functionName
    +
    String Function name.
    +
    url
    +
    String URL.
    +
    lineNumber
    +
    Integer Line number.
    +
    totalTime
    +
    Number Total execution time.
    +
    selfTime
    +
    Number Self time.
    +
    numberOfCalls
    +
    Integer Number of calls.
    +
    visible
    +
    Boolean Visibility.
    +
    callUID
    +
    Number Call UID.
    +
    children
    +
    [Profiler.CPUProfileNode] Child nodes.
    +
    +
    +
    +

    Profiler.CPUProfile Type

    Profile.

    head (optional)
    -
    Object
    +
    Profiler.CPUProfileNode
    bottomUpHead (optional)
    -
    Object
    +
    Profiler.CPUProfileNode
    +
    idleTime (optional)
    +
    Number
    @@ -5773,27 +6638,37 @@

    Code Example:

    });
    -
    -

    Profiler.getProfile Command

    +
    +

    Profiler.getCPUProfile Command

    -
    type
    -
    String
    uid
    Integer

    Callback Parameters:

    profile
    -
    Profiler.Profile
    +
    Profiler.CPUProfile

    Code Example:

    -// WebInspector Command: Profiler.getProfile
    -Profiler.getProfile(type, uid, function callback(res) {
    +// WebInspector Command: Profiler.getCPUProfile
    +Profiler.getCPUProfile(uid, function callback(res) {
     	// res = {profile}
     });
     
    +
    +

    Profiler.getHeapSnapshot Command

    +
    +
    uid
    +
    Integer
    +
    +

    Code Example:

    +
    +// WebInspector Command: Profiler.getHeapSnapshot
    +Profiler.getHeapSnapshot(uid);
    +
    +

    Profiler.removeProfile Command

    @@ -5818,10 +6693,14 @@

    Code Example:

    Profiler.takeHeapSnapshot Command

    +
    +
    reportProgress (optional)
    +
    Boolean If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
    +

    Code Example:

     // WebInspector Command: Profiler.takeHeapSnapshot
    -Profiler.takeHeapSnapshot();
    +Profiler.takeHeapSnapshot(reportProgress);
     
    @@ -6523,7 +7402,7 @@

    Code Example: