]> git.saurik.com Git - apple/javascriptcore.git/blob - inspector/protocol/Console.json
23ad9477599da3c9a679e39c5fe309c848945d2b
[apple/javascriptcore.git] / inspector / protocol / Console.json
1 {
2 "domain": "Console",
3 "description": "Console domain defines methods and events for interaction with the JavaScript console. Console collects messages created by means of the <a href='http://getfirebug.com/wiki/index.php/Console_API'>JavaScript Console API</a>. One needs to enable this domain using <code>enable</code> 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 <code>messageAdded</code> notification upon enabling.",
4 "types": [
5 {
6 "id": "ConsoleNetworkRequestId",
7 "type": "string",
8 "description": "Unique request identifier. FIXME: Duplicate of Network.RequestId <https://webkit.org/b/125664> Web Inspector: FIX Type Dependency Issues"
9 },
10 {
11 "id": "ConsoleDOMNodeId",
12 "type": "integer",
13 "description": "Unique DOM node identifier. FIXME: Duplicate of DOM.NodeId <https://webkit.org/b/125664> Web Inspector: FIX Type Dependency Issues"
14 },
15 {
16 "id": "ConsoleMessage",
17 "type": "object",
18 "description": "Console message.",
19 "properties": [
20 { "name": "source", "type": "string", "enum": ["xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "css", "security", "other"], "description": "Message source." },
21 { "name": "level", "type": "string", "enum": ["log", "warning", "error", "debug"], "description": "Message severity." },
22 { "name": "text", "type": "string", "description": "Message text." },
23 { "name": "type", "type": "string", "optional": true, "enum": ["log", "dir", "dirxml", "table", "trace", "clear", "startGroup", "startGroupCollapsed", "endGroup", "assert", "timing", "profile", "profileEnd"], "description": "Console message type." },
24 { "name": "url", "type": "string", "optional": true, "description": "URL of the message origin." },
25 { "name": "line", "type": "integer", "optional": true, "description": "Line number in the resource that generated this message." },
26 { "name": "column", "type": "integer", "optional": true, "description": "Column number on the line in the resource that generated this message." },
27 { "name": "repeatCount", "type": "integer", "optional": true, "description": "Repeat count for repeated messages." },
28 { "name": "parameters", "type": "array", "items": { "$ref": "Runtime.RemoteObject" }, "optional": true, "description": "Message parameters in case of the formatted message." },
29 { "name": "stackTrace", "$ref": "StackTrace", "optional": true, "description": "JavaScript stack trace for assertions and error messages." },
30 { "name": "networkRequestId", "$ref": "ConsoleNetworkRequestId", "optional": true, "description": "Identifier of the network request associated with this message." }
31 ]
32 },
33 {
34 "id": "CallFrame",
35 "type": "object",
36 "description": "Stack entry for console errors and assertions.",
37 "properties": [
38 { "name": "functionName", "type": "string", "description": "JavaScript function name." },
39 { "name": "url", "type": "string", "description": "JavaScript script name or url." },
40 { "name": "lineNumber", "type": "integer", "description": "JavaScript script line number." },
41 { "name": "columnNumber", "type": "integer", "description": "JavaScript script column number." }
42 ]
43 },
44 {
45 "id": "StackTrace",
46 "type": "array",
47 "items": { "$ref": "CallFrame" },
48 "description": "Call frames for assertions or error messages."
49 }
50 ],
51 "commands": [
52 {
53 "name": "enable",
54 "description": "Enables console domain, sends the messages collected so far to the client by means of the <code>messageAdded</code> notification."
55 },
56 {
57 "name": "disable",
58 "description": "Disables console domain, prevents further console messages from being reported to the client."
59 },
60 {
61 "name": "clearMessages",
62 "description": "Clears console messages collected in the browser."
63 },
64 {
65 "name": "setMonitoringXHREnabled",
66 "parameters": [
67 { "name": "enabled", "type": "boolean", "description": "Monitoring enabled state." }
68 ],
69 "description": "Toggles monitoring of XMLHttpRequest. If <code>true</code>, console will receive messages upon each XHR issued."
70 },
71 {
72 "name": "addInspectedNode",
73 "parameters": [
74 { "name": "nodeId", "$ref": "ConsoleDOMNodeId", "description": "DOM node id to be accessible by means of $x command line API." }
75 ],
76 "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions)."
77 }
78 ],
79 "events": [
80 {
81 "name": "messageAdded",
82 "parameters": [
83 { "name": "message", "$ref": "ConsoleMessage", "description": "Console message that has been added." }
84 ],
85 "description": "Issued when new console message is added."
86 },
87 {
88 "name": "messageRepeatCountUpdated",
89 "parameters": [
90 { "name": "count", "type": "integer", "description": "New repeat count value." }
91 ],
92 "description": "Issued when subsequent message(s) are equal to the previous one(s)."
93 },
94 {
95 "name": "messagesCleared",
96 "description": "Issued when console is cleared. This happens either upon <code>clearMessages</code> command or after page navigation."
97 }
98 ]
99 }