Theseus 0.3.117: ICANN hosts that fail DNS show a DNS error, not a BCNR-register pitch

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.
This commit is contained in:
Local Dev 2026-10-27 15:35:03 +02:00
parent 33a84e70b0
commit 34989f94b3
2 changed files with 26 additions and 5 deletions

29
main.js
View file

@ -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";

View file

@ -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",