Skip to content

Commit 44f46e3

Browse files
committed
Merge branch 'feat/3.0' into feat/support-navigate-requests
2 parents f4a7201 + b888ea0 commit 44f46e3

13 files changed

Lines changed: 151 additions & 364 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@
246246
"sideEffects": false,
247247
"dependencies": {
248248
"@inquirer/confirm": "^6.0.11",
249+
"@msw/url": "^0.1.0",
249250
"@mswjs/interceptors": "^0.41.3",
250251
"@open-draft/deferred-promise": "^3.0.0",
251252
"@types/statuses": "^2.0.6",
@@ -254,7 +255,6 @@
254255
"headers-polyfill": "^5.0.1",
255256
"is-node-process": "^1.2.0",
256257
"outvariant": "^1.4.3",
257-
"path-to-regexp": "^6.3.0",
258258
"picocolors": "^1.1.1",
259259
"rettime": "^0.11.7",
260260
"statuses": "^2.0.2",

‎pnpm-lock.yaml‎

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/browser/sources/service-worker-source.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,12 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
278278
this.#channel.on('RESPONSE', this.#handleResponse.bind(this))
279279

280280
window.addEventListener(
281-
'beforeunload',
282-
() => {
281+
'pagehide',
282+
(event) => {
283+
if (event.persisted) {
284+
return
285+
}
286+
283287
if (worker.state !== 'redundant') {
284288
this.#channel.postMessage('CLIENT_CLOSED')
285289
}

‎src/browser/utils/workerChannel.ts‎

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,19 @@ export type WorkerChannelEventMap = {
2323
/**
2424
* Request representation received from the worker message event.
2525
*/
26-
export interface IncomingWorkerRequest
27-
extends Omit<
28-
Request,
29-
| 'text'
30-
| 'body'
31-
| 'json'
32-
| 'blob'
33-
| 'arrayBuffer'
34-
| 'formData'
35-
| 'clone'
36-
| 'signal'
37-
| 'isHistoryNavigation'
38-
| 'isReloadNavigation'
39-
> {
26+
export interface IncomingWorkerRequest extends Omit<
27+
Request,
28+
| 'text'
29+
| 'body'
30+
| 'json'
31+
| 'blob'
32+
| 'arrayBuffer'
33+
| 'formData'
34+
| 'clone'
35+
| 'signal'
36+
| 'isHistoryNavigation'
37+
| 'isReloadNavigation'
38+
> {
4039
/**
4140
* Unique ID of the request generated once the request is
4241
* intercepted by the "fetch" event in the Service Worker.

‎src/core/experimental/define-network.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ export interface DefineNetworkOptions<
4747
onUnhandledFrame?: UnhandledFrameHandle
4848
}
4949

50-
export interface NetworkApi<Sources extends Array<NetworkSource<any>>>
51-
extends NetworkHandlersApi {
50+
export interface NetworkApi<
51+
Sources extends Array<NetworkSource<any>>,
52+
> extends NetworkHandlersApi {
5253
readyState: NetworkReadyState
5354
/**
5455
* Enable the network interception and handling.

0 commit comments

Comments
 (0)