theseus/dev
Local Dev 755e97b5bb Ship Theseus 0.0.8: window.bcnr dApp API + eTLD+1 permission origins
Merges a parallel session's work with the multi-source BNS story from 0.0.7.

The dApp side (parallel session)
--------------------------------
* bcnr-preload.js — installs `window.bcnr` on every page via contextBridge.
  Read-only surface: resolveName(name), isRegistered(name), getBcnrTlds(),
  getRecordVersion(name), plus getPermissionOrigin() for diagnostics. All
  Promises; a missing name returns null (not throw). No signing, no wallet
  unlock — that surface is designed but deliberately out of scope for 0.0.8
  (see TheseusNavigator/DESIGN-integrated-wallet.md).
* bcnr-origin.js — pure function that computes the eTLD+1 permission origin
  for a URL. ICANN suffixes via `psl` (same PSL Chromium uses, handles
  .co.uk / .github.io / etc); BNS names key off the on-chain TLD list so
  foo.wallet becomes a public suffix as soon as `wallet` appears there.
  Match browser cookie / MetaMask semantics: a grant on pay.merchant.com
  covers account.merchant.com but not evil.com.
* dev/bcnr-selftest.js, dev/origin-selftest.mjs — self-tests, no I/O.
* main.js wires bcnr-preload.js into session.defaultSession.setPreloads() so
  it runs BEFORE per-WebContentsView preloads; adds bcnr:* IPC handlers.
* preload.js + chrome.html — small hooks so the shell picks up window.bcnr
  the same way regular content does.
* package.json — psl dep, bcnr-preload.js/bcnr-origin.js in `files`.

Also included
-------------
* AriadneResolver/mobile/.../UpdateCheck.java — in-app update-check for the
  Android app; already active in the shipped 0.11 APK (build.ps1 -Recurse
  picked it up), formalising the source now.
* TheseusNavigator/snapshots/bns-name-snapshot.json — refreshed bundled
  starter (73 beacon txs, root c37b8596…c54e414ba).
* Site pages + manifest updated to point at 0.0.8.

  TheseusNavigator-Setup-0.0.8.exe    95.4 MB
    21939743eafdfe8742a6b7c4b987bd2782384d7bc41289cb80a7e08019dc9f02
  TheseusNavigator-0.0.8-portable.exe 92.7 MB
    2aa429fe39dc0fa4ac040fc6d6eb31b0f890c8a83175c49fcb50f052c480d39d
2026-08-31 01:38:55 +02:00
..
bcnr-selftest.js Ship Theseus 0.0.8: window.bcnr dApp API + eTLD+1 permission origins 2026-08-31 01:38:55 +02:00
list-tlds.mjs Sweep: mobile Ariadne updates, Deviant brand + sites, Hephaestus bootstrap, snappymail 2026-08-30 10:38:49 +02:00
origin-selftest.mjs Ship Theseus 0.0.8: window.bcnr dApp API + eTLD+1 permission origins 2026-08-31 01:38:55 +02:00
probe-site.mjs Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
README.md Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
registry-decide.mjs Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
rescheck.mjs Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
selftest.js Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
show-tlds-bch.mjs Sweep: mobile Ariadne updates, Deviant brand + sites, Hephaestus bootstrap, snappymail 2026-08-30 10:38:49 +02:00
test-directip.mjs Initial commit — Silent Mode baseline (2026-07-29) 2026-07-29 13:54:34 +02:00
test-our-indexer.mjs Resolver 3438d558: ASCII-clean install.ps1 + multi-TLD NRPT + VPS-first electrum 2026-07-31 23:09:23 +02:00

Theseus dev/test harness

Two ways to drive Theseus's resolution + content path headlessly, for testing and debugging without clicking through the GUI. Both use the real resolver (Argus/src/lib/resolver-web.js) and gateway path the shipped app uses.

selftest.js — full render (Electron)

Runs the actual serveBns protocol handler (imported from main.js) in a hidden offscreen Electron window, loads a bns:// name, lets its JavaScript execute, then reports what really rendered and writes a screenshot.

npx electron dev/selftest.js hello.bch
npx electron dev/selftest.js coinspectrum.deviant.bch     # JS-driven Sia site
THESEUS_SETTLE=8000 npx electron dev/selftest.js <name>   # wait longer for data

Output: a JSON report (title, badge, stylesheet/script counts, local vs external broken-image counts, visible-text length, failed loads, verdict) plus dev-out/render.png and dev-out/render.html. Exit 0 = PASS. The verdict counts only the site's own bns:// assets — external CDN images are informational.

This is the faithful version of manual tests #2 (Sia-via-gateway rendering) and #3 (multi-TLD badge). main.js exports its handler and skips auto-launch when THESEUS_NO_AUTOSTART=1, which the harness sets.

probe-site.mjs — content path only (Node, no Electron)

Fast check with no display or Electron: resolves a name, fetches the index through the gateway exactly as serveBns does (with the <base> strip), and fetches each static same-origin asset, reporting status/content-type.

node dev/probe-site.mjs coinspectrum.deviant.bch

Limitation: static-HTML only. It cannot see assets a page builds at runtime in JavaScript — use selftest.js for JS-driven sites.

dev-out/

Generated render artifacts (screenshot + HTML dump). Safe to delete; regenerated on each selftest.js run.