Skip to content

Commit 67be317

Browse files
author
cyrus
committed
bump playwright
replace url parameter with query strings
1 parent cc6913c commit 67be317

15 files changed

+189
-173
lines changed

Dockerfile.base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM mcr.microsoft.com/playwright:v1.16.3-focal
1+
FROM mcr.microsoft.com/playwright:v1.17.2-focal

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ import * as playwright from 'playwright-core';
3030

3131
## Environment variables
3232

33-
### Server [LaunchOptions](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsertypelaunchserveroptions)
33+
### Server [LaunchOptions](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server)
3434

35-
To apply playwright server [launchOptions](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsertypelaunchserveroptions) use `SERVER_` at beginning of the environment variable:
35+
To apply playwright server [launchOptions](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server) use `SERVER__` at the beginning of the environment variable:
3636

3737
```
38-
docker run -it --rm -p 3000:3000 -e SERVER_ignoreDefaultArgs=true <image_name>
38+
docker run -it --rm -p 3000:3000 -e SERVER__ignoreDefaultArgs=true <image_name>
3939
```
4040

4141
In docker-compose:
@@ -49,8 +49,8 @@ services:
4949
ports:
5050
- 3000:3000
5151
environment:
52-
- SERVER_ignoreDefaultArgs=true
53-
- SERVER_dumpio=true
52+
- SERVER__ignoreDefaultArgs=true
53+
- SERVER_firefox__devtools=true
5454
```
5555

5656
For options with the type of `array` simply do as follow:
@@ -66,16 +66,16 @@ services:
6666
ports:
6767
- 3000:3000
6868
environment:
69-
- SERVER_ignoreDefaultArgs="['--hide-scrollbars','--mute-audio']"
69+
- SERVER__ignoreDefaultArgs=["--hide-scrollbars","--mute-audio"]
7070
7171
```
7272

7373
### Chromium [Flags](https://peter.sh/experiments/chromium-command-line-switches/)
7474

75-
To apply chromium [flags](https://peter.sh/experiments/chromium-command-line-switches/) use `FLAG_` at the beginning of environment variable:
75+
To apply chromium [flags](https://peter.sh/experiments/chromium-command-line-switches/) use `FLAG__` at the beginning of environment variable and replace all dashes with underline:
7676

7777
```
78-
docker run -it --rm -p 3000:3000 -e FLAG_debug_print=true <image_name>
78+
docker run -it --rm -p 3000:3000 -e FLAG__debug_print=true <image_name>
7979
```
8080

8181
In docker-compose:
@@ -89,28 +89,27 @@ services:
8989
ports:
9090
- 3000:3000
9191
environment:
92-
- FLAG_debug_print=true
92+
- FLAG__debug_print=true
93+
- FLAG_chromium__allow_sandbox_debugging=false
9394
```
9495

95-
> Not all chromium flags has been test, some of the flag may crash the docker.
96+
> Not all chromium flags has been test, some of the flag may crash the playwright server.
9697
9798
> Note that `no_sandbox` is reserved.
9899
99100
### URI Options
100101

101-
Options can also passed with each socket request as follow:
102+
Options can also passed as query string with each socket request as follow:
102103

103104
```
104105
const browser = await playwright.chromium.connect({
105-
wsEndpoint: `ws://127.0.0.1:3000/chromium/
106-
flag-debug-print/
107-
server-ignoreDefaultArgs=["--hide-scrollbars","--mute-audio"]
106+
wsEndpoint: `ws://127.0.0.1:3000/chromium?flag--flag-option=true&server--server-option=["--server-a-1","--server-a-2"]
108107
`,
109108
});
110109
111110
```
112111

113-
> Same as environment variable `flag-` and `server-` identifier need to be included at the beginning of option.
112+
> Same as environment variable `flag--` and `server--` identifier need to be included at the beginning of option.
114113
115114
### Docker options
116115

build/src/main.js

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/src/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/src/utils/launch-options.js

Lines changed: 46 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/src/utils/launch-options.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "playwright-docker-server",
3-
"version": "0.1.1",
3+
"version": "2.0.0",
44
"description": "Minimalistic playwright server in docker.",
55
"main": "build/src/main.js",
66
"repository": "https://github.com/Cyrus-d/playwright-docker-server",
@@ -33,8 +33,8 @@
3333
"author": "mo doaie<mdoaie@yahoo.co.uk>",
3434
"license": "Apache-2.0",
3535
"dependencies": {
36-
"playwright": "^1.16.3",
3736
"http-proxy": "^1.18.1",
37+
"playwright": "^1.17.2",
3838
"tslib": "^2.3.1"
3939
}
4040
}

0 commit comments

Comments
 (0)