@crawlee/playwright 3.17.1-beta.2 → 3.17.1-beta.21

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.
@@ -132,7 +132,7 @@ async function clickElementsAndInterceptNavigationRequests(options) {
132
132
  await restoreHistoryNavigationAndSaveCapturedUrls(page, uniqueRequests);
133
133
  // browser.off(BrowserEmittedEvents.TargetCreated, onTargetCreated);
134
134
  page.off('framenavigated', onFrameNavigated);
135
- await context.unroute('*', onInterceptedRequest);
135
+ await context.unroute('**', onInterceptedRequest);
136
136
  const serializedRequests = Array.from(uniqueRequests);
137
137
  return serializedRequests.map((r) => JSON.parse(r));
138
138
  }
@@ -176,7 +176,16 @@ function createTargetCreatedHandler(requests) {
176
176
  * @ignore
177
177
  */
178
178
  function isTopFrameNavigationRequest(page, req) {
179
- return req.isNavigationRequest() && req.frame() === page.mainFrame();
179
+ try {
180
+ return req.isNavigationRequest() && req.frame() === page.mainFrame();
181
+ }
182
+ catch {
183
+ // `req.frame()` throws when the owning frame is unavailable - e.g. the request was
184
+ // issued by a service worker, or before/after its frame existed (see #3216). Such a
185
+ // request is not a top-frame navigation, so swallow the throw and let it pass through
186
+ // instead of crashing the route handler (which would leave the route unhandled).
187
+ return false;
188
+ }
180
189
  }
181
190
  /**
182
191
  * @ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/playwright",
3
- "version": "3.17.1-beta.2",
3
+ "version": "3.17.1-beta.21",
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"
@@ -56,11 +56,11 @@
56
56
  "@apify/datastructures": "^2.0.0",
57
57
  "@apify/log": "^2.4.0",
58
58
  "@apify/timeout": "^0.3.1",
59
- "@crawlee/browser": "3.17.1-beta.2",
60
- "@crawlee/browser-pool": "3.17.1-beta.2",
61
- "@crawlee/core": "3.17.1-beta.2",
62
- "@crawlee/types": "3.17.1-beta.2",
63
- "@crawlee/utils": "3.17.1-beta.2",
59
+ "@crawlee/browser": "3.17.1-beta.21",
60
+ "@crawlee/browser-pool": "3.17.1-beta.21",
61
+ "@crawlee/core": "3.17.1-beta.21",
62
+ "@crawlee/types": "3.17.1-beta.21",
63
+ "@crawlee/utils": "3.17.1-beta.21",
64
64
  "cheerio": "1.0.0-rc.12",
65
65
  "jquery": "^3.6.0",
66
66
  "lodash.isequal": "^4.5.0",
@@ -89,5 +89,5 @@
89
89
  }
90
90
  }
91
91
  },
92
- "gitHead": "4068bc2c385927bb7a0c8da93d06d9e1b63d1914"
92
+ "gitHead": "b315b66d9e3dffe8963cad291a85058ee0ef07c9"
93
93
  }