Skip to content

Commit 1046fe0

Browse files
dgozmanmxschmitt
authored andcommitted
cherry-pick(#33753): docs: update extensions doc for new headless
1 parent 1781bf3 commit 1046fe0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

docs/src/chrome-extensions-js-python.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,15 @@ def test_popup_page(page: Page, extension_id: str) -> None:
214214

215215
## Headless mode
216216

217-
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:
217+
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 [channel `chromium`](./browsers.md#opt-in-to-new-headless-mode):
218218

219219
```js title="fixtures.ts"
220220
// ...
221221

222222
const pathToExtension = path.join(__dirname, 'my-extension');
223223
const context = await chromium.launchPersistentContext('', {
224-
headless: false,
224+
channel: 'chromium',
225225
args: [
226-
`--headless=new`,
227226
`--disable-extensions-except=${pathToExtension}`,
228227
`--load-extension=${pathToExtension}`,
229228
],
@@ -235,9 +234,8 @@ const context = await chromium.launchPersistentContext('', {
235234
path_to_extension = Path(__file__).parent.joinpath("my-extension")
236235
context = playwright.chromium.launch_persistent_context(
237236
"",
238-
headless=False,
237+
channel="chromium",
239238
args=[
240-
"--headless=new",
241239
f"--disable-extensions-except={path_to_extension}",
242240
f"--load-extension={path_to_extension}",
243241
],

0 commit comments

Comments
 (0)