@crawlee/browser-pool 4.0.0-beta.132 → 4.0.0-beta.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser-pool.d.ts +1 -0
- package/browser-pool.js +3 -0
- package/package.json +4 -4
- package/remote-browser-pool.d.ts +1 -0
- package/remote-browser-pool.js +3 -0
package/browser-pool.d.ts
CHANGED
|
@@ -407,6 +407,7 @@ export declare class BrowserPool<Options extends BrowserPoolOptions = BrowserPoo
|
|
|
407
407
|
* @return {Promise<void>}
|
|
408
408
|
*/
|
|
409
409
|
closeAllBrowsers(): Promise<void>;
|
|
410
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
410
411
|
/**
|
|
411
412
|
* Closes all managed browsers and tears down the pool.
|
|
412
413
|
*/
|
package/browser-pool.js
CHANGED
|
@@ -411,6 +411,9 @@ export class BrowserPool extends TypedEmitter {
|
|
|
411
411
|
.map(async (controller) => controller.close());
|
|
412
412
|
await Promise.all(promises);
|
|
413
413
|
}
|
|
414
|
+
async [Symbol.asyncDispose]() {
|
|
415
|
+
await this.destroy();
|
|
416
|
+
}
|
|
414
417
|
/**
|
|
415
418
|
* Closes all managed browsers and tears down the pool.
|
|
416
419
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/browser-pool",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.133",
|
|
4
4
|
"description": "Rotate multiple browsers using popular automation libraries such as Playwright or Puppeteer.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.0.0"
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@apify/timeout": "^0.4.4",
|
|
34
|
-
"@crawlee/core": "4.0.0-beta.
|
|
35
|
-
"@crawlee/types": "4.0.0-beta.
|
|
34
|
+
"@crawlee/core": "4.0.0-beta.133",
|
|
35
|
+
"@crawlee/types": "4.0.0-beta.133",
|
|
36
36
|
"fingerprint-generator": "^2.1.68",
|
|
37
37
|
"fingerprint-injector": "^2.1.68",
|
|
38
38
|
"lodash.merge": "^4.6.2",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "ace617a523c893bf2eb1ac113412205fc05b2964"
|
|
67
67
|
}
|
package/remote-browser-pool.d.ts
CHANGED
|
@@ -151,6 +151,7 @@ export declare class RemoteBrowserPool<Page = unknown> implements IBrowserPool<P
|
|
|
151
151
|
}): Promise<void>;
|
|
152
152
|
extractPageState(page: Page): Promise<PageState>;
|
|
153
153
|
injectPageState(page: Page, state: PageState): Promise<void>;
|
|
154
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
154
155
|
/** Closes all browsers, releases any still-open remote sessions, and tears down the wrapped pool. */
|
|
155
156
|
destroy(): Promise<void>;
|
|
156
157
|
/** Resolves once the wrapped pool can serve another page without exceeding `maxOpenBrowsers`. */
|
package/remote-browser-pool.js
CHANGED
|
@@ -156,6 +156,9 @@ export class RemoteBrowserPool {
|
|
|
156
156
|
async injectPageState(page, state) {
|
|
157
157
|
return this.#pool.injectPageState(page, state);
|
|
158
158
|
}
|
|
159
|
+
async [Symbol.asyncDispose]() {
|
|
160
|
+
await this.destroy();
|
|
161
|
+
}
|
|
159
162
|
/** Closes all browsers, releases any still-open remote sessions, and tears down the wrapped pool. */
|
|
160
163
|
async destroy() {
|
|
161
164
|
await this.browserPool.destroy();
|