S051: WIP profile folder nacre-browser, sealed WebKit cookie store on tmpfs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-14 07:49:56 -06:00
commit d967f2a539
2 changed files with 446 additions and 108 deletions

View file

@ -27,6 +27,8 @@ pub struct Setup {
pub remote_inspector: Option<String>,
/// Where WebKit keeps the compiled ad blocker filters.
pub filter_store: std::path::PathBuf,
/// WebKit's SQLite cookie store (on tmpfs, sealed by `store::cookies`); `None` = cookies in memory only.
pub cookie_db: Option<std::path::PathBuf>,
}
pub struct Engine {
@ -135,6 +137,11 @@ impl Engine {
if let Some(manager) = session.website_data_manager() {
manager.set_favicons_enabled(true);
}
if let (Some(db), Some(cookies)) = (&setup.cookie_db, session.cookie_manager()) {
cookies.set_persistent_storage(&db.to_string_lossy(), webkit::CookiePersistentStorage::Sqlite);
let hub = hub.clone();
cookies.connect_changed(move |_| hub.push(Event::CookiesChanged));
}
// Everything goes through Nacre's bridge except this machine's own addresses (the bridge would only send
// them straight back). SOCKS5: its login is part of the handshake, so plain http works too (S050).
if let Some(proxy) = &setup.proxy {

View file

@ -87,6 +87,8 @@ pub enum Event {
Page(ViewId, PageMessage),
/// Find in page: how many matches the last search or step found (0: none).
Find(ViewId, u32),
/// A cookie was added, changed or deleted.
CookiesChanged,
}
/// A user style sheet (`store::scripts`), added at author level so it acts like the page's own last `<style>`.