S050: network on WebKit done; smokes rerun with answered asserts (input click wait, auth size)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-13 19:54:40 -06:00
commit ab158f512e
6 changed files with 22 additions and 9 deletions

View file

@ -67,7 +67,7 @@ Never modify: `~/Documents/Apps/Nacre` (the original Python Nacre, reference onl
| `nice cargo build --release -j 2` | compile check, produces `target/release/nacre` | now |
| `nice cargo test --release -j 2` | unit tests (44, ~16 s test-profile build then <1 s run; shares the S001 build) (util, settings, history, bookmarks, permissions, vault, dns, bridge loopback, download, adblock, keys, scripts, updates, inject, hub, theme, ui::widgets input, ui::paint, ui::pages::newtab) | first successful build; not alongside a build |
| `src/selftest.rs` | in-app self test: `NACRE_SCRIPT=<file>` runs script commands (listed at its top) | now |
| `tools/smoke.sh <script> [outdir]` | smoke run in a hidden nested Wayland session (`tools/nested-session.sh start\|stop <dir> [WxH]`: Xvfb → nested niri, software GL, own runtime dir and bus; `SMOKE_SIZE` = nested output size, window at 0,0) with a throwaway home; selftest `click`/`rclick`/`pagescroll`/`pagetype` are real compositor input there (`tools/wl-input`, own crate, built on first use; `wtype`), `resize` goes through the nested niri; outdir (default `target/smoke/<name>-<time>`, use a fresh one: `home/` persists) gets `nacre.log`, `selftest.log`, `<shot>.png`, `<status>.json`, `home/`, `session/`; exits non-zero on crash, panic, no `status done` or a failed `assert <js>`. Scripts in `tests/smoke/` (`launch.txt` offline, `https.txt` needs internet, `restore.txt` with `SMOKE_HOME=<launch outdir>/home`, `chrome.txt` chrome and every flyout dark and light, offline; `colours.txt` colours after welcome and site colour vs internal pages, hidden `SMOKE_SIZE=1280x1100`; `input.txt` real clicks, typing, right click, wheel on a web page, offline; `basics.txt` tabs, navigation, find, zoom, full screen, pop-ups, offline; `heavy-web.txt` DuckDuckGo, Wikipedia, YouTube, needs internet, `SMOKE_TIMEOUT=900`; `keys.txt` every shortcut action, offline; `privacy-net.txt` DNT/GPC/Save-Data headers and third-party cookies on a loopback server, offline, start `python3 tests/smoke/net/server.py &` first; `site-doctor.txt` Google sign-in, captchas, Reddit, GitHub, needs internet; `cache.txt` HTTP cache, offline, start `python3 tests/smoke/cache/server.py &` first; selftest `launch <args>` checks single instance; `cookies.txt` → `cookies-restart.txt` → `cookies-cleared.txt` encrypted cookies across restarts with `SMOKE_KEYRING=1` (own throwaway GNOME Keyring + bus) and `SMOKE_HOME`, `cookies-nokeyring.txt` without, server.py first; `crash-adblock.txt` R5-01 regression, ~1300 blocked loads with reloads/navigations mid-load plus 3200 timers under GC pressure, offline, server.py first); header documents env vars and commands. `SMOKE_VISIBLE=1` shows the run on the user's screen (real GPU; page input synthesized in the page, no `rclick`/`resize`); it refuses to start unless the user's niri config has the `dev.nacre.Nacre` window rule from the smoke.sh header (DP-1, no focus), so it never moves the user's focus or workspace (D-044). WebKit state (S046): launch, basics, input, keys, chrome ported; other scripts not yet; loopback-server smokes need `NACRE_NO_BRIDGE=1` until S050. Read the PNGs | now (S003, S046) |
| `tools/smoke.sh <script> [outdir]` | smoke run in a hidden nested Wayland session (`tools/nested-session.sh start\|stop <dir> [WxH]`: Xvfb → nested niri, software GL, own runtime dir and bus; `SMOKE_SIZE` = nested output size, window at 0,0) with a throwaway home; selftest `click`/`rclick`/`pagescroll`/`pagetype` are real compositor input there (`tools/wl-input`, own crate, built on first use; `wtype`), `resize` goes through the nested niri; outdir (default `target/smoke/<name>-<time>`, use a fresh one: `home/` persists) gets `nacre.log`, `selftest.log`, `<shot>.png`, `<status>.json`, `home/`, `session/`; exits non-zero on crash, panic, no `status done` or a failed `assert <js>`. Scripts in `tests/smoke/` (`launch.txt` offline, `https.txt` needs internet, `restore.txt` with `SMOKE_HOME=<launch outdir>/home`, `chrome.txt` chrome and every flyout dark and light, offline; `colours.txt` colours after welcome and site colour vs internal pages, hidden `SMOKE_SIZE=1280x1100`; `input.txt` real clicks, typing, right click, wheel on a web page, offline; `basics.txt` tabs, navigation, find, zoom, full screen, pop-ups, offline; `heavy-web.txt` DuckDuckGo, Wikipedia, YouTube, needs internet, `SMOKE_TIMEOUT=900`; `keys.txt` every shortcut action, offline; `privacy-net.txt` DNT/GPC/Save-Data headers and third-party cookies on a loopback server, offline, start `python3 tests/smoke/net/server.py &` first; `site-doctor.txt` Google sign-in, captchas, Reddit, GitHub, needs internet; `cache.txt` HTTP cache, offline, start `python3 tests/smoke/cache/server.py &` first; selftest `launch <args>` checks single instance; `cookies.txt` → `cookies-restart.txt` → `cookies-cleared.txt` encrypted cookies across restarts with `SMOKE_KEYRING=1` (own throwaway GNOME Keyring + bus) and `SMOKE_HOME`, `cookies-nokeyring.txt` without, server.py first; `crash-adblock.txt` R5-01 regression, ~1300 blocked loads with reloads/navigations mid-load plus 3200 timers under GC pressure, offline, server.py first); header documents env vars and commands. `SMOKE_VISIBLE=1` shows the run on the user's screen (real GPU; page input synthesized in the page, no `rclick`/`resize`); it refuses to start unless the user's niri config has the `dev.nacre.Nacre` window rule from the smoke.sh header (DP-1, no focus), so it never moves the user's focus or workspace (D-044). WebKit state (S050): launch, basics, input, keys, chrome, dialogs, pip, auth, stores-*, integ-spell, net-*, privacy-net, privacy-mode, cache*, crash-adblock green hidden (loopback skips the bridge, no `NACRE_NO_BRIDGE` needed); other scripts not yet. Read the PNGs | now (S003, S046) |
| `nacre://gallery` + `SMOKE_SIZE=1400x2800 tools/smoke.sh tests/smoke/gallery.txt` | every design token and widget, dark and light (+ new tab and settings shots); read the PNGs | now (S015) |
| `SMOKE_SIZE=1400x1200 tools/smoke.sh tests/smoke/newtab.txt` | new tab page dark/light, nothing playing and a video playing, weather failed state, tall/narrow/phone widths (offline); `tests/smoke/newtab-weather.txt` shoots the real weather card (needs internet); read the PNGs | now (S017) |
| `SMOKE_SIZE=1400x900 tools/smoke.sh tests/smoke/backgrounds.txt` | every new tab background with the pointer, Customize panel dark/light, image + blur, GIF frames; `perf-*-a/b.json` `frames` (median/max draw ms, `drawn` count) per background at Lots/Fast, hidden tab, still, Motion off. Selftest `pointer x y`, `customize`; `@PAGESDIR@` = path of tests/smoke/pages | now (S018) |
@ -79,7 +79,7 @@ Never modify: `~/Documents/Apps/Nacre` (the original Python Nacre, reference onl
| `tools/smoke.sh tests/smoke/privacy-mode.txt` (+ `SMOKE_ARGS=--incognito … privacy-incognito.txt`) | privacy mode: `pages/fingerprint.html` read off/on, `fp-off.json`/`fp-on.json` + shots (offline); `privacy-net.txt` (needs `tests/smoke/net/server.py`) frame cookies, per-site pause, Accept-Language; `SMOKE_TIMEOUT=700 … coveryourtracks.txt` EFF's test off/on (internet, direct). Selftest `save <name> <js>` writes a JS string result to `<name>.json`; `SMOKE_ARGS` passes browser arguments | now (S024) |
| `python tools/icons.py` | rebuilds the icon font subset and `src/ui/icons.rs` from `tools/icons.txt` (needs fontTools and Arch's ttf-material-symbols-variable) | now (S015) |
| `tools/engine-test/run.sh servo\|chromium\|webkit` + `analyze.py` | engine comparison: one browser visible on DP-1, throwaway profile, sites from `sites.txt`, per-second RAM (PSS), CPU, GPU of the whole process tree into `docs/engine/runs/<engine>/samples.csv`; `webkit_shell.py` is the WebKitGTK 6.0 shell (needs `webkitgtk-6.0`); report `docs/engine/engine-comparison.md`. Never run two at once or alongside cargo | now |
| `tools/smoke.sh tests/smoke/pip.txt`, `python3 tests/smoke/net/server.py &` + `NACRE_NO_BRIDGE=1 tools/smoke.sh tests/smoke/auth.txt`, `tests/smoke/visible-ui.txt` (by hand, header) | PiP moves the live view and back (offline); HTTP sign-in cancel + saved login (offline); visible: portal file chooser, notification, page full screen, Web Inspector (`dialogs.txt` now also checks dialog answers, context menu, leave page, permission bars, notifications count) | now (S048) |
| `tools/smoke.sh tests/smoke/pip.txt`, `python3 tests/smoke/net/server.py &` + `SMOKE_SIZE=1280x900 tools/smoke.sh tests/smoke/auth.txt`, `tests/smoke/visible-ui.txt` (by hand, header) | PiP moves the live view and back (offline); HTTP sign-in cancel + saved login (offline); visible: portal file chooser, notification, page full screen, Web Inspector (`dialogs.txt` now also checks dialog answers, context menu, leave page, permission bars, notifications count) | now (S048) |
| `tools/hidden.sh <script> [outdir] [-- driver.sh]` | WebKit build hidden with a driver script: Xvfb → nested niri (`tools/nested-session.sh`), throwaway home, software GL, `NACRE_SCRIPT`; the driver gets `click`/`scroll` (`tools/wl-input`), `grab` (grim), `key`/`type` (wtype). Scripts in `tests/hidden/` (`basic.txt` offline; `web.txt` + `web-driver.sh` needs internet). Read the PNGs | now (S045) |
| appimagetool, wine + Inno Setup, VM "Windows 10" | packaging and Windows checks | see the user's global CLAUDE.md "Building" |

View file

@ -26,8 +26,8 @@ download manager stubs, HTTP cache on disk.
- [x] Remove the stale PROGRESS "Later" line about the niri window rule (fixed by D-045, e434bd2).
- [x] Navigation policy only for the tab's own (main frame) loads: WebKit's GTK API can't tell iframe navigations apart (`frame_name()` is empty for unnamed iframes), so HTTPS-only, the strip and the UA reload can take over a tab with a frame's URL today. Likely fix: the web process extension tells main-frame loads (found in S050).
- [x] Smoke (start `python3 tests/smoke/net/server.py &` / `cache/server.py &`): `net-privacy.txt`, `net-downloads.txt`, `privacy-net.txt`, `privacy-mode.txt`, `cache.txt` + `cache-restart.txt` green hidden.
- [ ] Rerun the S046–S049 smokes hidden (the old selftest could pass with asserts unanswered): launch, basics, input, keys, chrome, dialogs, pip, auth, stores-*, integ-spell, net-adblock, crash-adblock; fix or log failures.
- [ ] PROGRESS entry, INDEX line, tracker, commit `S050: …`, push.
- [x] Rerun the S046–S049 smokes hidden (the old selftest could pass with asserts unanswered): launch, basics, input, keys, chrome, dialogs, pip, auth, stores-*, integ-spell, net-adblock, crash-adblock; fix or log failures.
- [x] PROGRESS entry, INDEX line, tracker, commit `S050: …`, push.
## End criteria
- The listed smokes exit 0 hidden; server `/log` shows DoH lookups through the bridge and the HTTPS upgrade.
@ -56,3 +56,5 @@ State in commit `S050 (WIP)`. Verified hidden: `net-privacy.txt` and `net-downlo
setting User-Agent in `send-request` for accounts.google.com); (3) `privacy-mode.txt`, `cache.txt` +
`cache-restart.txt` not run yet; (4) PROGRESS/INDEX/final commit.
- Not done on purpose: WebKit-only (`blob:`) downloads don't ask where to save and can't pause.
Closed 2026-11-13: every open item above done (PROGRESS "S050").

View file

@ -13,7 +13,7 @@ Engine switch to WebKit (D-032): new category `08 WebKit engine` comes first; Se
- [x] [S047 — Page scripts, page messages, find and JS on WebKit](08%20WebKit%20engine/S047-page-channel.md) · Opus medium
- [x] [S048 — WebKit UI callbacks: pop-ups, dialogs, menus, permissions, full screen, inspector, PiP](08%20WebKit%20engine/S048-ui-callbacks.md) · Opus high
- [x] [S049 — Ad blocker on WebKit: content filters + web process extension](08%20WebKit%20engine/S049-adblock-webext.md) · Opus high
- [ ] [S050 — Network bridge, HTTPS-only, certificates, error pages, privacy switches, downloads](08%20WebKit%20engine/S050-net-privacy-downloads.md) · Opus medium
- [x] [S050 — Network bridge, HTTPS-only, certificates, error pages, privacy switches, downloads](08%20WebKit%20engine/S050-net-privacy-downloads.md) · Opus medium
- [ ] [S056 — Daily-use fixes from the user's first WebKit test: freeze, side buttons, real PiP, page menu](08%20WebKit%20engine/S056-daily-use-fixes.md) · Opus high
- [ ] [S051 — Profile folder, sealed cookies, site data, incognito, media source](08%20WebKit%20engine/S051-profile-cookies-media.md) · Opus medium
- [ ] [S052 — WebKit tuning defaults, background tabs, memory check](08%20WebKit%20engine/S052-tuning-defaults.md) · Sonnet high

View file

@ -401,7 +401,18 @@ Later: S010 list: user checks the Discord icon with their own client (the Discor
- Not done: images permission still not enforced on WebKit (could be one more small filter); privacy-net end criterion (S050); no visible run.
- Later: uBO resources (google-ima.js etc.) as stand-ins; `@@` exceptions don't stop extension redirects; `$removeparam` rules.
## S050 — Network on WebKit: bridge, HTTPS-only, certificates, error pages, privacy switches, downloads, cache (2026-11-13)
- Done: WebKit reaches the bridge over SOCKS5 (`Bridge::socks_url`; libsoup's HTTP proxy path dropped the login and GETs the bridge itself), loopback skips it; `decide-policy` → `actions::on_navigation` (HTTPS-only, strip, app scope, external apps, downloads by MIME/Content-Disposition); certificate warning + allow per host; Nacre error pages; downloads through `net::download`/manager hand-off; third-party cookies = NoThirdParty + ITP; Accept-Language; `policy::decide` incl. the images permission.
- Google UA quirk: WebKit's own site-specific quirks put a Safari UA on Google's requests over a view's set UA; the per-view settings copy turns them off.
- Frames: the GTK API has no frame info, so a frame's navigation took over the tab (HTTPS-only/strip/UA reload). Now only the tab's own loads reach the browser: Nacre's loads (no headers), redirects while the main load is provisional, others unless a frame element has that URL (async page check). Gap: links followed inside a frame.
- D-040 amended: cache model DocumentBrowser (DocumentViewer has no HTTP disk cache); 4-tab hidden PSS median viewer 1147 MB vs browser 1128 MB.
- selftest `js`/`assert`/`save` wait for the page's answer (before, a run could pass with asserts unanswered).
- Verified hidden (every assert answered): net-privacy (+ frame/script-navigation checks), net-downloads, privacy-net, privacy-mode (WebKit values), cache + cache-restart; reruns of launch, basics, input, keys, chrome, dialogs, pip, auth, net-adblock, crash-adblock, stores-* (+ checks), integ-spell all exit 0 without `NACRE_NO_BRIDGE`. `cargo test` 78 + webext 1.
- Rerun fixes: input.txt first click waits (arrives >0.5 s hidden); auth.txt needs `SMOKE_SIZE=1280x900` (header now says so).
- Not done: `blob:` downloads don't ask where to save and can't pause; no visible run; net-real.txt (internet) not run.
## Later
- A link followed inside a frame still goes through the tab's navigation policy (WebKit's GTK API has no frame info; S050).
- file:// media outside the XDG user folders doesn't play (WebKit sandbox, D-043).
- Turnstile widget paints as a black half-disc (Servo painting of its iframe/shadow DOM, S006 site doctor).
- Google sign-in past the email step: press Next with a real account, by the user (S006).

View file

@ -1,6 +1,6 @@
# HTTP sign-in (S048): WebKit's authenticate request as Nacre's sign-in dialog: cancel, then a saved login filled in
# and sent. Offline: start `python3 tests/smoke/net/server.py &` first and run with NACRE_NO_BRIDGE=1 (loopback
# through the bridge fails until S050). Read the PNGs.
# and sent. Offline: start `python3 tests/smoke/net/server.py &` first and run with SMOKE_SIZE=1280x900 (the button tap's
# coordinates). Read the PNGs.
wait 3
open http://127.0.0.1:8767/auth
wait 2

View file

@ -7,8 +7,8 @@ open @PAGES@/input.html
waitload
wait 1
click 60 35
wait 0.5
assert window.clicks === 1 && location.hash === "#clicked"
# The first click can take over a second to arrive in the hidden session (S050).
waitfor 5 window.clicks === 1 && location.hash === "#clicked"
click 60 85
wait 0.3
pagetype hello