@crawlee/browser 3.18.2-beta.4 → 3.18.2-beta.5

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.
@@ -9,7 +9,6 @@ const browser_pool_1 = require("@crawlee/browser-pool");
9
9
  const utils_1 = require("@crawlee/utils");
10
10
  const ow_1 = tslib_1.__importDefault(require("ow"));
11
11
  const timeout_1 = require("@apify/timeout");
12
- const PAGE_CLOSE_TIMEOUT_MILLIS = 5000;
13
12
  /**
14
13
  * Provides a simple framework for parallel crawling of web pages
15
14
  * using headless browsers with [Puppeteer](https://github.com/puppeteer/puppeteer)
@@ -186,8 +185,8 @@ class BrowserCrawler extends basic_1.BasicCrawler {
186
185
  const { page } = crawlingContext;
187
186
  // Page creation may be aborted
188
187
  if (page) {
189
- // Puppeteer 25+ can hang `page.close()` indefinitely when the page's navigation was aborted, don't let it block the crawler.
190
- await (0, timeout_1.addTimeoutToPromise)(async () => page.close(), PAGE_CLOSE_TIMEOUT_MILLIS, `page.close() timed out after ${PAGE_CLOSE_TIMEOUT_MILLIS / 1000} seconds`).catch((error) => this.log.debug('Error while closing page', { error }));
188
+ // `BrowserPool` bounds this and reconciles its own state if the close never settles.
189
+ await page.close().catch((error) => this.log.debug('Error while closing page', { error }));
191
190
  }
192
191
  }
193
192
  async containsSelectors(page, selectors) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/browser",
3
- "version": "3.18.2-beta.4",
3
+ "version": "3.18.2-beta.5",
4
4
  "description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
5
5
  "engines": {
6
6
  "node": ">=16.0.0"
@@ -54,10 +54,10 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@apify/timeout": "^0.4.0",
57
- "@crawlee/basic": "3.18.2-beta.4",
58
- "@crawlee/browser-pool": "3.18.2-beta.4",
59
- "@crawlee/types": "3.18.2-beta.4",
60
- "@crawlee/utils": "3.18.2-beta.4",
57
+ "@crawlee/basic": "3.18.2-beta.5",
58
+ "@crawlee/browser-pool": "3.18.2-beta.5",
59
+ "@crawlee/types": "3.18.2-beta.5",
60
+ "@crawlee/utils": "3.18.2-beta.5",
61
61
  "ow": "^0.28.1",
62
62
  "tslib": "^2.4.0",
63
63
  "type-fest": "^4.0.0"
@@ -81,5 +81,5 @@
81
81
  }
82
82
  }
83
83
  },
84
- "gitHead": "ee9640fb13d1414a03fcd21ccc5255bca3963aef"
84
+ "gitHead": "d126d83399f7aa71bd0920d6a50b6bb9e6373790"
85
85
  }