Merge branch 'main' into s022-mse-proto
This commit is contained in:
commit
49ed08cf06
37 changed files with 862 additions and 48 deletions
|
|
@ -11,14 +11,15 @@ Verify passwords/vault and autofill, permissions prompts, history/bookmarks/down
|
|||
- `src/ui/pages/mod.rs` (list of pages)
|
||||
|
||||
## Steps
|
||||
- [ ] Script: open every nacre:// page and take a shot; check none panics or renders empty
|
||||
- [ ] Vault: create, lock/unlock, save a login from a local form page, autofill it, export/import; check the vault file is encrypted
|
||||
- [ ] Permissions: a local page asking for notifications/geolocation/camera; allow/deny/remember; check `permissions` store
|
||||
- [ ] History, bookmarks (add, folder, bookmarks bar, import/export HTML), downloads page lists entries
|
||||
- [ ] User scripts/styles apply on matching pages; install a site as an app and launch it
|
||||
- [ ] Importer: build a fake old-Nacre profile from `~/Documents/Apps/Nacre` config format in a temp dir (never the user's real profile) and import it
|
||||
- [ ] Change a sample of settings via `set` and via clicks; check `settings.json` and the effect; mark FEATURES rows
|
||||
- [ ] PROGRESS entry, INDEX line, commit `S008: …` and push
|
||||
- [x] Script: open every nacre:// page and take a shot; check none panics or renders empty
|
||||
- [x] Vault: create, lock/unlock, save a login from a local form page, autofill it, export/import; check the vault file is encrypted
|
||||
- [x] Permissions: a local page asking for notifications/geolocation/camera; allow/deny/remember; check `permissions` store
|
||||
- [x] History, bookmarks (add, folder, bookmarks bar, import/export HTML), downloads page lists entries
|
||||
- [x] User scripts/styles apply on matching pages; install a site as an app and launch it
|
||||
- [x] Importer: build a fake old-Nacre profile from `~/Documents/Apps/Nacre` config format in a temp dir (never the user's real profile) and import it
|
||||
- [x] R1-20 per-site memory and enforcement: set per-site zoom, ad blocker on/off, privacy-mode flag (flag persistence only; internals are D-011) and other per-site choices; set per-site permissions (camera, mic, location, notifications, pop-ups, autoplay, …); quit, relaunch with `SMOKE_HOME=<first outdir>/home`, check values are in the stores and apply again on reopening the site; check each permission is enforced (blocked/allowed/asked per its stored value), not only stored; fix what is not
|
||||
- [x] Change a sample of settings via `set` and via clicks; check `settings.json` and the effect; mark FEATURES rows
|
||||
- [x] PROGRESS entry, INDEX line, commit `S008: …` and push
|
||||
|
||||
## End criteria
|
||||
- Every nacre:// page has a non-blank screenshot in the run dir.
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ Verify Discord Rich Presence, media session and visualizer, spell check, update
|
|||
- [ ] Updates: point the update URL at a local JSON file; check the notice and that nothing downloads automatically
|
||||
- [ ] Gamepad: check it enumerates without a device and doesn't spin the CPU; single instance: second launch forwards a URL
|
||||
- [ ] Performance: freeze/discard idle tabs and memory saver numbers; mark FEATURES rows verified/broken
|
||||
- [ ] R4-09 Discord site icon: `icon_url` in `src/discord.rs` (https image/favicon, else the origin's /favicon.ico) is written, **not compiled yet**; build, run `nice cargo test --release -j 2 icon_prefers`, see the icon in the fake-IPC `SET_ACTIVITY` frame (`assets.large_image`), user confirms in real Discord; app ID stays in Settings, never in code
|
||||
- [ ] PROGRESS entry, INDEX line, commit `S009: …` and push
|
||||
|
||||
## End criteria
|
||||
|
|
|
|||
|
|
@ -24,27 +24,27 @@ branch lands on main at the end of S028 (see S028), not here.
|
|||
all init segments), the MSE spec "init segment received" and HAVE_METADATA steps.
|
||||
|
||||
## Steps
|
||||
- [ ] `git merge main` into `s022-mse-proto` (worktree), build, `tools/smoke.sh tests/smoke/mse.txt` still green
|
||||
- [ ] Vendor the gst_mse library + mse plugin sources (1.28.9, LGPL-2.1, keep headers and COPYING) into
|
||||
- [x] `git merge main` into `s022-mse-proto` (worktree), build, `tools/smoke.sh tests/smoke/mse.txt` still green
|
||||
- [x] Vendor the gst_mse library + mse plugin sources (1.28.9, LGPL-2.1, keep headers and COPYING) into
|
||||
`vendor/gst-mse/` with a small meson (or cc) build; `tools/gst-mse.sh` builds `libgstmse-1.0.so.0` and the
|
||||
plugin into `target/gst-mse/`. Mark every change "Nacre patch".
|
||||
- [ ] Load our copy: the library ahead of the system one (rpath or `LD_LIBRARY_PATH` set before GStreamer
|
||||
- [x] Load our copy: the library ahead of the system one (rpath or `LD_LIBRARY_PATH` set before GStreamer
|
||||
init — check which works with gstreamer-mse-sys) and the plugin via `GST_PLUGIN_PATH`/registry; log the
|
||||
loaded path once. Decide and record how release builds find it.
|
||||
- [ ] Bug 1: signal update/update-end only after the end-of-append for that append has been consumed
|
||||
- [x] Bug 1: signal update/update-end only after the end-of-append for that append has been consumed
|
||||
(`consume_all_samples` done); C test: buffered is non-empty at the first update-end after a media segment
|
||||
- [ ] Bug 2: no update/update-end without an outstanding append/removal; C test: no signals while idle for 3 s
|
||||
- [ ] Bug 3: msesrc exposes no streams (and stays HAVE_NOTHING) until every SourceBuffer of the attached
|
||||
- [x] Bug 2: no update/update-end without an outstanding append/removal; C test: no signals while idle for 3 s
|
||||
- [x] Bug 3: msesrc exposes no streams (and stays HAVE_NOTHING) until every SourceBuffer of the attached
|
||||
MediaSource has received its first init segment; C test with two SourceBuffers (audio fMP4 + video WebM),
|
||||
video init appended 2 s before audio, then both play
|
||||
- [ ] Remove the settle work-around (`SETTLE`, `pending`) from `vendor/servo-media-gstreamer/mse.rs`; rebuild;
|
||||
- [x] Remove the settle work-around (`SETTLE`, `pending`) from `vendor/servo-media-gstreamer/mse.rs`; rebuild;
|
||||
`tests/smoke/mse.txt` green
|
||||
- [ ] Add a two-SourceBuffer case to `tests/smoke/pages/mse-basic.html` (`?split`: audio-only + video-only clips,
|
||||
- [x] Add a two-SourceBuffer case to `tests/smoke/pages/mse-basic.html` (`?split`: audio-only + video-only clips,
|
||||
video appended first); smoke asserts it plays
|
||||
- [ ] YouTube probe (heavy-web.txt watch-page steps): record codecs, readyState, currentTime, picture in the shot
|
||||
- [ ] Write the patches up for upstream (`docs/engine/gst-mse-patches.md`: what, why, test), no MR opened
|
||||
- [x] YouTube probe (heavy-web.txt watch-page steps): record codecs, readyState, currentTime, picture in the shot
|
||||
- [x] Write the patches up for upstream (`docs/engine/gst-mse-patches.md`: what, why, test), no MR opened
|
||||
without the user's OK
|
||||
- [ ] PROGRESS entry, DECISIONS if the loading scheme binds S030, INDEX line, commit `S026: …` on the branch, push the branch
|
||||
- [x] PROGRESS entry, DECISIONS if the loading scheme binds S030, INDEX line, commit `S026: …` on the branch, push the branch
|
||||
|
||||
## End criteria
|
||||
- `tools/gst-mse.sh` builds; the C tests for bugs 1–3 pass (command in the plan's PROGRESS entry).
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h
|
|||
- [x] [S005 — Per-tab painters on one GL context](02%20Verify/S005-gl-painters.md) · Opus high
|
||||
- [x] [S006 — Browser basics pass](02%20Verify/S006-verify-basics.md) · Opus medium
|
||||
- [x] [S007 — Network pass](02%20Verify/S007-verify-network.md) · Opus medium
|
||||
- [ ] [S008 — Stores and pages pass](02%20Verify/S008-verify-stores.md) · Sonnet high
|
||||
- [x] [S008 — Stores and pages pass](02%20Verify/S008-verify-stores.md) · Sonnet high
|
||||
- [ ] [S009 — Integrations pass](02%20Verify/S009-verify-integrations.md) · Sonnet high
|
||||
- [ ] [S010 — Phase 2 review with the user](02%20Verify/S010-phase2-review.md) · Sonnet medium · 🧑
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h
|
|||
|
||||
## 05 Engine
|
||||
- [x] [S022 — MediaSource (MSE) spike](05%20Engine/S022-mse-spike.md) · Opus high · 🧑
|
||||
- [ ] [S026 — Fix gst_mse for split audio/video MSE](05%20Engine/S026-gst-mse-fixes.md) · Opus high
|
||||
- [x] [S026 — Fix gst_mse for split audio/video MSE](05%20Engine/S026-gst-mse-fixes.md) · Opus high
|
||||
- [ ] [S027 — MSE DOM to spec](05%20Engine/S027-mse-dom-spec.md) · Opus high
|
||||
- [ ] [S028 — MSE player integration and merge to main](05%20Engine/S028-mse-player.md) · Opus high
|
||||
- [ ] [S029 — YouTube and Reddit video pass](05%20Engine/S029-youtube-reddit-pass.md) · Opus high · 🧑
|
||||
|
|
|
|||
|
|
@ -18,3 +18,4 @@
|
|||
- D-013 — 2026-11-12 — New plans: S022 MSE spike (05 Engine) runs right after S006; privacy plans S023 (request headers + third-party cookies in the vendored servo-net), S024 (privacy mode, R1-16), S025 (encrypted cookies, R1-19) run after S009, before the S010 review. — The user wants real YouTube playback in the page (no yt-dlp workaround) and asked whether missing Servo features can be added from reference engines; the spike sizes MSE before committing weeks to it. — S006–S025 run order
|
||||
- D-014 — 2026-11-12 — Two more Nacre patches in the vendored servo-net (D-012), marked "Nacre patch": `fetch/methods.rs` lets the certificate warning's `chrome:allowcert` request through (it ended as UnsupportedScheme, so "Open anyway" never worked); `http_cache.rs` `flush_to_disk` + `resource_thread.rs` Exit write the memory HTTP cache to the disk cache at quit (Servo only wrote evicted entries, so a session's cache was lost). — Both are Servo 0.7 bugs the embedder can't work around. — any plan that upgrades Servo: re-check both, re-run `tests/smoke/net-privacy.txt` and `cache.txt` + `cache-restart.txt`
|
||||
- D-015 — 2026-11-12 — MSE: go, option A (S022). Keep GStreamer's gst_mse library for parsing and coded frame processing; Nacre fixes its three 1.28.9 defects (early update-end, idle ticks, split A/V init segments) in its own copy of the library and plugin, plus a thin MSE DOM in the vendored `servo-script`/`servo-script-bindings`/`servo-media*` crates (`[patch.crates-io]`, like D-012). Option B (an own MSE core in Rust feeding appsrc) is the fallback only if bug 3 can't be fixed in msesrc. Plans S026–S030 run after S009 and before S023–S025. The prototype branch `s022-mse-proto` carries S026–S027 and merges into main in S028. — Decided by the orchestrator overnight on the user's standing OK; the user wants engine fixes, not workarounds (no yt-dlp). The spike showed gst_mse does the hard parts, and the blockers are concrete (docs/engine/mse-spike.md). — S026–S030, any Servo upgrade (drop the patches when Servo ships MSE)
|
||||
- D-016 — 2026-11-12 — Patched gst_mse loading (S026). Nacre ships its own `libgstmse-1.0.so.0` and `mse` plugin built from `vendor/gst-mse` (`tools/gst-mse.sh`). Release layout: library in `<exe dir>/lib/`, plugin in `<exe dir>/lib/gstreamer-1.0/`; a dev build uses `target/gst-mse/{lib,gstreamer-1.0}`. The binary's RUNPATH (`$ORIGIN/lib:$ORIGIN/../gst-mse/lib`, from `build.rs`) finds the library ahead of the system copy (same soname), and `main.rs` prepends the plugin dir to `GST_PLUGIN_PATH` before GStreamer starts (paths in GST_PLUGIN_PATH beat the system plugin of the same name). Windows: the DLLs sit next to `nacre.exe` / in `lib\gstreamer-1.0` (unverified). — RUNPATH needs no wrapper script or re-exec; LD_LIBRARY_PATH would have to be set before the process starts. — S030 packaging (AppImage, tarball, Windows), S028 merge
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Every item of the settings screenshot and of the original Nacre's `config.py`, w
|
|||
| Address bar: URL or search, suggestions (history, bookmarks, tabs, pages, engine), Alt+Enter new tab | `ui/chrome.rs`, `util::address_to_url` | verified S006 (URL, search: basics.txt; suggestions: chrome.txt); Alt+Enter not checked |
|
||||
| Back/forward (with history list), reload, hard reload, home | `actions.rs` | verified S006 (back, forward, reload, hard reload, home: basics.txt, keys.txt); history list not checked; "stop" has no Servo API |
|
||||
| Find in page (count, next/previous, match case) | `inject.rs` FIND_JS, `ui/dialogs.rs` | verified S006 (count, next, previous: basics.txt, keys.txt); match case not checked |
|
||||
| Zoom per site, Ctrl+wheel | `actions.rs`, settings `web.zoom_sites` | verified S006 (in, out, reset: basics.txt, keys.txt); per site and Ctrl+wheel not checked |
|
||||
| Zoom per site, Ctrl+wheel | `actions.rs`, settings `web.zoom_sites` | verified S006 (in, out, reset: basics.txt, keys.txt), S008 (per site: saved, back after a restart, applied to a new tab: site-memory*.txt; the tab's zoom now follows the site's value, was stale on new tabs); Ctrl+wheel not checked |
|
||||
| Full screen (F11 and page fullscreen) | `app.rs` | verified S006 (basics.txt: F11, page request, Escape leaves) |
|
||||
| Context menu (links, images, media, selection, spelling, page) | `ui/menus.rs` | verified S006 (page menu: input.txt rclick); link/image/media/selection/spelling menus not checked |
|
||||
| Page dialogs: alert/confirm/prompt, HTTP sign-in, select, colour, file picker, leave page | `ui/dialogs.rs`, `app.rs` | verified S006 (alert, confirm, prompt, select, colour: dialogs.txt); HTTP sign-in, file picker, leave page not checked |
|
||||
|
|
@ -26,7 +26,7 @@ Every item of the settings screenshot and of the original Nacre's `config.py`, w
|
|||
| Task manager, free up memory | `ui/pages/misc.rs` | verified S006 (task manager opens: keys.txt); free memory not checked |
|
||||
| Keyboard shortcuts, rebindable | `keys.rs`, settings | verified S006 (every action by `do` in basics.txt + keys.txt except save page, print, incognito, quit; key parsing unit test); rebinding not checked |
|
||||
| Gamepads (W3C standard mapping), Web Bluetooth device picker | `app.rs poll_gamepads`, `ui/dialogs.rs` | not checked in S006 (no device in tests); rumble reports unsupported |
|
||||
| Notifications (notify-send or in-app) | `app.rs` | not checked in S006 |
|
||||
| Notifications (notify-send or in-app) | `app.rs` | permission asked, remembered, denied/granted to the page verified S008 (site-memory*.txt); showing the notification itself (notify-send) not checked |
|
||||
|
||||
## General (screenshot)
|
||||
| Setting | State |
|
||||
|
|
@ -38,11 +38,18 @@ Every item of the settings screenshot and of the original Nacre's `config.py`, w
|
|||
| Profiles (list, add, delete, open) | written |
|
||||
| Spell check (languages, dictionaries downloaded, suggestions, add word) | written (`spell.rs`, SPELL_JS) |
|
||||
| Keyboard shortcuts | written |
|
||||
| Import from another browser (Chromium/Firefox families; bookmarks file; passwords CSV) | written (`importer.rs`) |
|
||||
| Import from another browser (Chromium/Firefox families; bookmarks file; passwords CSV) | verified S008 (stores-import.txt on fake Chrome + Firefox profiles in a throwaway home: bookmarks, folders, history, home page, search engine; bookmarks HTML and passwords CSV: stores-lists.txt, stores-vault.txt through the store, not the file dialog); no importer for the old Python Nacre's JSON stores; Windows paths not checked |
|
||||
| New tab shortcuts and page elements, backgrounds, weather, notes | written (`ui/pages/newtab.rs`) |
|
||||
| Custom title bar | written (restart) |
|
||||
| Floating content card | written |
|
||||
|
||||
**Stores and pages (S008):** every nacre:// page opens with a non-blank shot (stores-pages.txt + tools/check-shots.py). History
|
||||
(visits recorded, page lists them, back after a restart), bookmarks (add, folder, bar, Netscape HTML export/import through the
|
||||
store, page, back after a restart), downloads page lists a finished file (stores-lists*.txt). Settings changed with `set` apply
|
||||
and reach settings.json (stores-settings.txt: default zoom, vault off/on, theme, search engine, home page, bookmarks bar) and
|
||||
tapped controls write settings (settings-write.txt, tap position fixed after the privacy page grew). Not checked: the native
|
||||
file dialogs behind Import/Export, history delete/search from the page, bookmark drag and edit, downloads clear.
|
||||
|
||||
## Appearance
|
||||
Colour source (website/system/palette/custom), fallback, palette swatches, mode, scheme style and contrast, motion,
|
||||
roundness, websites light/dark, force dark, interface size: written (`theme.rs`, settings page). The Material You look
|
||||
|
|
@ -75,13 +82,13 @@ written.
|
|||
| Privacy mode (+ in incognito) | written (PRIVACY_JS) |
|
||||
| Secure DNS (Cloudflare, Quad9, Google, Mullvad, AdGuard, custom) | verified S007 with a custom endpoint on a local stub (net-privacy.txt: names only the stub knows load); the public providers not contacted in tests |
|
||||
| HTTPS-only mode with fallback prompt and exceptions | verified S007 (net-privacy.txt: upgrade via the `location.replace()` page, certificate warning "Open anyway" (fixed: servo-net patch), fallback prompt + Open anyway, site stays http this session, local addresses never upgraded); "Always for this site" not tapped |
|
||||
| Site settings (defaults and per-site) | written |
|
||||
| Site settings (defaults and per-site) | verified S008 (site-memory*.txt, restart): stored per site, applied again after a restart. Enforced: pop-ups, notifications, images (hub blocks image requests), sound (tab muted on load), Servo's own requests, open-other-apps. Shown as "Not available" (Servo 0.7): location (navigator.geolocation never answers), camera, microphone, device list (no navigator.mediaDevices), persistent storage (no navigator.storage), clipboard, JavaScript. Per-site privacy-mode flag does not exist (privacy mode is global; S024) |
|
||||
| Delete browsing data (+ on exit) | written |
|
||||
| Send Do Not Track and GPC | partial: JS only (no headers in Servo 0.7) |
|
||||
| Remove tracking parameters | verified S007 (net-privacy.txt: utm_*/fbclid removed, other parameters kept, off keeps all) |
|
||||
| Block third-party cookies | engine limit, shown as unavailable |
|
||||
| Google sign-in quirk | written (UA switch + JS) |
|
||||
| Sites where ad blocking is paused | written |
|
||||
| Sites where ad blocking is paused | verified S007 (net-adblock.txt), persisted S008 (site-memory*.txt) |
|
||||
| Remote debugging, user agent | written |
|
||||
|
||||
## Ad blocker
|
||||
|
|
@ -114,11 +121,11 @@ limit, shown as unavailable.
|
|||
## Passwords and autofill
|
||||
Encrypted vault (device key or master password, auto-lock, re-ask before showing), save prompt, autofill, strong
|
||||
password suggestion, addresses and cards, CSV import/export, generator, weak/reused check: written
|
||||
(`store/vault.rs`, AUTOFILL_JS, `ui/pages/passwords.rs`).
|
||||
(`store/vault.rs`, AUTOFILL_JS, `ui/pages/passwords.rs`). Verified S008 (stores-vault.txt + stores-vault-check.sh): save prompt from a local form, autofill of the one saved login, master password (key file removed, wrong password refused, lock empties the vault, no autofill while locked), unlock, CSV export, CSV import (own and Chrome format, duplicates and bad rows skipped), vault.json holds no plain text and is mode 600. Not checked: addresses, cards, generator, weak/reused list, auto-lock timer, re-ask before reveal, the strong password suggestion dropdown.
|
||||
|
||||
## Apps
|
||||
Install site as app (own window, launcher entry), desktop shortcut, user scripts and styles (stand-in for extensions):
|
||||
written.
|
||||
verified S008 (stores-apps.txt): .user.js and .user.css installed by address run on matching pages and not on others; install as app writes the launcher entry and the app opens its own window. Not checked: desktop shortcut, uninstall, editing a script, disable toggle, @exclude, run-at start/idle.
|
||||
|
||||
## About
|
||||
Version, engine, colour, profile paths, update repository, automatic and manual update check: written
|
||||
|
|
|
|||
|
|
@ -75,3 +75,9 @@ For the next `/orchestrate` run. Read this before picking the "first unchecked p
|
|||
the former spare local_373e46d7-2d38-4d5a-94c4-855dae433f88. S027–S030 have no session yet: reuse an idle finished
|
||||
session (r1-11 local_48b023e1-…, r1-10 local_3487b672-…, r1-flyouts local_fbdfe092-…, r1-21 local_4d846ded-…,
|
||||
s021 local_3e6a6b37-…, s022 local_7fddd5dd-…) by message, or start fresh ones when the user is back.
|
||||
- Update (after the usage-limit reset): S008, S026 done and validated (site-memory restart smoke p1/p2 pass; mse.txt
|
||||
split A/V plays on branch s022-mse-proto). S009 running on main (local_28f452cc-…). S027 running in the worktree
|
||||
(local_c15ace99-33b1-45b0-8fb6-bfb77cca68ce). Waiting for GO: S028 local_c57574e1-48d8-40b4-9a0c-386b7079f666,
|
||||
S029 local_b1da3720-150b-45f9-8689-684e25ef97af, S030 local_dea5e96f-16c8-4e0a-a13d-5105f2fa5c98, S023/S024/S025 (ids
|
||||
above). Spares: spare-a local_373e46d7-… (did S026), spare-b local_4fb2df64-5994-4b0d-a834-cff2859cf94b.
|
||||
Order: S009 ∥ S027 → S028 (merges the branch to main) → S029 → S030 → S023 → S024 → S025 → S010 (🧑).
|
||||
|
|
|
|||
|
|
@ -265,6 +265,22 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done,
|
|||
- Not done: Windows runtime not tried in the VM (sizes from the release index only); seeking and quality switches untested.
|
||||
- Later: Servo refuses fetch/XHR of file:// from file:// pages (smoke clips are base64 scripts); the selftest `js` probe can hang when the script thread blocks (seen once on YouTube).
|
||||
|
||||
## S008 — Stores and pages pass (2026-11-12)
|
||||
- New (offline; `python3 -m http.server 8768 --bind 127.0.0.1 --directory tests/smoke/pages &` and `python3 tests/smoke/net/server.py &` first): `stores-pages.txt` + `tools/check-shots.py` (17 pages, none blank), `stores-vault.txt` + `-check.sh`, `stores-lists.txt` + `-restart.txt`, `stores-apps.txt`, `stores-import.txt` (+ `make-import-home.py`), `stores-settings.txt` + `-check.sh`, `site-memory.txt` + `-restart.txt` (R1-20). Selftest: `perm`, `prompt`, `vault`, `bookmarks`, `cmd import|install_script|open_app`, status `permissions`, `site_state`, `scripts`, `vault_mode`, `bookmark_folders`.
|
||||
- Fixed (R1-20): Images permission did nothing (hub now blocks image requests per site); Sound block did nothing (tab muted on load); menu/page permission edits reached permissions.json only at exit (now saved at once and the hub refreshed); a new tab showed 100 % zoom for a site with saved zoom (tab.zoom stale); settings-write.txt privacy tap moved with the page layout.
|
||||
- Shown "Not available" (Servo 0.7, `Kind::engine_limit`): location, camera, microphone, device list, persistent storage, clipboard, JavaScript.
|
||||
- Green: all new scripts, launch, restore, 61 unit tests. site-memory restart failed 3 times in a row once under heavy machine load (image still loaded at the first check), passed 8 times after; cause not found.
|
||||
- Not done: per-site privacy-mode flag (privacy mode is global, S024); importer for the old Python Nacre's JSON stores (none exists); native file dialogs behind Import/Export; addresses, cards, generator, auto-lock timer; notification display; user-script disable/edit/exclude.
|
||||
- Later: tab titles of nacre:// pages show a generic icon; selftest `set` with a bad value only logs (does not fail the run).
|
||||
|
||||
## S026 — gst_mse fixes for split audio/video MSE (2026-11-12, branch s022-mse-proto)
|
||||
- Our gst_mse 1.28.9 copy in `vendor/gst-mse/` (LGPL, `nacre.patch`, write-up `docs/engine/gst-mse-patches.md`); `tools/gst-mse.sh` builds it into `target/gst-mse/`. Nacre finds the library by RUNPATH (`build.rs`) and the plugin by GST_PLUGIN_PATH (`src/main.rs`), and logs both paths (D-016).
|
||||
- Fixed: update-end before parsing (append now waits for its end-of-append), idle update/update-end ticks, streams exposed before every SourceBuffer's init segment (plus a leaked `media_source_lock`), msesrc pad task giving up on a not-yet-active peer (split A/V hung ~1 in 4). Settle work-around gone from `mse.rs`; `remove()` reports its own updateend (gst_mse's remove is a stub). Opus counts as supported with a decoder only (Arch has no opusparse).
|
||||
- Tests: `tools/gst-mse.sh test` (3 C tests, each fails on the system 1.28.9); `tools/smoke.sh tests/smoke/mse.txt` green incl. `?split` (video WebM first, audio fMP4 2 s later, picture shown).
|
||||
- YouTube (`tests/smoke/youtube-mse.txt`, internet): plays with picture and captions. Run 1 VP9 144p + Opus, time 8 → 10.7 s between 15 and 30 s (stalls); run 2 VP9 240p + Opus, played to the end ("Up next"); the js probe after the end never returned.
|
||||
- Not done: YouTube stalls and the hung js probe not investigated (S027/S028); the pad-task race only shows in the C test under CPU load.
|
||||
- Later (S027/S028): coded frame removal in gst_mse (`remove` is a stub); `HTMLMediaElement.buffered` from the MediaSource; script thread blocking (S022 note) seen again after the video ended.
|
||||
|
||||
## Later
|
||||
- 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).
|
||||
|
|
|
|||
|
|
@ -47,5 +47,5 @@ State tags: `[open]`, `[fixed <commit>]`, `[wontfix: reason]`. Severity: high /
|
|||
- R1-17 [fixed 7e6c701] QR flyout looks broken: the code sits at the top of a tall, empty panel (`docs/ui-reference/bug-qr-flyout.png`). Size the panel to its content. Severity: medium. (user) → chrome follow-up.
|
||||
- R1-18 [fixed 7e6c701] Flyouts must be friendly and polished like the old browser's passwords, downloads and history flyouts the user likes (`docs/ui-reference/old-flyout-*.png`: title + action icons, sections with accent labels, rows with icon/title/subtitle/time, search pill, clear empty states). Review every flyout and page with the `app-taste` and `unslop` skills; "everything should be user friendly". Severity: medium. (user) → chrome follow-up + S021 review.
|
||||
- R1-19 [open] Protect cookies against theft (infostealers copying the profile to hijack sessions). Idea to verify: Servo's `Opts.config_dir` persists cookies as plain files, and `site_data_manager()` has `cookies_for_url` / `set_cookie_for_url` / `clear_cookies` (DESIGN.md). So Nacre could run Servo with temporary storage and keep cookies itself, encrypted at rest with a key held in the OS keyring (Secret Service/KWallet on Linux, DPAPI on Windows), restoring them at start; plus "clear cookies on close" (setting exists) and, in privacy mode, best-effort removal of third-party cookies through the site data manager. General rule from the user: where Servo can't do something properly, Nacre may add its own layer (inject.rs scripts, site data manager, bridge) instead of only showing an engine limit; record each in DESIGN.md. Severity: high. (user) → with R1-16 (privacy plan).
|
||||
- R1-20 [open] Per-site memory must persist and work: zoom/page size, ad blocker on/off per site, privacy mode and other per-site choices are saved, survive a restart, and apply again when the site is opened; site permissions (camera, microphone, location, notifications, pop-ups, autoplay, ...) are really enforced per site, not just stored. Verify with a restart test in a smoke script (set per-site values, quit, relaunch with SMOKE_HOME, check they apply). Severity: high. (user) → S008 (stores and pages pass).
|
||||
- R1-20 [fixed S008] Per-site memory must persist and work: zoom/page size, ad blocker on/off per site, privacy mode and other per-site choices are saved, survive a restart, and apply again when the site is opened; site permissions (camera, microphone, location, notifications, pop-ups, autoplay, ...) are really enforced per site, not just stored. Verify with a restart test in a smoke script (set per-site values, quit, relaunch with SMOKE_HOME, check they apply). Severity: high. (user) → S008 (stores and pages pass).
|
||||
- R1-21 [fixed 8049f6a] Interacting with nacre:// pages feels buggy and not clean. Example: a size (zoom/scale) slider applies its value while you drag, which re-lays out the page under the pointer, so the slider jumps and is hard to set. Sliders that change layout should preview without moving the control and commit on release; check every page's controls for this kind of jitter. Recording: `~/Videos/Recordings/recording_20261112_01-00-39.mp4` (watch it first). Severity: high. (user) → chrome/pages follow-up before S021.
|
||||
|
|
|
|||
|
|
@ -2088,7 +2088,7 @@ impl App {
|
|||
&& let Some(tab) = win.tab()
|
||||
&& tab.page.is_none()
|
||||
&& let Ok(url) = Url::parse(&tab.url)
|
||||
&& let Some(act) = crate::discord::browse_activity(&settings, &url, &tab.title, &tab.site_name, if tab.page_image.is_empty() { &tab.favicon_url } else { &tab.page_image }, tab.arrived_ms as i64)
|
||||
&& let Some(act) = crate::discord::browse_activity(&settings, &url, &tab.title, &tab.site_name, &tab.page_image, &tab.favicon_url, tab.arrived_ms as i64)
|
||||
{
|
||||
activity = Some((act, settings.client_id.clone()));
|
||||
}
|
||||
|
|
@ -2422,6 +2422,12 @@ impl App {
|
|||
|
||||
/// The UI edits settings in place; this notices and applies what changed.
|
||||
pub fn apply_settings_if_changed(&mut self) {
|
||||
let revision = self.shared.permissions.borrow().revision();
|
||||
if revision != self.permissions_seen {
|
||||
self.permissions_seen = revision;
|
||||
self.shared.permissions.borrow_mut().flush();
|
||||
self.refresh_hub_config();
|
||||
}
|
||||
let current = self.shared.settings.borrow().clone();
|
||||
if current == self.applied {
|
||||
return;
|
||||
|
|
|
|||
24
src/app.rs
24
src/app.rs
|
|
@ -182,6 +182,8 @@ pub struct App {
|
|||
pub gilrs: Option<gilrs::Gilrs>,
|
||||
pub gamepads: HashMap<gilrs::GamepadId, usize>,
|
||||
pub applied: Settings,
|
||||
/// `Permissions::revision` the hub and the file were last updated for.
|
||||
pub permissions_seen: u64,
|
||||
pub exiting: bool,
|
||||
last_tick: Instant,
|
||||
last_save: Instant,
|
||||
|
|
@ -307,6 +309,7 @@ impl App {
|
|||
gilrs: None,
|
||||
gamepads: HashMap::new(),
|
||||
applied: settings,
|
||||
permissions_seen: 0,
|
||||
exiting: false,
|
||||
last_tick: Instant::now(),
|
||||
last_save: Instant::now(),
|
||||
|
|
@ -392,7 +395,7 @@ impl App {
|
|||
|
||||
pub fn refresh_hub_config(&self) {
|
||||
let settings = self.shared.settings.borrow();
|
||||
*self.hub.config.borrow_mut() = HubConfig::from_settings(&settings, &self.shared.user_agent.borrow(), self.shared.http_allowed.borrow().clone());
|
||||
*self.hub.config.borrow_mut() = HubConfig::from_settings(&settings, &self.shared.permissions.borrow(), &self.shared.user_agent.borrow(), self.shared.http_allowed.borrow().clone());
|
||||
}
|
||||
|
||||
/// (Re)build the scripts every page gets. Applies on each page's next load.
|
||||
|
|
@ -540,13 +543,16 @@ impl App {
|
|||
}
|
||||
}
|
||||
self.check_app_scope(window, id, &url);
|
||||
if host_changed {
|
||||
let zoom = self.shared.settings.borrow().zoom_for(&util::host_of(&url));
|
||||
if let Some(tab) = self.tab_mut(id) {
|
||||
tab.zoom = zoom;
|
||||
if let Some(web) = &tab.web {
|
||||
web.webview.set_page_zoom(zoom);
|
||||
}
|
||||
// A zoom change is saved for the site at once, so the site's value is always the right one. Not only
|
||||
// when the host changed: a new tab already holds its address when the first event arrives.
|
||||
let zoom = self.shared.settings.borrow().zoom_for(&util::host_of(&url));
|
||||
if let Some(tab) = self.tab_mut(id) {
|
||||
let differs = (tab.zoom - zoom).abs() > 0.001;
|
||||
tab.zoom = zoom;
|
||||
if (host_changed || differs)
|
||||
&& let Some(web) = &tab.web
|
||||
{
|
||||
web.webview.set_page_zoom(zoom);
|
||||
}
|
||||
}
|
||||
self.redraw(window);
|
||||
|
|
@ -810,7 +816,7 @@ impl App {
|
|||
}
|
||||
// Mute state survives navigation.
|
||||
let shared = self.shared.clone();
|
||||
let muted = self.tab_mut(id).map(|t| t.muted || shared.settings.borrow().site_muted(&util::host_of_str(&t.url))).unwrap_or(false);
|
||||
let muted = self.tab_mut(id).map(|t| t.muted || shared.settings.borrow().site_muted(&util::host_of_str(&t.url)) || shared.permissions.borrow().answer(&shared.settings.borrow(), &util::host_of_str(&t.url), crate::store::permissions::Kind::Sound) == crate::store::permissions::Answer::Block).unwrap_or(false);
|
||||
if muted && let Some(tab) = self.tab_mut(id) {
|
||||
tab.muted = true;
|
||||
if let Some(web) = &tab.web {
|
||||
|
|
|
|||
|
|
@ -111,6 +111,19 @@ fn https_short(url: &str) -> bool {
|
|||
url.starts_with("https://") && url.len() <= 256
|
||||
}
|
||||
|
||||
/// Image for the activity's large icon: the first of `images` Discord can fetch (short https URL),
|
||||
/// else the page origin's /favicon.ico (data:/http:/long favicon URLs are unusable; no third-party
|
||||
/// service, so no visited host leaks beyond Discord). Empty for pages without a host.
|
||||
fn icon_url(images: &[&str], page: &Url) -> String {
|
||||
if let Some(img) = images.iter().find(|i| https_short(i)) {
|
||||
return (*img).to_owned();
|
||||
}
|
||||
match page.host_str() {
|
||||
Some(host) if matches!(page.scheme(), "http" | "https") => format!("https://{host}/favicon.ico"),
|
||||
_ => String::new(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Options that Discord clients may refuse; the worker turns them off when it is told so.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct Quirks {
|
||||
|
|
@ -137,7 +150,7 @@ pub fn media_activity(settings: &Rpc, tab_url: &Url, tab_title: &str, favicon: &
|
|||
}
|
||||
}
|
||||
if !https_short(&art) {
|
||||
art = if https_short(favicon) { favicon.to_owned() } else { String::new() };
|
||||
art = icon_url(&[favicon], tab_url);
|
||||
}
|
||||
let by = if creator != name { format!("by {creator}") } else { name.clone() };
|
||||
let mut act = json!({
|
||||
|
|
@ -179,7 +192,7 @@ pub fn media_activity(settings: &Rpc, tab_url: &Url, tab_title: &str, favicon: &
|
|||
}
|
||||
|
||||
/// "Browsing" activity for an ordinary tab. `since_ms` is when the user arrived on the page.
|
||||
pub fn browse_activity(settings: &Rpc, url: &Url, title: &str, site_name: &str, image: &str, since_ms: i64) -> Option<Value> {
|
||||
pub fn browse_activity(settings: &Rpc, url: &Url, title: &str, site_name: &str, image: &str, favicon: &str, since_ms: i64) -> Option<Value> {
|
||||
if settings.browsing == RpcBrowsing::Off || !matches!(url.scheme(), "http" | "https") {
|
||||
return None;
|
||||
}
|
||||
|
|
@ -199,8 +212,9 @@ pub fn browse_activity(settings: &Rpc, url: &Url, title: &str, site_name: &str,
|
|||
"timestamps": {"start": since_ms},
|
||||
"assets": {"large_text": clip(&host, 128)},
|
||||
});
|
||||
if https_short(image) {
|
||||
act["assets"]["large_image"] = json!(image);
|
||||
let icon = icon_url(&[image, favicon], url);
|
||||
if !icon.is_empty() {
|
||||
act["assets"]["large_image"] = json!(icon);
|
||||
}
|
||||
if by_title && settings.button {
|
||||
act["buttons"] = json!([{"label": util::ellipsize(&format!("Open on {site}"), 32), "url": util::ellipsize(url.as_str(), 512)}]);
|
||||
|
|
@ -469,3 +483,18 @@ fn worker(rx: Receiver<Command>, status: Arc<Mutex<String>>, wake: Arc<dyn Fn()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn icon_prefers_fetchable_image_then_falls_back() {
|
||||
let page = Url::parse("https://example.org/a").unwrap();
|
||||
assert_eq!(icon_url(&["https://x.test/a.png", "https://y.test/f.png"], &page), "https://x.test/a.png");
|
||||
assert_eq!(icon_url(&["data:image/png;base64,AAAA", "https://y.test/f.png"], &page), "https://y.test/f.png");
|
||||
let long = format!("https://x.test/{}", "a".repeat(300));
|
||||
assert_eq!(icon_url(&["", "http://y.test/f.ico", &long], &page), "https://example.org/favicon.ico");
|
||||
assert_eq!(icon_url(&[""], &Url::parse("about:blank").unwrap()), "");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
34
src/hub.rs
34
src/hub.rs
|
|
@ -15,6 +15,7 @@ use url::Url;
|
|||
|
||||
use crate::adblock::{AdBlocker, Verdict};
|
||||
use crate::inject::{self, PageMessage};
|
||||
use crate::store::permissions::{Answer, Decision, Kind, Permissions};
|
||||
use crate::store::settings::Settings;
|
||||
use crate::util;
|
||||
|
||||
|
|
@ -73,13 +74,21 @@ pub struct HubConfig {
|
|||
pub https_exceptions: Vec<String>,
|
||||
pub strip_params: bool,
|
||||
pub google_signin: bool,
|
||||
/// Images permission: blocked unless a site says otherwise, and the sites that differ (host, blocked).
|
||||
pub images_block_default: bool,
|
||||
pub images_sites: Vec<(String, bool)>,
|
||||
pub user_agent: String,
|
||||
/// Tabs where the user chose "open over http anyway" this session (host).
|
||||
pub http_allowed: Vec<String>,
|
||||
}
|
||||
|
||||
impl HubConfig {
|
||||
pub fn from_settings(settings: &Settings, user_agent: &str, http_allowed: Vec<String>) -> HubConfig {
|
||||
/// Whether pictures are blocked on pages of this host.
|
||||
pub fn images_blocked(&self, host: &str) -> bool {
|
||||
self.images_sites.iter().find(|(h, _)| h == host).map(|(_, block)| *block).unwrap_or(self.images_block_default)
|
||||
}
|
||||
|
||||
pub fn from_settings(settings: &Settings, permissions: &Permissions, user_agent: &str, http_allowed: Vec<String>) -> HubConfig {
|
||||
HubConfig {
|
||||
adblock_enabled: settings.adblock.enabled,
|
||||
adblock_allow: settings.adblock.allow.clone(),
|
||||
|
|
@ -87,6 +96,8 @@ impl HubConfig {
|
|||
https_exceptions: settings.privacy.https_exceptions.clone(),
|
||||
strip_params: settings.privacy.strip_params,
|
||||
google_signin: settings.privacy.google_signin,
|
||||
images_block_default: permissions.answer(settings, "", Kind::Images) == Answer::Block,
|
||||
images_sites: permissions.all().into_iter().filter(|(_, kind, _)| *kind == Kind::Images).map(|(host, _, decision)| (host, decision == Decision::Block)).collect(),
|
||||
user_agent: user_agent.to_owned(),
|
||||
http_allowed,
|
||||
}
|
||||
|
|
@ -245,9 +256,14 @@ impl Hub {
|
|||
return;
|
||||
}
|
||||
|
||||
// Sub-resources: the ad blocker.
|
||||
// Sub-resources: the Images permission, then the ad blocker.
|
||||
let page_url = page.as_ref().map(Url::as_str).unwrap_or("");
|
||||
let page_host = util::host_of_str(page_url);
|
||||
if kind == "image" && matches!(url.scheme(), "http" | "https") && !page_host.is_empty() && config.images_blocked(&page_host) {
|
||||
drop(config);
|
||||
load.intercept(WebResourceResponse::new(url).status_code(StatusCode::NO_CONTENT)).cancel();
|
||||
return;
|
||||
}
|
||||
let paused = !config.adblock_enabled || config.adblock_allow.iter().any(|h| util::host_matches(&page_host, h));
|
||||
drop(config);
|
||||
if !paused && matches!(url.scheme(), "http" | "https" | "ws" | "wss") {
|
||||
|
|
@ -403,6 +419,20 @@ impl servo::GamepadDelegate for Gamepads {
|
|||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn images_follow_the_site_answer_then_the_default() {
|
||||
let mut settings = Settings::default();
|
||||
let mut permissions = Permissions::load(std::path::PathBuf::from("/nonexistent/permissions.json"), true);
|
||||
assert!(!HubConfig::from_settings(&settings, &permissions, "", Vec::new()).images_blocked("a.example"));
|
||||
permissions.set("a.example", Kind::Images, Some(Decision::Block));
|
||||
let config = HubConfig::from_settings(&settings, &permissions, "", Vec::new());
|
||||
assert!(config.images_blocked("a.example") && !config.images_blocked("b.example"));
|
||||
settings.privacy.permission_defaults.insert("images".into(), crate::store::settings::PermissionDefault::Block);
|
||||
permissions.set("b.example", Kind::Images, Some(Decision::Allow));
|
||||
let config = HubConfig::from_settings(&settings, &permissions, "", Vec::new());
|
||||
assert!(config.images_blocked("a.example") && config.images_blocked("c.example") && !config.images_blocked("b.example"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn strips_tracking() {
|
||||
let u = Url::parse("https://a.example/p?id=3&utm_source=x&fbclid=y").unwrap();
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@
|
|||
//! resize <w> <h> resize the window (logical pixels)
|
||||
//! status <name> save tabs, downloads, VPN, ad blocker and so on as <name>.json
|
||||
//! set <json pointer> <json> change a setting, e.g. `set /privacy/https_only true`
|
||||
//! perm <host> <kind> allow|block|default store a site's answer for a permission (kinds: store::permissions::Kind keys)
|
||||
//! prompt allow|deny [remember] answer the active tab's first permission prompt
|
||||
//! vault master <pw> | lock | unlock <pw> | remove_master | export <file> | import <file> the password vault
|
||||
//! bookmarks folder <name> | export <file> | import <file> a folder on the bar; the Netscape HTML file (what the page's buttons do)
|
||||
//! flyout <name> main, downloads, shield, vpn, media, siteinfo, profiles, apps, qr, tabmenu, back,
|
||||
//! bookmark (edit the current page's bookmark), none
|
||||
//! type <text> put text in the address bar with its suggestions open
|
||||
|
|
@ -20,6 +24,8 @@
|
|||
//! cmd <name> [arg] back, forward, reload, bookmark, install_app, pip, exitpip, free_memory,
|
||||
//! update_lists, check_updates, close_tab, select <n>, zoom <step>,
|
||||
//! find <text>, download <url>, pause_download|resume_download|cancel_download [id] (newest),
|
||||
//! import <n> (bookmarks, history, settings from the n-th found browser profile),
|
||||
//! install_script <url> (a .user.js / .user.css), open_app [id] (default: the first installed app),
|
||||
//! navigate <typed text>, mute, pin
|
||||
//! js <script> run JavaScript in the current tab; the result goes to the log
|
||||
//! assert <js expression> the expression must give true, else `ASSERT FAILED` in the log fails the smoke run
|
||||
|
|
@ -271,6 +277,73 @@ impl App {
|
|||
}
|
||||
self.apply_settings_if_changed();
|
||||
},
|
||||
"perm" => {
|
||||
let parts: Vec<&str> = rest.split_whitespace().collect();
|
||||
let kind = parts.get(1).and_then(|k| crate::store::permissions::Kind::ALL.iter().find(|x| x.key() == *k));
|
||||
let decision = match parts.get(2).copied() {
|
||||
Some("allow") => Some(Some(crate::store::permissions::Decision::Allow)),
|
||||
Some("block") => Some(Some(crate::store::permissions::Decision::Block)),
|
||||
Some("default") => Some(None),
|
||||
_ => None,
|
||||
};
|
||||
match (parts.first(), kind, decision) {
|
||||
(Some(host), Some(kind), Some(decision)) => self.shared.permissions.borrow_mut().set(host, *kind, decision),
|
||||
_ => self.selftest_log(&format!("perm: bad line {rest}")),
|
||||
}
|
||||
self.refresh_hub_config();
|
||||
},
|
||||
"vault" => {
|
||||
let (what, arg) = rest.split_once(char::is_whitespace).map(|(w, a)| (w, a.trim())).unwrap_or((rest, ""));
|
||||
let result = {
|
||||
let mut vault = self.shared.vault.borrow_mut();
|
||||
match what {
|
||||
"master" => vault.set_master(arg).map(|_| String::new()),
|
||||
"lock" => {
|
||||
vault.lock();
|
||||
Ok(String::new())
|
||||
},
|
||||
"unlock" => vault.unlock(arg).map(|_| String::new()),
|
||||
"remove_master" => vault.remove_master().map(|_| String::new()),
|
||||
"export" => vault.export_csv().and_then(|csv| std::fs::write(arg, csv).map_err(|e| crate::store::vault::VaultError::Io(e.to_string()))).map(|_| String::new()),
|
||||
"import" => match std::fs::read_to_string(arg) {
|
||||
Ok(text) => vault.import_csv(&text).map(|(added, skipped)| format!("imported {added}, skipped {skipped}")),
|
||||
Err(error) => Err(crate::store::vault::VaultError::Io(error.to_string())),
|
||||
},
|
||||
_ => Ok(format!("unknown vault command {what}")),
|
||||
}
|
||||
};
|
||||
match result {
|
||||
Ok(note) if !note.is_empty() => self.selftest_log(¬e),
|
||||
Ok(_) => {},
|
||||
Err(error) => self.selftest_log(&format!("vault {what}: {error}")),
|
||||
}
|
||||
},
|
||||
"bookmarks" => {
|
||||
let (what, arg) = rest.split_once(char::is_whitespace).map(|(w, a)| (w, a.trim())).unwrap_or((rest, ""));
|
||||
let mut bookmarks = self.shared.bookmarks.borrow_mut();
|
||||
let note = match what {
|
||||
"folder" => {
|
||||
bookmarks.add_folder(crate::store::bookmarks::BAR, arg);
|
||||
String::new()
|
||||
},
|
||||
"export" => std::fs::write(arg, bookmarks.export_html()).map(|_| String::new()).unwrap_or_else(|e| format!("bookmarks export: {e}")),
|
||||
"import" => match std::fs::read_to_string(arg) {
|
||||
Ok(text) => format!("imported {} bookmarks", bookmarks.import_html(&text, "file")),
|
||||
Err(error) => format!("bookmarks import: {error}"),
|
||||
},
|
||||
_ => format!("unknown bookmarks command {what}"),
|
||||
};
|
||||
drop(bookmarks);
|
||||
if !note.is_empty() {
|
||||
self.selftest_log(¬e);
|
||||
}
|
||||
},
|
||||
"prompt" => {
|
||||
let remember = rest.contains("remember");
|
||||
let answer = if rest.starts_with("allow") { crate::actions::PromptAnswer::Allow { remember } } else { crate::actions::PromptAnswer::Deny { remember } };
|
||||
let tab = self.windows.get(&window).and_then(|w| w.tab()).map(|t| t.id).unwrap_or(0);
|
||||
self.run_in(window, Command::Prompt { tab, answer });
|
||||
},
|
||||
"flyout" => {
|
||||
let url = self.windows.get(&window).and_then(|w| w.tab()).map(|t| t.url.clone()).unwrap_or_default();
|
||||
let tab = self.windows.get(&window).and_then(|w| w.tab()).map(|t| t.id).unwrap_or(0);
|
||||
|
|
@ -330,6 +403,9 @@ impl App {
|
|||
"mute" => Command::MuteTab(tab),
|
||||
"pin" => Command::PinTab(tab),
|
||||
"reopen" => Command::ReopenClosed(None),
|
||||
"import" => Command::Import { source: arg.parse().unwrap_or(0), bookmarks: true, history: true, settings: true },
|
||||
"install_script" => Command::InstallScript(arg.to_owned()),
|
||||
"open_app" => Command::OpenApp(if arg.is_empty() { self.shared.apps.borrow().items.first().map(|a| a.id.clone()).unwrap_or_default() } else { arg.to_owned() }),
|
||||
"media" => Command::Media { tab, action: arg.to_owned(), value: 0.0 },
|
||||
_ => {
|
||||
self.selftest_log(&format!("unknown cmd {name}"));
|
||||
|
|
@ -662,6 +738,10 @@ impl App {
|
|||
times.sort_by(f32::total_cmp);
|
||||
serde_json::json!({"count": times.len(), "median_ms": times.get(times.len() / 2), "max_ms": times.last(), "drawn": w.frames_drawn})
|
||||
});
|
||||
let bookmark_folders = {
|
||||
let b = self.shared.bookmarks.borrow();
|
||||
[crate::store::bookmarks::BAR, crate::store::bookmarks::OTHER].iter().filter_map(|id| b.get(*id)).map(|n| n.children.iter().filter(|c| c.is_folder()).count()).sum::<usize>()
|
||||
};
|
||||
serde_json::json!({
|
||||
"windows": self.windows.len(),
|
||||
"tab_count": tabs.len(),
|
||||
|
|
@ -676,11 +756,22 @@ impl App {
|
|||
"route": self.shared.bridge.as_ref().map(|b| format!("{:?}", b.route())),
|
||||
"bridge_bytes": self.shared.bridge.as_ref().map(|b| b.bytes.load(std::sync::atomic::Ordering::Relaxed)),
|
||||
"adblock": {"ready": self.shared.adblock.ready(), "rules": self.shared.adblock.rule_count(), "status": self.shared.adblock_status.borrow().clone(), "total": settings.adblock.total},
|
||||
"permissions": self.shared.permissions.borrow().all().iter().fold(serde_json::Map::new(), |mut m, (host, kind, decision)| {
|
||||
m.entry(host.clone()).or_insert_with(|| serde_json::json!({})).as_object_mut().expect("object").insert(kind.key().to_owned(), serde_json::json!(format!("{decision:?}").to_lowercase()));
|
||||
m
|
||||
}),
|
||||
"site_state": {"zoom_sites": settings.web.zoom_sites, "adblock_allow": settings.adblock.allow, "keep_active": settings.perf.keep_active, "muted_sites": settings.media.muted_sites, "https_exceptions": settings.privacy.https_exceptions},
|
||||
"history": self.shared.history.borrow().len(),
|
||||
"bookmarks": self.shared.bookmarks.borrow().all().len(),
|
||||
"bookmark_folders": bookmark_folders,
|
||||
"logins": self.shared.vault.borrow().contents.logins.len(),
|
||||
"vault_locked": self.shared.vault.borrow().locked(),
|
||||
"vault_mode": format!("{:?}", self.shared.vault.borrow().mode()),
|
||||
"apps": self.shared.apps.borrow().items.len(),
|
||||
"scripts": self.shared.scripts.borrow().items.len(),
|
||||
"import_status": self.shared.import_status.borrow().clone(),
|
||||
"home_url": settings.startup.home_url,
|
||||
"search_engine": settings.startup.search_engine,
|
||||
"dlm": format!("{:?}", self.shared.dlm_status.borrow()),
|
||||
"discord": self.shared.presence_status.borrow().clone(),
|
||||
"spell": self.shared.spell_status.borrow().clone(),
|
||||
|
|
|
|||
|
|
@ -120,6 +120,18 @@ impl Kind {
|
|||
}
|
||||
}
|
||||
|
||||
/// Why Nacre can't enforce this one: Servo 0.7 has no per-site switch for it. Those rows show as unavailable.
|
||||
pub fn engine_limit(self) -> Option<&'static str> {
|
||||
match self {
|
||||
Kind::Location => Some("Servo 0.7 never asks for the location: navigator.geolocation does nothing"),
|
||||
Kind::Camera | Kind::Microphone | Kind::DeviceInfo => Some("Servo 0.7 has no navigator.mediaDevices, so no page can ask"),
|
||||
Kind::Storage => Some("Servo 0.7 has no navigator.storage.persist(), so no page can ask"),
|
||||
Kind::Javascript => Some("Servo 0.7 can't turn JavaScript off for one site"),
|
||||
Kind::Clipboard => Some("Servo 0.7 doesn't ask before a page reads the clipboard"),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// The answer when the user has set nothing: sensitive things ask, harmless ones are allowed.
|
||||
pub fn builtin_default(self) -> PermissionDefault {
|
||||
match self {
|
||||
|
|
@ -150,12 +162,14 @@ pub struct Permissions {
|
|||
sites: BTreeMap<String, BTreeMap<Kind, Decision>>,
|
||||
dirty: bool,
|
||||
read_only: bool,
|
||||
/// Counts every change, so the app notices edits made by menus and pages.
|
||||
revision: u64,
|
||||
}
|
||||
|
||||
impl Permissions {
|
||||
pub fn load(path: PathBuf, read_only: bool) -> Permissions {
|
||||
let sites = if read_only { BTreeMap::new() } else { util::load_json(&path) };
|
||||
Permissions { path, sites, dirty: false, read_only }
|
||||
Permissions { path, sites, dirty: false, read_only, revision: 0 }
|
||||
}
|
||||
|
||||
/// The decision stored for exactly this site, if any.
|
||||
|
|
@ -198,6 +212,11 @@ impl Permissions {
|
|||
},
|
||||
}
|
||||
self.dirty = true;
|
||||
self.revision += 1;
|
||||
}
|
||||
|
||||
pub fn revision(&self) -> u64 {
|
||||
self.revision
|
||||
}
|
||||
|
||||
/// Every stored decision: (host, kind, decision).
|
||||
|
|
@ -212,6 +231,7 @@ impl Permissions {
|
|||
pub fn clear_host(&mut self, host: &str) {
|
||||
if self.sites.remove(host).is_some() {
|
||||
self.dirty = true;
|
||||
self.revision += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -219,6 +239,7 @@ impl Permissions {
|
|||
if !self.sites.is_empty() {
|
||||
self.sites.clear();
|
||||
self.dirty = true;
|
||||
self.revision += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -248,5 +269,6 @@ mod tests {
|
|||
assert_eq!(p.answer(&s, "a.example", Kind::Camera), Answer::Allow);
|
||||
p.set("a.example", Kind::Camera, None);
|
||||
assert!(p.all().is_empty());
|
||||
assert_eq!(p.revision(), 2);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
use egui::{RichText, Sense, Stroke, Ui, vec2};
|
||||
|
||||
use super::super::widgets::{ButtonKind, button, card, empty_state, icon, icon_button, icon_row, icon_link_row, list_item, page_column, page_header, row, search_pill, section, segmented, status_state, switch, switch_row};
|
||||
use super::super::widgets::{ButtonKind, button, card, empty_state, icon, icon_button, icon_row, icon_link_row, list_item, page_column, page_header, row, search_pill, section, segmented, status_state, switch, switch_row, unavailable_row};
|
||||
use super::super::{Frame, paint};
|
||||
use crate::actions::Command;
|
||||
use crate::store::permissions::{Decision, Kind};
|
||||
|
|
@ -73,6 +73,10 @@ pub fn site_settings(ui: &mut Ui, f: &mut Frame, host: &str) {
|
|||
section(ui, "Permissions");
|
||||
card(ui, |ui| {
|
||||
for kind in Kind::ALL {
|
||||
if let Some(reason) = kind.engine_limit() {
|
||||
unavailable_row(ui, kind.label(), reason);
|
||||
continue;
|
||||
}
|
||||
let current = f.shared.permissions.borrow().site_decision(host, *kind);
|
||||
let mut value: u8 = match current {
|
||||
None => 0,
|
||||
|
|
|
|||
|
|
@ -1293,6 +1293,10 @@ fn permissions(ui: &mut Ui, f: &mut Frame, s: &mut Settings) {
|
|||
section(ui, "Defaults");
|
||||
card(ui, |ui| {
|
||||
for kind in crate::store::permissions::Kind::ALL {
|
||||
if let Some(reason) = kind.engine_limit() {
|
||||
unavailable_row(ui, kind.label(), reason);
|
||||
continue;
|
||||
}
|
||||
let mut value = s.privacy.permission_defaults.get(kind.key()).copied().unwrap_or_else(|| kind.builtin_default());
|
||||
let before = value;
|
||||
row(ui, kind.label(), "", |ui| segmented(ui, &mut value, PermissionDefault::ALL));
|
||||
|
|
|
|||
44
tests/smoke/make-import-home.py
Executable file
44
tests/smoke/make-import-home.py
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Build a throwaway HOME holding fake Chrome and Firefox profiles for tests/smoke/stores-import.txt.
|
||||
Usage: tests/smoke/make-import-home.py <dir> (then SMOKE_HOME=<dir> tools/smoke.sh tests/smoke/stores-import.txt).
|
||||
Never reads a real profile. Chrome (found first): 2 bar links, a folder with 1 link, 1 link in Other, 3 visits (one non-web),
|
||||
home page and Bing. Firefox: 1 toolbar link, 1 menu link, 2 visits, home page and DuckDuckGo."""
|
||||
import json
|
||||
import sqlite3
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
home = Path(sys.argv[1])
|
||||
chrome = home / ".config/google-chrome/Default"
|
||||
chrome.mkdir(parents=True)
|
||||
node = lambda name, url: {"type": "url", "name": name, "url": url}
|
||||
(chrome / "Bookmarks").write_text(json.dumps({"roots": {
|
||||
"bookmark_bar": {"children": [node("Chrome bar one", "https://one.chrome.example/"), node("Chrome bar two", "https://two.chrome.example/"),
|
||||
{"type": "folder", "name": "Chrome folder", "children": [node("Inside", "https://in.chrome.example/")]}]},
|
||||
"other": {"children": [node("Chrome other", "https://other.chrome.example/"), node("Script", "javascript:alert(1)")]},
|
||||
}}))
|
||||
(chrome / "Preferences").write_text(json.dumps({"homepage": "https://home.chrome.example/", "default_search_provider_data": {"template_url_data": {"keyword": "bing.com"}}}))
|
||||
db = sqlite3.connect(chrome / "History")
|
||||
db.executescript("CREATE TABLE urls(id INTEGER PRIMARY KEY, url TEXT, title TEXT, visit_count INT, last_visit_time INT); CREATE TABLE visits(id INTEGER PRIMARY KEY, url INT, visit_time INT);")
|
||||
epoch = 11644473600
|
||||
for i, (url, title) in enumerate([("https://a.chrome.example/", "A"), ("https://b.chrome.example/", "B"), ("chrome://settings/", "Settings")], 1):
|
||||
db.execute("INSERT INTO urls VALUES (?,?,?,1,?)", (i, url, title, (1700000000 + i * 60 + epoch) * 1_000_000))
|
||||
db.execute("INSERT INTO visits VALUES (?,?,?)", (i, i, (1700000000 + i * 60 + epoch) * 1_000_000))
|
||||
db.commit()
|
||||
db.close()
|
||||
|
||||
fx_root = home / ".mozilla/firefox"
|
||||
fx = fx_root / "abc.default"
|
||||
fx.mkdir(parents=True)
|
||||
(fx_root / "profiles.ini").write_text("[Profile0]\nName=default\nIsRelative=1\nPath=abc.default\n")
|
||||
(fx / "prefs.js").write_text('user_pref("browser.startup.homepage", "https://home.firefox.example/");\nuser_pref("browser.search.defaultenginename", "DuckDuckGo");\n')
|
||||
db = sqlite3.connect(fx / "places.sqlite")
|
||||
db.executescript("""CREATE TABLE moz_places(id INTEGER PRIMARY KEY, url TEXT, title TEXT);
|
||||
CREATE TABLE moz_bookmarks(id INTEGER PRIMARY KEY, type INT, fk INT, parent INT, position INT, title TEXT);
|
||||
CREATE TABLE moz_historyvisits(id INTEGER PRIMARY KEY, place_id INT, visit_date INT);""")
|
||||
places = [(1, "https://bar.firefox.example/", "Fx bar"), (2, "https://menu.firefox.example/", "Fx menu"), (3, "https://x.firefox.example/", "X"), (4, "https://y.firefox.example/", "Y")]
|
||||
db.executemany("INSERT INTO moz_places VALUES (?,?,?)", places)
|
||||
db.executemany("INSERT INTO moz_bookmarks VALUES (?,?,?,?,?,?)", [(2, 2, None, 1, 0, "menu"), (3, 2, None, 1, 1, "toolbar"), (10, 1, 1, 3, 0, "Fx bar"), (11, 1, 2, 2, 0, "Fx menu")])
|
||||
db.executemany("INSERT INTO moz_historyvisits VALUES (?,?,?)", [(1, 3, 1700000100 * 1_000_000), (2, 4, 1700000200 * 1_000_000)])
|
||||
db.commit()
|
||||
db.close()
|
||||
15
tests/smoke/pages/chrome-bookmarks.html
Normal file
15
tests/smoke/pages/chrome-bookmarks.html
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE NETSCAPE-Bookmark-file-1>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<TITLE>Bookmarks</TITLE>
|
||||
<H1>Bookmarks</H1>
|
||||
<DL><p>
|
||||
<DT><H3 ADD_DATE="1700000000" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks bar</H3>
|
||||
<DL><p>
|
||||
<DT><A HREF="https://bar.example/" ADD_DATE="1700000000">On the bar</A>
|
||||
</DL><p>
|
||||
<DT><H3 ADD_DATE="1700000000">Reading</H3>
|
||||
<DL><p>
|
||||
<DT><A HREF="https://read.example/a" ADD_DATE="1700000000">Article A</A>
|
||||
<DT><A HREF="https://read.example/b" ADD_DATE="1700000000">Article B & more</A>
|
||||
</DL><p>
|
||||
</DL><p>
|
||||
9
tests/smoke/pages/login.html
Normal file
9
tests/smoke/pages/login.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Login probe</title>
|
||||
<!-- tests/smoke/stores-vault.txt: a plain login form; submitting only reloads the page with ?sent. -->
|
||||
<form id="f" onsubmit="setTimeout(() => { location = 'login.html?sent'; }, 50); return false;" style="font: 20px sans-serif; margin: 40px">
|
||||
<p><input id="user" name="username" autocomplete="username" size="24"></p>
|
||||
<p><input id="pass" name="password" type="password" autocomplete="current-password" size="24"></p>
|
||||
<p><button id="go" type="submit">Sign in</button></p>
|
||||
</form>
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue