Back to Puppeteer

ConsoleMessage class

website/versioned_docs/version-24.40.0/api/puppeteer.consolemessage.md

19.2.21.3 KB
Original Source

ConsoleMessage class

ConsoleMessage objects are dispatched by page via the 'console' event.

Signature

typescript
export declare class ConsoleMessage

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ConsoleMessage class.

Methods

<table><thead><tr><th>

Method

</th><th>

Modifiers

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

<span id="args">args()</span>

</td><td> </td><td>

An array of arguments passed to the console.

</td></tr> <tr><td>

<span id="location">location()</span>

</td><td> </td><td>

The location of the console message.

</td></tr> <tr><td>

<span id="stacktrace">stackTrace()</span>

</td><td> </td><td>

The array of locations on the stack of the console message.

</td></tr> <tr><td>

<span id="text">text()</span>

</td><td> </td><td>

The text of the console message.

</td></tr> <tr><td>

<span id="type">type()</span>

</td><td> </td><td>

The type of the console message.

</td></tr> </tbody></table>