docs: add instructions on msedge & chrome installation (#19753)

Fixes #18511
This commit is contained in:
Yury Semikhatsky 2022-12-28 15:13:45 -08:00 коммит произвёл GitHub
Родитель b8f96a9411
Коммит d912cbf115
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 51 добавлений и 2 удалений

Просмотреть файл

@ -29,8 +29,9 @@ other WebKit-based browsers. This gives a lot of lead time to react on the poten
## Google Chrome & Microsoft Edge
While Playwright can download and use the recent Chromium build, it can operate against the stock Google
Chrome and Microsoft Edge browsers available on the machine. In particular, current Playwright version will
support Stable and Beta channels of these browsers. Here is how you can opt into using the stock browser:
Chrome and Microsoft Edge browsers available on the machine (note that Playwright doesn't install them by
default). In particular, current Playwright version will support Stable and Beta channels of these browsers.
Here is how you can opt into using the stock browser:
```js tab=js-js
// @ts-check
@ -95,6 +96,50 @@ var chromium = playwright.Chromium;
var browser = await chromium.LaunchAsync(new BrowserTypeLaunchOptions { Channel = "chrome" });
```
### Installing Google Chrome & Microsoft Edge
If stock Google Chrome or Microsoft Edge is not available on your machine, you can install
them using Playwright command line tool:
```bash lang=js
npx playwright install msedge
```
```powershell lang=js
npx playwright install msedge
```
```bash lang=python
playwright install msedge
```
```powershell lang=python
playwright install msedge
```
```bash lang=csharp
pwsh bin/Debug/netX/playwright.ps1 install msedge
```
```powershell lang=csharp
pwsh bin/Debug/netX/playwright.ps1 install msedge
```
```batch lang=java
mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="install msedge"
```
```powershell lang=java
mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="install msedge"
```
Run with `--help` option to see full list of the browsers that can be installed this way.
:::warning
Google Chrome or Microsoft Edge installations will not be isolated. They will be installed at the
default global location that depends on your operating system.
:::
### When to use Google Chrome & Microsoft Edge and when not to?
**Defaults**
@ -334,6 +379,10 @@ $env:PLAYWRIGHT_BROWSERS_PATH=0
npx playwright install
```
:::note
`PLAYWRIGHT_BROWSERS_PATH` does not change installation path for Google Chrome and Microsoft Edge.
:::
## Install behind a firewall or a proxy
By default, Playwright downloads browsers from Microsoft CDN.