Classes
Methods
getRawClient() → {Object}
Retrieves the raw client for the DevTools Protocol.
Throws:
- Throws an error if the browser is not supported.
- Type
- Error
Returns:
The raw DevTools Protocol client.
- Type:
- Object
Example
const cdpClient = commands.cdp.getRawClient();
(async) on(event, f)
Sets up an event listener for a specific DevTools Protocol event.
Parameters:
Name | Type | Description |
---|---|---|
event | string | The name of the event to listen for. |
f | function | The callback function to execute when the event is triggered. |
Throws:
- Throws an error if the browser is not supported or if setting the listener fails.
- Type
- Error
(async) send(command, arguments_) → {Promise.<void>}
Sends a command to the DevTools Protocol.
Parameters:
Name | Type | Description |
---|---|---|
command | string | The DevTools Protocol command to send. |
arguments_ | Object | The arguments for the command. |
Throws:
- Throws an error if the browser is not supported or if the command fails.
- Type
- Error
Returns:
A promise that resolves when the command has been sent.
- Type:
- Promise.<void>
Example
await commands.cdp.send('');
(async) sendAndGet(command, arguments_) → {Promise.<Object>}
Sends a command to the DevTools Protocol and returns the result.
Parameters:
Name | Type | Description |
---|---|---|
command | string | The DevTools Protocol command to send. |
arguments_ | Object | The arguments for the command. |
Throws:
- Throws an error if the browser is not supported or if the command fails.
- Type
- Error
Returns:
The result of the command execution.
- Type:
- Promise.<Object>
Example
const domCounters = await commands.cdp.sendAndGet('Memory.getDOMCounters');