theseus/error-preload.js

16 lines
966 B
JavaScript
Raw Normal View History

Theseus 0.1.3: branded error page for load failures (BUILT, NOT DEPLOYED) Setup f2afc14efc63008cbb9dad44176e94146386db4c0afda4459f1d4eb929172b6d Portable 5d08b1415526934db8de780949a610896064fe9567aa0e5e1702ebabd7eb7df2 Chromium's default 'This site can't be reached' replaced with a Theseus- themed error page. did-fail-load on every tab's webContents (main frame only, non-ignorable code) routes the tab to error.html with the attempt URL, host, error code, and description as query params. The page keeps t.url pointing at the failed URL so the address bar shows what the user typed and they can edit + retry - refreshTabUrl's existing file:// skip means the error page's own path never leaks back into the bar. Five kinds, chosen by pickErrorKind(code, host): name-not-registered BCNR-eligible host + ERR_NAME_NOT_RESOLVED. Says "no BCDN record on chain, no clearnet host either." Offers Register on Sirius + Search + Retry + Home. name-unreachable ERR_NAME_NOT_RESOLVED on a non-BCNR host. DNS failed - offers Retry + Search + Register + Home. unreachable CONN_REFUSED/RESET/TIMED_OUT/CLOSED/NETWORK_CHANGED. Offers Retry + Tor guide + Home. tls ERR_CERT_* range (-200..-299). Offers Retry + Home. generic Everything else. home-preload.js gains `window.errorpage` alongside `window.home`. Both APIs are sender-URL-gated in main - a random page seeing the shape can't invoke them (isErrorPageSender / isHomePageSender). The external- open handler additionally allowlists Silent Mode domains only. package.json build.files gets error.html + error-preload.js so electron-builder actually bundles them (GOTCHAS rule: an unlisted runtime-loaded file silently opens blank). Ship pages (releases-manifest.json, tools/index.html, releases/index.html, site-theseus-x/index.html) updated to 0.1.3 with the new hashes. DEPLOY STATUS - blocked on VPS SSH: my IP was hit with a full-port ban mid-turn (likely fail2ban from the burst of scp during the 0.1.0-0.1.2 iterations). Site pages/manifest/installers are committed locally but NOT yet on dl.silentmode.st or the Sia mirror. Live still reads 0.1.2. User needs to unban 195.184.247.106 on their end, or wait for the ban to expire, before the ship pages match reality.
2026-08-31 13:38:05 +02:00
const { contextBridge, ipcRenderer } = require("electron");
// Renderer -> main API for the branded error page. All calls are user-initiated
// button clicks; main validates the sender before acting so a hostile page
// can't drive navigation by loading window.errorpage.
contextBridge.exposeInMainWorld("errorpage", {
retry: (url) => ipcRenderer.invoke("error-retry", url),
goHome: () => ipcRenderer.invoke("error-home"),
searchFor: (text) => ipcRenderer.invoke("error-search", text),
registerOnSirius: (host) => ipcRenderer.invoke("error-register", host),
openExternal: (url) => ipcRenderer.invoke("error-open-external", url),
bnsSimilar: (host) => ipcRenderer.invoke("error-bns-similar", host),
Theseus 0.3.122 followups: AI engines page, Pick-AI edit button, Pithos panel, Did-you-mean on DNS failures, LLM picker UI polish, real-brand icon preference Shipped on top of the 0.3.122 Settings restructure commit. AI engines settings page. New top-level nav entry "AI engines" with its own Default picker, Enabled list, catalog, discover filter and + Add AI engine form. The Search page is now LLM-free — ENGINE_KINDS is `["search"]`, the Search catalog filters out kind="llm" entries, and the Search custom-URL form only adds kind="search" engines. add-engine IPC now accepts a kind: "llm" field (sets defaultLlmId instead of searchEngine for LLM customs). Pick-AI picker. Borders removed, corners rounded (16px), heavier shadow; "Pick AI engines…" footer row dropped. Edit button (pencil icon) added to the header; opens the new AI engines settings page via `llm-picker-settings`, which now routes to the "ai-engines" slug (openSettingsTab falls through to "search" for legacy profiles that lack the section). Icon priority flipped. allEngines() now prefers a fetched favicon (the site's own brand mark, cached per profile) over the bundled generic tile. Bundled tiles still carry the first paint while the fetch runs, and the emit after fetch swaps in the real brand. Offline profiles see the tile indefinitely — same reliability as before. Pithos sidebar panel. bundled-addons/pithos/addon.json declares a `panels` block so sidebarLeftPanels() returns Pithos's panel BEFORE the add-on's on-demand activation. Previously, the Sidebar settings' Theseus native apps card was missing Pithos: it only appeared after first launch, when the add-on's own registerSidebarPanel call ran. Hermes already did this. Did-you-mean on DNS failures. The error page's "Did you mean" row now merges BCNR warm-index matches with ICANN alternative-TLD swaps + history base-name matches. For my.mynymbox.com the suggestions are my.mynymbox.io, mynymbox.io, my.mynymbox.net, mynymbox.net — the subdomain-strip is interleaved so a mistake like typing my.mynymbox.com when the real site is client.mynymbox.io still surfaces mynymbox.io near the top. Both paths are local-only; no network, no leak of what the user is browsing. Sidebar settings tightened. "How panels open" collapsed to one row with two side-by-side option cards; "Reset panel widths" and "AI engine in the sidebar" are one-liners now.
2026-10-27 20:50:40 +02:00
// ICANN "did you mean?" — alternative-TLD swaps + history matches for a
// host whose DNS failed. See icannAlternatives() in main.js.
icannAlternatives: (host) => ipcRenderer.invoke("error-icann-alternatives", host),
Theseus 0.1.3: branded error page for load failures (BUILT, NOT DEPLOYED) Setup f2afc14efc63008cbb9dad44176e94146386db4c0afda4459f1d4eb929172b6d Portable 5d08b1415526934db8de780949a610896064fe9567aa0e5e1702ebabd7eb7df2 Chromium's default 'This site can't be reached' replaced with a Theseus- themed error page. did-fail-load on every tab's webContents (main frame only, non-ignorable code) routes the tab to error.html with the attempt URL, host, error code, and description as query params. The page keeps t.url pointing at the failed URL so the address bar shows what the user typed and they can edit + retry - refreshTabUrl's existing file:// skip means the error page's own path never leaks back into the bar. Five kinds, chosen by pickErrorKind(code, host): name-not-registered BCNR-eligible host + ERR_NAME_NOT_RESOLVED. Says "no BCDN record on chain, no clearnet host either." Offers Register on Sirius + Search + Retry + Home. name-unreachable ERR_NAME_NOT_RESOLVED on a non-BCNR host. DNS failed - offers Retry + Search + Register + Home. unreachable CONN_REFUSED/RESET/TIMED_OUT/CLOSED/NETWORK_CHANGED. Offers Retry + Tor guide + Home. tls ERR_CERT_* range (-200..-299). Offers Retry + Home. generic Everything else. home-preload.js gains `window.errorpage` alongside `window.home`. Both APIs are sender-URL-gated in main - a random page seeing the shape can't invoke them (isErrorPageSender / isHomePageSender). The external- open handler additionally allowlists Silent Mode domains only. package.json build.files gets error.html + error-preload.js so electron-builder actually bundles them (GOTCHAS rule: an unlisted runtime-loaded file silently opens blank). Ship pages (releases-manifest.json, tools/index.html, releases/index.html, site-theseus-x/index.html) updated to 0.1.3 with the new hashes. DEPLOY STATUS - blocked on VPS SSH: my IP was hit with a full-port ban mid-turn (likely fail2ban from the burst of scp during the 0.1.0-0.1.2 iterations). Site pages/manifest/installers are committed locally but NOT yet on dl.silentmode.st or the Sia mirror. Live still reads 0.1.2. User needs to unban 195.184.247.106 on their end, or wait for the ban to expire, before the ship pages match reality.
2026-08-31 13:38:05 +02:00
});