mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: increase the default protocol timeout (#9928)
This commit is contained in:
parent
c4e1675589
commit
4465f4bd19
@ -18,6 +18,6 @@ export interface BrowserConnectOptions
|
||||
| ---------------------------------------------------------------------------- | --------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------- |
|
||||
| [defaultViewport?](./puppeteer.browserconnectoptions.defaultviewport.md) | | [Viewport](./puppeteer.viewport.md) \| null | _(Optional)_ Sets the viewport for each page. | |
|
||||
| [ignoreHTTPSErrors?](./puppeteer.browserconnectoptions.ignorehttpserrors.md) | | boolean | _(Optional)_ Whether to ignore HTTPS errors during navigation. | false |
|
||||
| [protocolTimeout?](./puppeteer.browserconnectoptions.protocoltimeout.md) | | number | _(Optional)_ Timeout setting for individual protocol (CDP) calls. | 30000 |
|
||||
| [protocolTimeout?](./puppeteer.browserconnectoptions.protocoltimeout.md) | | number | _(Optional)_ Timeout setting for individual protocol (CDP) calls. | 180000 |
|
||||
| [slowMo?](./puppeteer.browserconnectoptions.slowmo.md) | | number | _(Optional)_ Slows down Puppeteer operations by the specified amount of milliseconds to aid debugging. | |
|
||||
| [targetFilter?](./puppeteer.browserconnectoptions.targetfilter.md) | | [TargetFilterCallback](./puppeteer.targetfiltercallback.md) | _(Optional)_ Callback to decide if Puppeteer should connect to a given target or not. | |
|
||||
|
@ -16,4 +16,4 @@ interface BrowserConnectOptions {
|
||||
|
||||
#### Default value:
|
||||
|
||||
30000
|
||||
180000
|
||||
|
@ -62,7 +62,7 @@ export interface BrowserConnectOptions {
|
||||
/**
|
||||
* Timeout setting for individual protocol (CDP) calls.
|
||||
*
|
||||
* @defaultValue 30000
|
||||
* @defaultValue 180000
|
||||
*/
|
||||
protocolTimeout?: number;
|
||||
}
|
||||
|
@ -72,7 +72,12 @@ class Callback {
|
||||
this.#label = label;
|
||||
if (timeout) {
|
||||
this.#timer = setTimeout(() => {
|
||||
this.#promise.reject(rewriteError(this.#error, `${label} timed out.`));
|
||||
this.#promise.reject(
|
||||
rewriteError(
|
||||
this.#error,
|
||||
`${label} timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.`
|
||||
)
|
||||
);
|
||||
}, timeout);
|
||||
}
|
||||
}
|
||||
@ -194,7 +199,7 @@ export class Connection extends EventEmitter {
|
||||
super();
|
||||
this.#url = url;
|
||||
this.#delay = delay;
|
||||
this.#timeout = timeout ?? 30000;
|
||||
this.#timeout = timeout ?? 180_000;
|
||||
|
||||
this.#transport = transport;
|
||||
this.#transport.onmessage = this.onMessage.bind(this);
|
||||
|
@ -96,7 +96,7 @@ export class Connection extends EventEmitter {
|
||||
constructor(transport: ConnectionTransport, delay = 0, timeout?: number) {
|
||||
super();
|
||||
this.#delay = delay;
|
||||
this.#timeout = timeout;
|
||||
this.#timeout = timeout ?? 180_000;
|
||||
|
||||
this.#transport = transport;
|
||||
this.#transport.onmessage = this.onMessage.bind(this);
|
||||
|
Loading…
Reference in New Issue
Block a user