diff --git a/web/index.html b/web/index.html index e131036..e4be202 100644 --- a/web/index.html +++ b/web/index.html @@ -159,6 +159,18 @@ "<" + t.tagName.toLowerCase() + "> load error (404, network or MIME type)", t.tagName === "SCRIPT"); return; } + // Scripts a browser or an extension injects (Brave's wallet touching window.ethereum, say) throw here too: + // drop an error that names no script of the page's origin (a blob: URL of it, or wasm), so it cannot fail the boot. + if (location.origin !== "null") { + let ours; + try { + const u = new URL(ev.filename); + ours = u.origin === location.origin || u.protocol === "wasm:"; + } catch { + ours = String(ev.error?.stack || "").includes(location.origin); + } + if (!ours) return; + } KW.report("exception", ev.message || "Script error", ev.error?.stack || (ev.filename ? ev.filename + ":" + ev.lineno + ":" + ev.colno : ""), !KW.started); }, true); addEventListener("unhandledrejection", (ev) => {