From 2bc8ed0fc97fcce9ae431c6a73dda77df1b846cb Mon Sep 17 00:00:00 2001 From: Adam Gastineau Date: Thu, 5 Jun 2025 11:33:48 -0700 Subject: [PATCH] docs(context): document the `browser()` call from persistent context (#36216) --- docs/src/api/class-browsercontext.md | 2 +- packages/playwright-client/types/types.d.ts | 3 ++- packages/playwright-core/types/types.d.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.md index afd73a4142..add918f234 100644 --- a/docs/src/api/class-browsercontext.md +++ b/docs/src/api/class-browsercontext.md @@ -467,7 +467,7 @@ All existing background pages in the context. * since: v1.8 - returns: <[null]|[Browser]> -Returns the browser instance of the context. If it was launched as a persistent context null gets returned. +Gets the browser instance that owns the context. Returns `null` if the context is created outside of normal browser, e.g. Android or Electron. ## async method: BrowserContext.clearCookies * since: v1.8 diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.ts index efe7626b23..aaf8a14c42 100644 --- a/packages/playwright-client/types/types.d.ts +++ b/packages/playwright-client/types/types.d.ts @@ -8840,7 +8840,8 @@ export interface BrowserContext { backgroundPages(): Array; /** - * Returns the browser instance of the context. If it was launched as a persistent context null gets returned. + * Gets the browser instance that owns the context. Returns `null` if the context is created outside of normal + * browser, e.g. Android or Electron. */ browser(): null|Browser; diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index efe7626b23..aaf8a14c42 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/packages/playwright-core/types/types.d.ts @@ -8840,7 +8840,8 @@ export interface BrowserContext { backgroundPages(): Array; /** - * Returns the browser instance of the context. If it was launched as a persistent context null gets returned. + * Gets the browser instance that owns the context. Returns `null` if the context is created outside of normal + * browser, e.g. Android or Electron. */ browser(): null|Browser;