diff --git a/main.js b/main.js index 27b760f8..19e6172a 100644 --- a/main.js +++ b/main.js @@ -738,6 +738,13 @@ const SETTINGS_DEFAULTS = { // work regardless of this; the menu entry is just a discoverability // escape hatch for users who hit the F12-vs-airplane-mode foot-gun. contextMenuDevTools: true, + // Route http(s):// SUBRESOURCE requests from a bns:// + // page back through the bns:// handler, so cookies, pinned TLS and the + // on-chain IP record all apply — matching what the author expected when + // they wrote `fetch("/api/...")` next to `fetch("https://game.x/api/...")` + // on the same page. See the installRequestFilter listener below. Top- + // level navigation and non-matching hosts are untouched. + bnsSameHostSubresource: true, }; // Applying the theme via nativeTheme.themeSource makes prefers-color-scheme update // in every renderer (chrome, settings, popover, page views) with no per-view IPC. @@ -3205,8 +3212,54 @@ function notifyTabChange() { const t = activeTab(); const info = t ? { id: t.id, url: t.url || "" } : null; for (const cb of tabChangeListeners) { try { cb(info); } catch (e) { console.warn("[addons] tab listener failed:", e?.message); } } } +// Cross-scheme same-host subresource rewrite: a page served at +// bns:///… that fetches https:///… (or http:///…) over +// XHR / fetch / /