diff --git a/main.js b/main.js index 9e4740da..0143334a 100644 --- a/main.js +++ b/main.js @@ -12329,7 +12329,12 @@ async function setFileAssociations(on) { const classes = `HKCU\\Software\\Classes`; const caps = `HKCU\\Software\\Theseus Navigator\\Capabilities`; if (on) { - await regAdd(`${classes}\\${WIN_PROGID}`, "", "Theseus HTML Document"); + // The ProgID's default value is the friendly name Windows shows in the + // Open-with menu AND in the file-type column of Explorer. Keep it short + // — "Theseus Navigator" — not a long "Theseus HTML Document" per + // extension. ApplicationDescription under Capabilities is also dropped; + // Default Apps picks it up as a tooltip and the long sentence was noisy. + await regAdd(`${classes}\\${WIN_PROGID}`, "", "Theseus Navigator"); await regAdd(`${classes}\\${WIN_PROGID}\\DefaultIcon`, "", `${exe},0`); await regAdd(`${classes}\\${WIN_PROGID}\\shell\\open\\command`, "", openCmd); for (const ext of FILE_ASSOC_EXTS) { @@ -12339,7 +12344,6 @@ async function setFileAssociations(on) { // Windows Settings → Default Apps for each listed extension. await regAdd(caps, "ApplicationName", "Theseus Navigator"); await regAdd(caps, "ApplicationIcon", `${exe},0`); - await regAdd(caps, "ApplicationDescription", "A browser that follows the thread."); for (const ext of FILE_ASSOC_EXTS) await regAdd(`${caps}\\FileAssociations`, ext, WIN_PROGID); for (const p of DEFAULT_BROWSER_PROTOS) await regAdd(`${caps}\\URLAssociations`, p, WIN_PROGID); await regAdd(`HKCU\\Software\\RegisteredApplications`, "Theseus Navigator", "Software\\Theseus Navigator\\Capabilities"); @@ -12376,6 +12380,30 @@ ipcMain.handle("default-browser-state", () => ({ })); ipcMain.handle("default-browser-set", (_e, on) => setAsDefaultBrowser(!!on)); ipcMain.handle("file-assocs-set", (_e, on) => setFileAssociations(!!on)); +// Auto-register the HKCU "Open with Theseus" entries on first launch so +// double-clicking an .html / .pdf / .svg / .xhtml file (or picking it from +// an Open-with menu) just works, with no toggle to flip in Settings. Two +// per-profile flags: +// fileAssocsAutoApplied — first-run rollout. Once set, never auto-apply +// again, so a user who removes the association +// by hand (registry or Default Apps) stays opted +// out across restarts. +// fileAssocsLabelFixed_1 — one-time re-write for 0.3.124+: the old progid +// default was "Theseus HTML Document" which looked +// verbose next to the per-extension entry in the +// Open-with menu. Rewriting it to "Theseus +// Navigator" is idempotent and only fires once. +function autoApplyFileAssociations() { + if (process.platform !== "win32") return; + const needFirstRun = !settings.fileAssocsAutoApplied; + const needLabelFix = settings.fileAssocsAutoApplied && !settings.fileAssocsLabelFixed_1 && hasFileAssociations(); + if (!needFirstRun && !needLabelFix) return; + setFileAssociations(true).then(() => { + if (needFirstRun) settings.fileAssocsAutoApplied = true; + settings.fileAssocsLabelFixed_1 = true; + try { saveSettings(); } catch {} + }).catch((e) => console.warn("auto file assocs:", e?.message)); +} ipcMain.handle("open-system-defaults", () => openSystemDefaultApps()); if (!process.env.THESEUS_NO_AUTOSTART && !app.requestSingleInstanceLock()) { // Another Theseus owns this profile; it got our argv via second-instance. @@ -12455,6 +12483,10 @@ if (!process.env.THESEUS_NO_AUTOSTART && !app.requestSingleInstanceLock()) { // "restart to apply" chip instead of finding out in Settings. // boot-time poll now runs from onChromeReady; interval poll (4 h) is fine here. setInterval(() => pollAddonUpdates("interval"), 4 * 60 * 60 * 1000); + // Register the Windows Open-with entries on first run — no toggle, no + // UAC, no user step. Deferred past the toolbar paint so the one-shot + // reg.exe fan-out never gets in the way of launch. + setTimeout(() => { try { autoApplyFileAssociations(); } catch {} }, 5_000); // Launched from an installed app's shortcut: just that app's window; the // browser window comes up on the next plain launch (second-instance). const appUrl = webapps.appUrlFromArgv(process.argv); diff --git a/package.json b/package.json index 43458281..45f2b706 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "theseus-navigator", - "version": "0.3.123", + "version": "0.3.124", "license": "MPL-2.0", "description": "Theseus Navigator — a browser that follows the thread. By Silent Mode, a Deviant project.", "author": "Silent Mode", diff --git a/settings.html b/settings.html index 59973ff3..922b87fd 100644 --- a/settings.html +++ b/settings.html @@ -319,8 +319,7 @@ Passwords Performance Privacy - Names & Certificates - Plug-ins + System Ariadne's Thread Aegis Extensions @@ -342,13 +341,6 @@ -
.html, .htm, .pdf, .svg or .xhtml file and Theseus appears in the Open-with menu. Theseus opens it as a local-file tab.Decide which name systems Theseus can resolve, and which certificate roots it will trust. BNS (.x, .bch, .sia, …) is always on; everything else is off by default.
@@ -602,9 +595,12 @@Silent Mode components that live alongside Theseus — each with its own on/off, updates and settings page. Ariadne's Thread and Aegis now have their own entries in the sidebar.
+The Silent Mode components that live alongside Theseus and the name systems the browser can resolve.