docs(chrome-extensions) update headless testing docs (#20643)

Update the documentation according to changes
https://bugs.chromium.org/p/chromium/issues/detail?id=1380881
This commit is contained in:
Boris Osipov 2023-02-06 12:31:05 +03:00 committed by GitHub
parent 9787de92f3
commit 494497abbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -224,7 +224,7 @@ const pathToExtension = path.join(__dirname, 'my-extension');
const context = await chromium.launchPersistentContext('', { const context = await chromium.launchPersistentContext('', {
headless: false, headless: false,
args: [ args: [
`--headless=chrome`, // the new headless arg `--headless=new`, // the new headless arg for chrome v109+. Use '--headless=chrome' as arg for browsers v94-108.
`--disable-extensions-except=${pathToExtension}`, `--disable-extensions-except=${pathToExtension}`,
`--load-extension=${pathToExtension}`, `--load-extension=${pathToExtension}`,
], ],
@ -237,11 +237,11 @@ const context = await chromium.launchPersistentContext('', {
path_to_extension = Path(__file__).parent.joinpath("my-extension") path_to_extension = Path(__file__).parent.joinpath("my-extension")
context = playwright.chromium.launch_persistent_context( context = playwright.chromium.launch_persistent_context(
"", "",
headless=False, headless=False,
args=[ args=[
"--headless=chrome", # the new headless arg "--headless=new", # the new headless arg for chrome v109+. Use '--headless=chrome' as arg for browsers v94-108.
f"--disable-extensions-except={path_to_extension}", f"--disable-extensions-except={path_to_extension}",
f"--load-extension={path_to_extension}", f"--load-extension={path_to_extension}",
], ],
) )
``` ```