Chrome DevTools

draft-0.1: 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>,
"result": {
  "expiredMessagesCount": <integer>
}
}

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

Returns

expiredMessagesCount
( optional integer )
Number of messages dropped due to message threashold overflow.

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.
url
( string )
JavaScript script name or url.

ConsoleMessage: object

level
( enumerated string [ "debug" , "error" , "log" , "tip" , "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 [ "console-api" , "html" , "javascript" , "network" , "other" , "wml" , "xml" ] )
Message source.
stackTrace
( optional StackTrace )
JavaScript stack trace for assertions and error messages.
text
( string )
Message text.
type
( optional enumerated string [ "assert" , "dir" , "dirxml" , "endGroup" , "log" , "startGroup" , "startGroupCollapsed" , "trace" ] )
Console message type.
url
( optional string )
URL of the message origin.

StackTrace: array of CallFrame

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.