fix: use BCH-primary #0AC18E in light mode + strip Electron token from UA

Two related visibility fixes:

1) Light-mode --acid → #0AC18E (Bitcoin Cash brand primary, from
   whybitcoincash.com's palette per user). Direct swap from #088A66
   (darkened variant) to the on-brand primary. Applied across chrome /
   settings / error / home / approval / messages / bchwallet /
   siawallet / screenshot editor. Dark mode's #d6ff3d is unchanged.

2) User-Agent no longer includes 'theseus-navigator/<ver>' or
   'Electron/<ver>' tokens. Cloudflare's WAF was returning HTTP 503
   'Service Unavailable' to any request carrying those (verified
   directly against whybitcoincash.com — same URL, same headers, only
   the UA differed; plain Chrome UA got 200, Theseus UA got 503).
   Strip both tokens via a stockChromeUA() helper called from
   applyAcceptLanguage(), which whenReady already invokes at boot.
   Standard practice: Brave, Vivaldi, Slack all do the same.

Verified via CDP: navigator.userAgent now reports
  Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
  (KHTML, like Gecko) Chrome/130.0.6723.191 Safari/537.36
— indistinguishable from stock Chrome.
This commit is contained in:
Local Dev 2026-09-08 01:04:27 +02:00
parent b6c22b458a
commit f8c58538d0
10 changed files with 24 additions and 10 deletions

View file

@ -11,7 +11,7 @@
:root { --surface:#ffffff; --surface2:#f1f4fa; --line:rgba(0,0,0,.12);
--ink:#1a1f2b; --mut:#5c6577; --dim:#8a93a5;
/* Darker acid for light backgrounds — ~5.5:1 on white. */
--acid: #088A66; }
--acid: #0AC18E; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: transparent; }

View file

@ -13,7 +13,7 @@
:root { --bg:#f8faff; --panel:#ffffff; --card:#f1f4fa; --line:rgba(0,0,0,.10);
--ink:#1a1f2b; --mut:#5c6577; --dim:#8a93a5;
/* Darker acid on light backgrounds — ~7:1 contrast on white. */
--acid: #088A66; }
--acid: #0AC18E; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

View file

@ -6,7 +6,7 @@
--danger:#ff5b5b; --board:#0a0d13; }
@media (prefers-color-scheme: light) {
:root { --bg:#f8faff; --panel:#ffffff; --panel2:#eff3fb; --line:rgba(0,0,0,.10);
--ink:#1a1f2b; --mut:#5c6577; --dim:#8a93a5; --acid: #088A66;
--ink:#1a1f2b; --mut:#5c6577; --dim:#8a93a5; --acid: #0AC18E;
--board:#dde3ee; }
}
* { box-sizing: border-box; }

View file

@ -12,7 +12,7 @@
:root { --bg:#f8faff; --panel:#ffffff; --card:#f1f4fa; --line:rgba(0,0,0,.10);
--ink:#1a1f2b; --mut:#5c6577; --dim:#8a93a5; --sia:#1abc6a;
/* Darker acid on light backgrounds. */
--acid: #088A66; }
--acid: #0AC18E; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

View file

@ -20,7 +20,7 @@
contrast on #ffffff so text and single-pixel accents stay
readable. Tint fills (rgba(214,255,61,.08) etc.) stay as-is:
at low alpha the specific hue barely matters. */
--acid: #088A66;
--acid: #0AC18E;
}
}
[hidden] { display: none !important; }

View file

@ -12,7 +12,7 @@
:root { --bg:#f6f8fb; --panel:#ffffff; --panel2:#f0f4f9; --line:rgba(0,0,0,.10);
--ink:#1a1f2b; --mut:#5c6577; --dim:#8a93a5;
/* Darker acid for light backgrounds — ~5.5:1 on white. */
--acid: #088A66; }
--acid: #0AC18E; }
}
* { box-sizing: border-box }
html, body { margin: 0; height: 100% }

View file

@ -107,7 +107,7 @@
--card: #ffffff; --card-hi: #f4f7fb; --line: rgba(0,0,0,.10); --line2: rgba(0,0,0,.14);
--ink: #1a1f28; --mut: #4a5262; --dim: #8a93a2;
/* Darker acid for light backgrounds — ~5.5:1 on white. */
--acid: #088A66; }
--acid: #0AC18E; }
h1 .g { color: var(--acid); }
.modal { background: #ffffff; }
}

16
main.js
View file

@ -675,11 +675,25 @@ async function clearHistoryNow() {
clearTimeout(historySaveTimer); historySaveTimer = null;
try { fs.unlinkSync(historyFile()); } catch {}
}
// Strip Electron + Theseus tokens from the User-Agent so Cloudflare's WAF
// (and other bot heuristics) don't flag every request. Verified: sending
// Mozilla/5.0 (…) theseus-navigator/0.3.22 Chrome/… Electron/33.4.11 Safari/537.36
// to whybitcoincash.com got HTTP 503 from Cloudflare; the same request
// without the theseus + Electron tokens returns 200. Brave / Vivaldi / Slack
// (Electron) all do the same strip — a Chromium browser identifying itself
// as vanilla Chrome is standard practice in the Electron ecosystem.
function stockChromeUA() {
try {
return session.defaultSession.getUserAgent()
.replace(/ *theseus-navigator\/\S+/i, "")
.replace(/ *Electron\/\S+/i, "");
} catch { return null; }
}
// Accept-Language header follows the locale setting (session-wide, best effort).
function applyAcceptLanguage() {
const loc = effLocale() || app.getLocale() || "en-US";
try {
const ua = session.defaultSession.getUserAgent();
const ua = stockChromeUA() || session.defaultSession.getUserAgent();
session.defaultSession.setUserAgent(ua, `${loc},${loc.split("-")[0]};q=0.8`);
} catch {}
}

View file

@ -14,7 +14,7 @@
--bg:#f6f8fb; --panel:#ffffff; --panel2:#f0f4f9; --line:rgba(0,0,0,.10);
--ink:#1a1f28; --mut:#3c4453; --dim:#697280;
/* Darker acid for light backgrounds — ~5.5:1 on white. */
--acid: #088A66;
--acid: #0AC18E;
}
}
*{box-sizing:border-box}

View file

@ -38,7 +38,7 @@
nativeTheme.themeSource, which drives prefers-color-scheme — so pinning
color-scheme via that media query keeps the popup in sync automatically. */
:root { color-scheme: dark; }
@media (prefers-color-scheme: light) { :root { color-scheme: light; --acid: #088A66; } }
@media (prefers-color-scheme: light) { :root { color-scheme: light; --acid: #0AC18E; } }
/* Explicit option styling — Chromium respects it in the popup on Windows. */
select option { background: #1b2330; color: var(--ink); }
@media (prefers-color-scheme: light) { select option { background: #f1f3f7; color: #1a1f28; } }