Classes
Methods
(async) run(js) → {Promise.<*>}
Executes a JavaScript script.
Parameters:
Name | Type | Description |
---|---|---|
js | string | The JavaScript code to execute. |
Throws:
- Throws an error if the JavaScript cannot be executed.
- Type
- Error
Returns:
A promise that resolves with the result of the executed script.
- Type:
- Promise.<*>
(async) runAndWait(js) → {Promise.<*>}
Executes a JavaScript script and waits for the page complete check to finish.
Parameters:
Name | Type | Description |
---|---|---|
js | string | The JavaScript code to execute. |
Throws:
- Throws an error if the JavaScript cannot be executed.
- Type
- Error
Returns:
A promise that resolves with the result of the executed script and the completion of the page load.
- Type:
- Promise.<*>
(async) runPrivileged(js) → {Promise.<*>}
Executes synchronous privileged JavaScript.
Parameters:
Name | Type | Description |
---|---|---|
js | string | The privileged JavaScript code to execute. |
Throws:
- Throws an error if the privileged JavaScript cannot be executed.
- Type
- Error
Returns:
A promise that resolves with the result of the executed privileged script.
- Type:
- Promise.<*>
(async) runPrivilegedAndWait(js) → {Promise.<*>}
Executes synchronous privileged JavaScript and waits for the page complete check to finish.
Parameters:
Name | Type | Description |
---|---|---|
js | string | The privileged JavaScript code to execute. |
Throws:
- Throws an error if the privileged JavaScript cannot be executed.
- Type
- Error
Returns:
A promise that resolves with the result of the executed privileged script and the completion of the page load.
- Type:
- Promise.<*>
(async) runPrivilegedAsync(js) → {Promise.<*>}
Executes asynchronous privileged JavaScript.
Parameters:
Name | Type | Description |
---|---|---|
js | string | The asynchronous privileged JavaScript code to execute. |
Throws:
- Throws an error if the asynchronous privileged JavaScript cannot be executed.
- Type
- Error
Returns:
A promise that resolves with the result of the executed asynchronous privileged script.
- Type:
- Promise.<*>