Skip to content

Commit

Permalink
Revert "docs: deprecate: Request.serviceWorker() (#32136)" (#32432)
Browse files Browse the repository at this point in the history
This reverts commit b7ed4d7.
  • Loading branch information
yury-s authored Sep 3, 2024
1 parent 565aed6 commit b75483b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 7 additions & 2 deletions docs/src/api/class-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,15 @@ Returns the matching [Response] object, or `null` if the response was not receiv
## method: Request.serviceWorker
* since: v1.24
* langs: js
* deprecated: Requests made by a Service Worker are not reported in Playwright.
- returns: <[null]|[Worker]>

This method will always return `null`.
The Service [Worker] that is performing the request.

**Details**

This method is Chromium only. It's safe to call when using other browsers, but it will always be `null`.

Requests originated in a Service Worker do not have a [`method: Request.frame`] available.

## async method: Request.sizes
* since: v1.15
Expand Down
10 changes: 8 additions & 2 deletions packages/playwright-core/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19237,8 +19237,14 @@ export interface Request {
response(): Promise<null|Response>;

/**
* This method will always return `null`.
* @deprecated Requests made by a Service Worker are not reported in Playwright.
* The Service {@link Worker} that is performing the request.
*
* **Details**
*
* This method is Chromium only. It's safe to call when using other browsers, but it will always be `null`.
*
* Requests originated in a Service Worker do not have a
* [request.frame()](https://playwright.dev/docs/api/class-request#request-frame) available.
*/
serviceWorker(): null|Worker;

Expand Down

0 comments on commit b75483b

Please sign in to comment.