mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat(webworker): expose WebWorker.client (#10042)
Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
This commit is contained in:
parent
28154eff6f
commit
c12512822a
@ -36,6 +36,12 @@ for (const worker of page.workers()) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Property | Modifiers | Type | Description |
|
||||||
|
| -------- | --------------------- | --------------------------------------- | ------------------------------------------------ |
|
||||||
|
| client | <code>readonly</code> | [CDPSession](./puppeteer.cdpsession.md) | The CDP session client the WebWorker belongs to. |
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Method | Modifiers | Description |
|
| Method | Modifiers | Description |
|
||||||
|
@ -122,6 +122,13 @@ export class WebWorker extends EventEmitter {
|
|||||||
return this.#url;
|
return this.#url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The CDP session client the WebWorker belongs to.
|
||||||
|
*/
|
||||||
|
get client(): CDPSession {
|
||||||
|
return this.#client;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the function passed to the `worker.evaluate` returns a Promise, then
|
* If the function passed to the `worker.evaluate` returns a Promise, then
|
||||||
* `worker.evaluate` would wait for the promise to resolve and return its
|
* `worker.evaluate` would wait for the promise to resolve and return its
|
||||||
|
Loading…
Reference in New Issue
Block a user