Commit 1d2d45e
authored
Enable patchright based execution (#93)
## Overview
Following up on #84.
Install and allow running against patchright instead of only playwright
## Testing
Build + ran both headful + headless images. Confirmed execution working
as expected with `curl`:
```sh
curl -sS http://localhost:444/playwright/execute \
-H 'Content-Type: application/json' \
-d '{"code":"await page.goto(\"https://example.com\"); return await page.title();"}'
{"result":"Example Domain","success":true}
```
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds Patchright support across images and runtime, selectable via
PLAYWRIGHT_ENGINE, and tweaks headless Chromium flags.
>
> - **Runtime**
> - Update `server/runtime/playwright-executor.ts` to dynamically select
`chromium` from `patchright` or `playwright-core` based on
`PLAYWRIGHT_ENGINE`.
> - **Images**
> - Install `patchright` globally alongside `playwright-core`,
`typescript`, and `tsx` in `images/chromium-headful/Dockerfile` and
`images/chromium-headless/image/Dockerfile`.
> - **Scripts**
> - Pass through `PLAYWRIGHT_ENGINE` env in
`images/chromium-headful/run-docker.sh` and
`images/chromium-headless/run-docker.sh`.
> - **Chromium Flags (Headless)**
> - Adjust defaults in `images/chromium-headless/image/wrapper.sh` by
removing several flags (e.g., `--disable-component-update`,
`--disable-default-apps`, `--disable-extensions`,
`--enable-automation`).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
50d5bb3. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 18771b2 commit 1d2d45e
File tree
6 files changed
+16
-9
lines changed- images
- chromium-headful
- chromium-headless
- image
- server/runtime
6 files changed
+16
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
280 | | - | |
| 279 | + | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
| 182 | + | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | 47 | | |
49 | 48 | | |
50 | | - | |
51 | 49 | | |
52 | | - | |
53 | 50 | | |
54 | 51 | | |
55 | 52 | | |
| |||
63 | 60 | | |
64 | 61 | | |
65 | 62 | | |
66 | | - | |
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| |||
0 commit comments