From 653d483ba87190a9fa727fe71c40be202ce9132f Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 3 May 2021 16:52:33 -0700 Subject: [PATCH] docs: add firefox-stable channel documentation (#6328) Fixes #5993 --- docs/src/api/class-browsertype.md | 6 ++-- docs/src/browsers.md | 50 ++++++++++++++++++++++++++++++- types/types.d.ts | 6 ++-- 3 files changed, 55 insertions(+), 7 deletions(-) diff --git a/docs/src/api/class-browsertype.md b/docs/src/api/class-browsertype.md index 754454545d4a1..157952ef727d7 100644 --- a/docs/src/api/class-browsertype.md +++ b/docs/src/api/class-browsertype.md @@ -214,7 +214,7 @@ Whether to run browser in headless mode. More details for [`option: devtools`] option is `true`. ### option: BrowserType.launch.channel -- `channel` <[BrowserChannel]<"chrome"|"chrome-beta"|"chrome-dev"|"chrome-canary"|"msedge"|"msedge-beta"|"msedge-dev"|"msedge-canary">> +- `channel` <[BrowserChannel]<"chrome"|"chrome-beta"|"chrome-dev"|"chrome-canary"|"msedge"|"msedge-beta"|"msedge-dev"|"msedge-canary"|"firefox-stable">> Browser distribution channel. Read more about using [Google Chrome and Microsoft Edge](./browsers.md#google-chrome--microsoft-edge). @@ -327,7 +327,7 @@ Whether to run browser in headless mode. More details for [`option: devtools`] option is `true`. ### option: BrowserType.launchPersistentContext.channel -- `channel` <[BrowserChannel]<"chrome"|"chrome-beta"|"chrome-dev"|"chrome-canary"|"msedge"|"msedge-beta"|"msedge-dev"|"msedge-canary">> +- `channel` <[BrowserChannel]<"chrome"|"chrome-beta"|"chrome-dev"|"chrome-canary"|"msedge"|"msedge-beta"|"msedge-dev"|"msedge-canary"|"firefox-stable">> Browser distribution channel. Read more about using [Google Chrome and Microsoft Edge](./browsers.md#google-chrome--microsoft-edge). @@ -434,7 +434,7 @@ Whether to run browser in headless mode. More details for Port to use for the web socket. Defaults to 0 that picks any available port. ### option: BrowserType.launchServer.channel -- `channel` <[BrowserChannel]<"chrome"|"chrome-beta"|"chrome-dev"|"chrome-canary"|"msedge"|"msedge-beta"|"msedge-dev"|"msedge-canary">> +- `channel` <[BrowserChannel]<"chrome"|"chrome-beta"|"chrome-dev"|"chrome-canary"|"msedge"|"msedge-beta"|"msedge-dev"|"msedge-canary"|"firefox-stable">> Browser distribution channel. Read more about using [Google Chrome and Microsoft Edge](./browsers.md#google-chrome--microsoft-edge). diff --git a/docs/src/browsers.md b/docs/src/browsers.md index b5079ed01743d..fff554ecab21e 100644 --- a/docs/src/browsers.md +++ b/docs/src/browsers.md @@ -22,7 +22,55 @@ on when to opt into stable channels, refer to the [Google Chrome & Microsoft Edg ## Firefox Playwright's Firefox version matches the recent [Firefox Beta](https://www.mozilla.org/en-US/firefox/channel/desktop/) -build. +build. + +### Firefox-Stable + +Playwright team maintains a Playwright Firefox version that matches the latest Firefox Stable, a.k.a. `firefox-stable`. + +Using `firefox-stable` is a 2-steps process: + +1. Installing `firefox-stable` with Playwright CLI. + ```sh js + $ npx playwright install firefox-stable + ``` + + ```sh java + $ mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="install firefox-stable" + ``` + + ```sh python + $ playwright install firefox-stable + ``` + +2. Using `firefox-stable` channel when launching browser. + ```js + const { firefox } = require('playwright'); + const browser = await firefox.launch({ + channel: 'firefox-stable' + }); + ``` + + ```java + import com.microsoft.playwright.*; + + public class Example { + public static void main(String[] args) { + try (Playwright playwright = Playwright.create()) { + BrowserType firefox = playwright.firefox(); + Browser browser = firefox.launch(new BrowserType.LaunchOptions().setChannel("firefox-stable")); + } + } + } + ``` + + ```python async + browser = await playwright.firefox.launch(channel="firefox-stable") + ``` + + ```python sync + browser = playwright.firefox.launch(channel="firefox-stable") + ``` ## WebKit diff --git a/types/types.d.ts b/types/types.d.ts index ce1e37edb5315..04e3997cf473a 100644 --- a/types/types.d.ts +++ b/types/types.d.ts @@ -6768,7 +6768,7 @@ export interface BrowserType { * Browser distribution channel. Read more about using * [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge). */ - channel?: "chrome"|"chrome-beta"|"chrome-dev"|"chrome-canary"|"msedge"|"msedge-beta"|"msedge-dev"|"msedge-canary"; + channel?: "chrome"|"chrome-beta"|"chrome-dev"|"chrome-canary"|"msedge"|"msedge-beta"|"msedge-dev"|"msedge-canary"|"firefox-stable"; /** * Enable Chromium sandboxing. Defaults to `true`. @@ -7098,7 +7098,7 @@ export interface BrowserType { * Browser distribution channel. Read more about using * [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge). */ - channel?: "chrome"|"chrome-beta"|"chrome-dev"|"chrome-canary"|"msedge"|"msedge-beta"|"msedge-dev"|"msedge-canary"; + channel?: "chrome"|"chrome-beta"|"chrome-dev"|"chrome-canary"|"msedge"|"msedge-beta"|"msedge-dev"|"msedge-canary"|"firefox-stable"; /** * Enable Chromium sandboxing. Defaults to `true`. @@ -10799,7 +10799,7 @@ export interface LaunchOptions { * Browser distribution channel. Read more about using * [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge). */ - channel?: "chrome"|"chrome-beta"|"chrome-dev"|"chrome-canary"|"msedge"|"msedge-beta"|"msedge-dev"|"msedge-canary"; + channel?: "chrome"|"chrome-beta"|"chrome-dev"|"chrome-canary"|"msedge"|"msedge-beta"|"msedge-dev"|"msedge-canary"|"firefox-stable"; /** * Enable Chromium sandboxing. Defaults to `false`.