Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
docs: note that custom args are on your own risk (#28656)
Max Schmitt256b2876490a
diff --git a/docs/src/api/params.md b/docs/src/api/params.mdindex 117fb343c7..da1de83d2a 100644--- a/docs/src/api/params.md+++ b/docs/src/api/params.md@@ -911,8 +911,12 @@ between the same pixel in compared images, between zero (strict) and one (lax),## browser-option-args- `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-[here](http://peter.sh/experiments/chromium-command-line-switches/).+[here](https://peter.sh/experiments/chromium-command-line-switches/).## browser-option-channel- `channel` <[string]>diff --git a/docs/src/chrome-extensions-js-python.md b/docs/src/chrome-extensions-js-python.mdindex fe15a06819..e34236ab5b 100644--- a/docs/src/chrome-extensions-js-python.md+++ b/docs/src/chrome-extensions-js-python.md@@ -6,7 +6,7 @@ title: "Chrome extensions"## Introduction:::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`:@@ -214,6 +214,10 @@ def test_popup_page(page: Page, extension_id: str) -> None:## 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:```js title="fixtures.ts"diff --git a/docs/src/test-api/class-testoptions.md b/docs/src/test-api/class-testoptions.mdindex 8ac76c5b67..946171a935 100644--- a/docs/src/test-api/class-testoptions.md+++ b/docs/src/test-api/class-testoptions.md@@ -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.+:::warning+Use custom browser args at your own risk, as some of them may break Playwright functionality.+:::+**Usage**```js title="playwright.config.ts"diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.tsindex 570360399f..35bbe75c61 100644--- a/packages/playwright-core/types/types.d.ts+++ b/packages/playwright-core/types/types.d.ts@@ -13020,8 +13020,10 @@ export interface BrowserType<Unused = {}> {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- * [here](http://peter.sh/experiments/chromium-command-line-switches/).+ * [here](https://peter.sh/experiments/chromium-command-line-switches/).*/args?: Array<string>;@@ -13458,8 +13460,10 @@ export interface BrowserType<Unused = {}> {*/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- * [here](http://peter.sh/experiments/chromium-command-line-switches/).+ * [here](https://peter.sh/experiments/chromium-command-line-switches/).*/args?: Array<string>;@@ -14500,8 +14504,10 @@ export interface AndroidDevice {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- * [here](http://peter.sh/experiments/chromium-command-line-switches/).+ * [here](https://peter.sh/experiments/chromium-command-line-switches/).*/args?: Array<string>;@@ -20041,8 +20047,10 @@ interface AccessibilitySnapshotOptions {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- * [here](http://peter.sh/experiments/chromium-command-line-switches/).+ * [here](https://peter.sh/experiments/chromium-command-line-switches/).*/args?: Array<string>;diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.tsindex b14d3edd71..ff3679874a 100644--- a/packages/playwright/types/test.d.ts+++ b/packages/playwright/types/test.d.ts@@ -3809,6 +3809,8 @@ export interface PlaywrightWorkerOptions {* [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) take priority over* this.*+ * **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.+ ** **Usage**** ```js