@crawlee/browser 3.17.1-beta.56 → 3.17.1-beta.57

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,6 +9,7 @@ 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;
12
13
  /**
13
14
  * Provides a simple framework for parallel crawling of web pages
14
15
  * using headless browsers with [Puppeteer](https://github.com/puppeteer/puppeteer)
@@ -185,7 +186,8 @@ class BrowserCrawler extends basic_1.BasicCrawler {
185
186
  const { page } = crawlingContext;
186
187
  // Page creation may be aborted
187
188
  if (page) {
188
- await page.close().catch((error) => this.log.debug('Error while closing page', { error }));
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 }));
189
191
  }
190
192
  }
191
193
  async containsSelectors(page, selectors) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/browser",
3
- "version": "3.17.1-beta.56",
3
+ "version": "3.17.1-beta.57",
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.3.0",
57
- "@crawlee/basic": "3.17.1-beta.56",
58
- "@crawlee/browser-pool": "3.17.1-beta.56",
59
- "@crawlee/types": "3.17.1-beta.56",
60
- "@crawlee/utils": "3.17.1-beta.56",
57
+ "@crawlee/basic": "3.17.1-beta.57",
58
+ "@crawlee/browser-pool": "3.17.1-beta.57",
59
+ "@crawlee/types": "3.17.1-beta.57",
60
+ "@crawlee/utils": "3.17.1-beta.57",
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": "aaf56f1d6905d06fe18a93bbd2d7695a581d57cf"
84
+ "gitHead": "b5412ad2cdd908c56f607b83df75ff1e2ef77584"
85
85
  }