From b75483bbb49fd27ccb7efa93444fae162f10a413 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Tue, 3 Sep 2024 10:18:20 -0700 Subject: [PATCH] Revert "docs: deprecate: Request.serviceWorker() (#32136)" (#32432) This reverts commit b7ed4d7b9e433f1be414c6e580a0ddc39de71618. --- docs/src/api/class-request.md | 9 +++++++-- packages/playwright-core/types/types.d.ts | 10 ++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/src/api/class-request.md b/docs/src/api/class-request.md index db878f9995..e13d9de69f 100644 --- a/docs/src/api/class-request.md +++ b/docs/src/api/class-request.md @@ -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 diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index 37281a1eb4..4735669267 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/packages/playwright-core/types/types.d.ts @@ -19237,8 +19237,14 @@ export interface Request { response(): Promise; /** - * 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;