You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Download single browser binary](#download-single-browser-binary)
10
9
<!-- GEN:stop -->
11
10
11
+
<br>
12
+
12
13
## System requirements
13
14
14
15
Playwright requires Node.js version 10.15 or above. The browser binaries for Chromium,
@@ -21,63 +22,70 @@ Firefox and WebKit work across the 3 platforms (Windows, macOS, Linux):
21
22
* For Ubuntu 18.04, the additional dependencies are defined in [our Docker image](docker/Dockerfile.bionic),
22
23
which is based on Ubuntu.
23
24
25
+
<br>
26
+
24
27
## Managing browser binaries
25
28
26
-
Each version of Playwright needs specific versions of browser binaries to operate.
29
+
Each version of Playwright needs specific versions of browser binaries to operate. By default Playwright downloads Chromium, WebKit and Firefox browsers into the OS-specific cache folders:
27
30
28
-
By default it downloads Chromium, WebKit and Firefox browsers into the `node_modules/` folder. This way no extra steps are needed to get playwright up and running:
31
+
-`HOME\AppData\Local\ms-playwright` on Windows
32
+
-`~/Library/Caches/ms-playwright` on MacOS
33
+
-`~/.cache/playwright/ms-playwright` on Linux
29
34
30
35
```sh
31
36
npm i playwright
32
37
```
33
38
34
-
These browsers will take hundreds of megabytes of the disk space when installed:
39
+
These browsers will take few hundreds of megabytes of the disk space when installed:
35
40
36
41
```sh
37
-
du -hs ./node_modules/playwright/.local-browsers/*
38
-
281M .local-browsers/chromium-XXXXXX
39
-
187M .local-browsers/firefox-XXXX
40
-
180M .local-browsers/webkit-XXXX
42
+
du -hs ./Library/Caches/ms-playwright/*
43
+
281Mchromium-XXXXXX
44
+
187M firefox-XXXX
45
+
180M webkit-XXXX
41
46
```
42
47
43
-
To mitigate that, Playwright has a rich set of options to control browser management.
48
+
You can override default behavior using environment variables. When installing Playwright, ask it to download browsers into a specific location:
44
49
45
-
### Download from artifact repository
50
+
```sh
51
+
$ PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npm i playwright
52
+
```
46
53
47
-
By default, Playwright downloads browsers from Microsoft and Google public CDNs.
54
+
When running Playwright scripts, ask it to search for browsers in a shared location:
48
55
49
-
Sometimes companies maintain an internal artifact repository to host browser
50
-
binaries. In this case, Playwright can be configured to download from a custom
51
-
location using the `PLAYWRIGHT_DOWNLOAD_HOST` env variable.
0 commit comments