Commit 008ece0
authored
[chromium-headless]: fix headless browsers start with no pages (#104)
This PR address a bug with creating headless browsers with
`--no-startup-window` flag causing breaking Target.createTarget CDP
calls.
[Ticket](https://linear.app/onkernel/issue/KERNEL-638/headless-browsers-start-with-no-pages-breaking-targetcreatetarget-cdp)
## Testing
- run the `TestCDPTargetCreation` test. Test should pass with
`initial_page_count=1`
- re-add `--no-startup-window` in `wrapper.sh`, rebuild the docker image
in `images/chromium-headless` and rerun the `TestCDPTargetCreation`
test, the test should fail
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Removes the --no-startup-window flag so headless Chromium starts with
a page, and adds an e2e test that verifies CDP target creation.
>
> - **Chromium headless image**:
> - Remove `--no-startup-window` from default `CHROMIUM_FLAGS` in
`images/chromium-headless/image/wrapper.sh` to ensure an initial page
target exists.
> - **E2E tests**:
> - Add `TestCDPTargetCreation` in `server/e2e/e2e_chromium_test.go` to
assert at least one `page` target via CDP.
> - Add `listCDPTargets` helper to query
`http://localhost:9223/json/list`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d5c4556. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 36c7f00 commit 008ece0
File tree
2 files changed
+74
-1
lines changed- images/chromium-headless/image
- server/e2e
2 files changed
+74
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | 73 | | |
75 | 74 | | |
76 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
0 commit comments