Skip to content

Commit 5c753b7

Browse files
authored
docs: add the browsers section (#5876)
1 parent c68bd31 commit 5c753b7

File tree

2 files changed

+107
-15
lines changed

2 files changed

+107
-15
lines changed

docs/src/browsers.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
id: browsers
3+
title: "Browsers"
4+
---
5+
6+
Each version of Playwright needs specific versions of browser binaries to operate. By default Playwright downloads Chromium, WebKit and Firefox browser versions that it supports. With every release, Playwright updates the versions
7+
of the browsers it supports, so that the latest Playwright would support the latest browsers at any moment.
8+
9+
<!-- TOC -->
10+
11+
## Chromium
12+
13+
For Google Chrome, Microsoft Edge and other Chromium-based browsers, by default, Playwright uses open source Chromium builds.
14+
These builds match the current [Chrome Dev Channel](https://support.google.com/chrome/a/answer/9027636?hl=en) build at the time
15+
of each Playwright release, i.e. it is new with every Playwright update. Since Chromium project is ahead of the branded browsers,
16+
when the world is on Google Chrome 89, Playwright already supports Google Chrome and Microsoft Edge testing all the way to version 91.
17+
18+
There is also a way to opt into using Google Chrome's or Microsoft Edge's branded builds for testing. For details
19+
on when to opt into stable channels, refer to the [Google Chrome & Microsoft Edge section below.](#google-chrome--microsoft-edge) section below.
20+
21+
## Firefox
22+
23+
Playwright's Firefox version matches the recent [Firefox Beta](https://www.mozilla.org/en-US/firefox/channel/desktop/)
24+
build.
25+
26+
## WebKit
27+
28+
Playwright's WebKit version matches the recent WebKit trunk build, before it is used in Apple Safari and
29+
other WebKit-based browsers. This gives a lot of lead time to react on the potential browser update issues. We are
30+
also working on a dedicated support for builds that would match Apple Safari Technology Preview.
31+
32+
## Google Chrome & Microsoft Edge
33+
34+
While Playwright will download and use the recent Chromium build by default, it can operate against the stock Google Chrome and Microsoft Edge browsers. In particular, current Playwright version will support Stable and Beta channels
35+
of these browsers. Here is how you can opt into using the stock browser:
36+
37+
```js
38+
const { chromium } = require('playwright');
39+
const browser = await chromium.launch({
40+
channel: 'chrome' // or 'msedge', 'chrome-beta', 'msedge-beta', 'msedge-dev', etc.
41+
});
42+
```
43+
44+
```java
45+
import com.microsoft.playwright.*;
46+
47+
public class Example {
48+
public static void main(String[] args) {
49+
try (Playwright playwright = Playwright.create()) {
50+
BrowserType chromium = playwright.chromium();
51+
// Can be "msedge", "chrome-beta", "msedge-beta", "msedge-dev", etc.
52+
Browser browser = chromium.launch(new BrowserType.LaunchOptions().setChannel("chrome"));
53+
}
54+
}
55+
}
56+
```
57+
58+
```python async
59+
# Can be "msedge", "chrome-beta", "msedge-beta", "msedge-dev", etc.
60+
browser = await playwright.chromium.launch(channel="chrome")
61+
```
62+
63+
```python sync
64+
# Can be "msedge", "chrome-beta", "msedge-beta", "msedge-dev", etc.
65+
browser = playwright.chromium.launch(channel="chrome")
66+
```
67+
68+
### When to use Google Chrome & Microsoft Edge and when not to?
69+
70+
**Defaults**
71+
72+
Using default Playwright configuration with the latest Chromium is a good idea most of the time.
73+
Since Playwright is ahead of Stable channels for the browsers, it gives peace of mind that the
74+
upcoming Google Chrome or Microsoft Edge releases won't break your site. You catch breakage
75+
early and have a lot of time to fix it before the official Chrome update.
76+
77+
**Regression testing**
78+
79+
Having said that, testing policies often require regression testing to be performed against
80+
the current publicly available browsers. In this case, you can opt into one of the stable channels,
81+
`"chrome"` or `"msedge"`.
82+
83+
**Media codecs**
84+
85+
Another reason for testing using official binaries is to test functionality related to media codecs.
86+
Chromium does not have all the codecs that Google Chrome or Microsoft Edge are bundling due to
87+
various licensing considerations and agreements. If your site relies on this kind of codecs (which is
88+
rarely the case), you also want to use official channel.
89+
90+
**Enterprise policy**
91+
92+
Google Chrome and Microsoft Edge respect enterprise policies, which include limitations to the capabilities,
93+
network proxy, mandatory extensions that stand in the way of testing. So if you are a part of the
94+
organization that uses such policies, it is the easiest to use bundled Chromium for your local testing,
95+
you can still opt into stable channels on the bots that are typically free of such restrictions.

docs/src/languages.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,31 @@ The Playwright API is available in multiple languages.
99

1010
## JavaScript and TypeScript
1111

12-
Playwright for JavaScript and TypeScript is generally available.
12+
[Playwright for Node.js](https://playwright.dev/docs/intro/) is available.
1313

14-
```
15-
npm i -D playwright
16-
```
17-
18-
* [Playwright on NPM](https://www.npmjs.com/package/playwright)
14+
* [NPM](https://www.npmjs.com/package/playwright)
15+
* [Documentation](https://playwright.dev/docs/intro/)
16+
* [API](https://playwright.dev/docs/api/class-playwright)
1917
* [GitHub repo](https://github.com/microsoft/playwright)
2018

2119
## Python
2220

2321
[Playwright for Python](https://playwright.dev/python/docs/intro/) is available.
2422

25-
```
26-
pip install playwright
27-
```
2823
* [Documentation](https://playwright.dev/python/docs/intro/)
2924
* [API](https://playwright.dev/python/docs/api/class-playwright)
3025
* [Playwright on PyPI](https://pypi.org/project/playwright/)
3126
* [GitHub repo](https://github.com/microsoft/playwright-python)
3227
* [Pytest integration](https://github.com/microsoft/playwright-pytest)
3328

29+
## Java
30+
31+
[Playwright for Java](https://playwright.dev/java/docs/intro/) is available.
32+
33+
* [Documentation](https://playwright.dev/java/docs/intro/)
34+
* [API](https://playwright.dev/java/docs/api/class-playwright)
35+
* [GitHub repo](https://github.com/microsoft/playwright-java)
36+
3437
## C#
3538

3639
Playwright for C# is available in preview.
@@ -41,9 +44,3 @@ dotnet add package PlaywrightSharp
4144

4245
* [Playwright on NuGet](https://www.nuget.org/packages/PlaywrightSharp/)
4346
* [GitHub repo](https://github.com/microsoft/playwright-sharp)
44-
45-
## Java
46-
47-
Playwright for Java is available in preview.
48-
49-
* [GitHub repo](https://github.com/microsoft/playwright-java)

0 commit comments

Comments
 (0)