tot: Console
Contents
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.
Commands
Console.clearMessages
request: {
"id": <number>,
"method": "Console.clearMessages"
"id": <number>,
"error": <object>
"id": <number>,
"method": "Console.clearMessages"
}
response: {"id": <number>,
"error": <object>
}
Clears console messages collected in the browser.
Notifications
Console.messageAdded
Issued when new console message is added.
Parameters
message
(
ConsoleMessage
)
Console message that has been added.
Types
CallFrame: object
columnNumber
(
integer
)
JavaScript script column number.
functionName
(
string
)
JavaScript function name.
lineNumber
(
integer
)
JavaScript script line number.
scriptId
(
string
)
JavaScript script id.
url
(
string
)
JavaScript script name or url.
ConsoleMessage: object
column
(
optional
integer
)
Column number in the resource that generated this message.
level
(
enumerated
string
[
"debug"
,
"error"
,
"log"
,
"warning"
]
)
Message severity.
line
(
optional
integer
)
Line number in the resource that generated this message.
networkRequestId
(
optional
Network.RequestId
)
Identifier of the network request associated with this message.
parameters
(
optional
array of Runtime.RemoteObject
)
Message parameters in case of the formatted message.
repeatCount
(
optional
integer
)
Repeat count for repeated messages.
source
(
enumerated
string
[
"appcache"
,
"console-api"
,
"css"
,
"deprecation"
,
"javascript"
,
"network"
,
"other"
,
"rendering"
,
"security"
,
"storage"
,
"xml"
]
)
Message source.
stackTrace
(
optional
StackTrace
)
JavaScript stack trace for assertions and error messages.
text
(
string
)
Message text.
type
(
optional
enumerated
string
[
"assert"
,
"clear"
,
"dir"
,
"dirxml"
,
"endGroup"
,
"log"
,
"profile"
,
"profileEnd"
,
"startGroup"
,
"startGroupCollapsed"
,
"table"
,
"timing"
,
"trace"
]
)
Console message type.
url
(
optional
string
)
URL of the message origin.