From 34989f94b307a36821457900717d249d0eb984e4 Mon Sep 17 00:00:00 2001 From: Local Dev Date: Tue, 27 Oct 2026 15:35:03 +0200 Subject: [PATCH] Theseus 0.3.117: ICANN hosts that fail DNS show a DNS error, not a BCNR-register pitch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a navigation hits ERR_NAME_NOT_RESOLVED and the TLD is a well-known ICANN one (.com/.net/.io/country codes/…), Theseus now shows the DNS- flavoured 'This name didn't resolve' page instead of the BCNR-flavoured 'That name isn't registered' page. The BCNR page framed the failure as 'nobody has claimed this on-chain name, want to register it on Sirius?' — confusing when the user typed a real .com whose DNS is temporarily broken (hostile Wi-Fi AAAA mangling is the usual cause). The DNS page leads with retry and search instead, and still mentions BCNR was tried. Non-ICANN TLDs (.bch, .x, …) keep the register-first framing. The TLD set is a static whitelist of the common ones — covers the long tail of real sites without being exhaustive. Add more as needed. --- main.js | 29 +++++++++++++++++++++++++---- package.json | 2 +- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index a2114d4b..7cd79768 100644 --- a/main.js +++ b/main.js @@ -5016,12 +5016,33 @@ const ERROR_CODE_IGNORE = new Set([-3, -20]); // -7 ERR_TIMED_OUT // -21 ERR_NETWORK_CHANGED const ERROR_UNREACHABLE = new Set([-102, -101, -118, -100, -7, -21]); +// Well-known ICANN TLDs where "DNS couldn't resolve" is the far likelier +// story than "the user wanted a BCNR name on this TLD" — frames the error +// as a reachability issue (retry, check DNS) rather than as a BCNR +// register-this-name invitation. +const COMMON_ICANN_TLDS = new Set([ + "com", "net", "org", "edu", "gov", "mil", "int", "info", "biz", "name", "pro", + "io", "co", "me", "tv", "app", "dev", "ai", "cloud", "online", "site", "store", + "us", "uk", "de", "fr", "it", "es", "pl", "nl", "be", "ch", "at", "se", "no", + "fi", "dk", "ie", "pt", "gr", "cz", "ro", "hu", "ua", "ru", "by", "kz", + "jp", "cn", "tw", "hk", "kr", "sg", "my", "th", "vn", "in", "id", "ph", + "au", "nz", "br", "mx", "ar", "cl", "co", "pe", "ve", "ca", "za", "ng", "eg", + "il", "ae", "sa", "tr", "ir", "pk", +]); +function isLikelyIcannHost(host) { + const t = tldOf(host); + return !!t && COMMON_ICANN_TLDS.has(t); +} function pickErrorKind(code, host) { if (code === -105) { - // Name didn't resolve. If the host is BCNR-eligible (has a real TLD), - // that also means BCNR had no record — otherwise resolveHost/loadBns - // would have served something. Treat as "not registered" to promote - // the register-on-Sirius action. + // Name didn't resolve. For well-known ICANN TLDs (.com/.net/.io/…), + // frame it as a DNS failure — leading with "register on BCNR" would + // confuse the user whose site is almost certainly a clearnet one and + // whose DNS is temporarily broken (hostile Wi-Fi AAAA mangling, etc.). + if (isLikelyIcannHost(host)) return "name-unreachable"; + // Otherwise the host is a BCNR-eligible non-ICANN TLD (.bch, .x, …): + // BCNR had no record and no clearnet DNS answer either — treat as + // "not registered" to promote the register-on-Sirius action. return isBnsHost(host) ? "name-not-registered" : "name-unreachable"; } if (ERROR_UNREACHABLE.has(code)) return "unreachable"; diff --git a/package.json b/package.json index e9fca27e..5794533b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "theseus-navigator", - "version": "0.3.116", + "version": "0.3.117", "license": "MPL-2.0", "description": "Theseus Navigator — a browser that follows the thread. By Silent Mode, a Deviant project.", "author": "Silent Mode",