Skip to content

Commit

Permalink
fix: deprecate isIncognito (#11962)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN authored Feb 21, 2024
1 parent 013bd0b commit ceab7a9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/api/puppeteer.browsercontext.isincognito.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ sidebar_label: BrowserContext.isIncognito

# BrowserContext.isIncognito() method

> Warning: This API is now obsolete.
>
> In Chrome, the [default browser context](./puppeteer.browser.defaultbrowsercontext.md) can also be "icognito" if configured via the arguments and in such cases this getter returns wrong results (see https://github.com/puppeteer/puppeteer/issues/8836). Also, the term "incognito" is not applicable to other browsers. To migrate, check the [default browser context](./puppeteer.browser.defaultbrowsercontext.md) instead: in Chrome all non-default contexts are incognito, and the default context might be incognito if you provide the `--incognito` argument when launching the browser.
Whether this [browser context](./puppeteer.browsercontext.md) is incognito.

In Chrome, the [default browser context](./puppeteer.browser.defaultbrowsercontext.md) is the only non-incognito browser context.
Expand Down
11 changes: 11 additions & 0 deletions packages/puppeteer-core/src/api/BrowserContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@ export abstract class BrowserContext extends EventEmitter<BrowserContextEvents>
* In Chrome, the
* {@link Browser.defaultBrowserContext | default browser context} is the only
* non-incognito browser context.
*
* @deprecated In Chrome, the
* {@link Browser.defaultBrowserContext | default browser context} can also be
* "icognito" if configured via the arguments and in such cases this getter
* returns wrong results (see
* https://github.com/puppeteer/puppeteer/issues/8836). Also, the term
* "incognito" is not applicable to other browsers. To migrate, check the
* {@link Browser.defaultBrowserContext | default browser context} instead: in
* Chrome all non-default contexts are incognito, and the default context
* might be incognito if you provide the `--incognito` argument when launching
* the browser.
*/
abstract isIncognito(): boolean;

Expand Down

0 comments on commit ceab7a9

Please sign in to comment.