docs: note that custom args are on your own risk (#28656)

https://github.com/microsoft/playwright/issues/28537
This commit is contained in:
Max Schmitt 2023-12-14 14:37:31 -08:00 committed by GitHub
parent f8d0204d2f
commit 256b287649
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 6 deletions

View file

@ -911,8 +911,12 @@ between the same pixel in compared images, between zero (strict) and one (lax),
## browser-option-args ## browser-option-args
- `args` <[Array]<[string]>> - `args` <[Array]<[string]>>
:::warning
Use custom browser args at your own risk, as some of them may break Playwright functionality.
:::
Additional arguments to pass to the browser instance. The list of Chromium flags can be found Additional arguments to pass to the browser instance. The list of Chromium flags can be found
[here](http://peter.sh/experiments/chromium-command-line-switches/). [here](https://peter.sh/experiments/chromium-command-line-switches/).
## browser-option-channel ## browser-option-channel
- `channel` <[string]> - `channel` <[string]>

View file

@ -6,7 +6,7 @@ title: "Chrome extensions"
## Introduction ## Introduction
:::note :::note
Extensions only work in Chrome / Chromium launched with a persistent context. Extensions only work in Chrome / Chromium launched with a persistent context. Use custom browser args at your own risk, as some of them may break Playwright functionality.
::: :::
The following is code for getting a handle to the [background page](https://developer.chrome.com/extensions/background_pages) of a [Manifest v2](https://developer.chrome.com/docs/extensions/mv2/) extension whose source is located in `./my-extension`: The following is code for getting a handle to the [background page](https://developer.chrome.com/extensions/background_pages) of a [Manifest v2](https://developer.chrome.com/docs/extensions/mv2/) extension whose source is located in `./my-extension`:
@ -214,6 +214,10 @@ def test_popup_page(page: Page, extension_id: str) -> None:
## Headless mode ## Headless mode
:::danger
`headless=new` mode is not officially supported by Playwright and might result in unexpected behavior.
:::
By default, Chrome's headless mode in Playwright does not support Chrome extensions. To overcome this limitation, you can run Chrome's persistent context with a new headless mode by using the following code: By default, Chrome's headless mode in Playwright does not support Chrome extensions. To overcome this limitation, you can run Chrome's persistent context with a new headless mode by using the following code:
```js title="fixtures.ts" ```js title="fixtures.ts"

View file

@ -347,6 +347,10 @@ export default defineConfig({
Options used to launch the browser, as passed to [`method: BrowserType.launch`]. Specific options [`property: TestOptions.headless`] and [`property: TestOptions.channel`] take priority over this. Options used to launch the browser, as passed to [`method: BrowserType.launch`]. Specific options [`property: TestOptions.headless`] and [`property: TestOptions.channel`] take priority over this.
:::warning
Use custom browser args at your own risk, as some of them may break Playwright functionality.
:::
**Usage** **Usage**
```js title="playwright.config.ts" ```js title="playwright.config.ts"

View file

@ -13020,8 +13020,10 @@ export interface BrowserType<Unused = {}> {
acceptDownloads?: boolean; acceptDownloads?: boolean;
/** /**
* **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.
*
* Additional arguments to pass to the browser instance. The list of Chromium flags can be found * Additional arguments to pass to the browser instance. The list of Chromium flags can be found
* [here](http://peter.sh/experiments/chromium-command-line-switches/). * [here](https://peter.sh/experiments/chromium-command-line-switches/).
*/ */
args?: Array<string>; args?: Array<string>;
@ -13458,8 +13460,10 @@ export interface BrowserType<Unused = {}> {
*/ */
launchServer(options?: { launchServer(options?: {
/** /**
* **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.
*
* Additional arguments to pass to the browser instance. The list of Chromium flags can be found * Additional arguments to pass to the browser instance. The list of Chromium flags can be found
* [here](http://peter.sh/experiments/chromium-command-line-switches/). * [here](https://peter.sh/experiments/chromium-command-line-switches/).
*/ */
args?: Array<string>; args?: Array<string>;
@ -14500,8 +14504,10 @@ export interface AndroidDevice {
acceptDownloads?: boolean; acceptDownloads?: boolean;
/** /**
* **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.
*
* Additional arguments to pass to the browser instance. The list of Chromium flags can be found * Additional arguments to pass to the browser instance. The list of Chromium flags can be found
* [here](http://peter.sh/experiments/chromium-command-line-switches/). * [here](https://peter.sh/experiments/chromium-command-line-switches/).
*/ */
args?: Array<string>; args?: Array<string>;
@ -20041,8 +20047,10 @@ interface AccessibilitySnapshotOptions {
export interface LaunchOptions { export interface LaunchOptions {
/** /**
* **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.
*
* Additional arguments to pass to the browser instance. The list of Chromium flags can be found * Additional arguments to pass to the browser instance. The list of Chromium flags can be found
* [here](http://peter.sh/experiments/chromium-command-line-switches/). * [here](https://peter.sh/experiments/chromium-command-line-switches/).
*/ */
args?: Array<string>; args?: Array<string>;

View file

@ -3809,6 +3809,8 @@ export interface PlaywrightWorkerOptions {
* [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) take priority over * [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) take priority over
* this. * this.
* *
* **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.
*
* **Usage** * **Usage**
* *
* ```js * ```js