tot: 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.

Commands

Console.clearMessages

request: {
"id": <number>,
"method": "Console.clearMessages"
}
response: {
"id": <number>,
"error": <object>
}

Clears console messages collected in the browser.

Console.disable

request: {
"id": <number>,
"method": "Console.disable"
}
response: {
"id": <number>,
"error": <object>
}

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

Console.enable

request: {
"id": <number>,
"method": "Console.enable"
}
response: {
"id": <number>,
"error": <object>
}

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

Notifications

Console.messageAdded

{
"method": "Console.messageAdded",
"params": {
  "message": <ConsoleMessage>
}
}

Issued when new console message is added.

Parameters

message
Console message that has been added.

Console.messageRepeatCountUpdated

{
"method": "Console.messageRepeatCountUpdated",
"params": {
  "count": <integer>
}
}

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

Parameters

count
( integer )
New repeat count value.

Console.messagesCleared

{
"method": "Console.messagesCleared"
}

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

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.

StackTrace: array of CallFrame