Files
podsteadr/frontend/index.html
ssmithxandClaude Opus 5.5 9d8d6c3f6f fix(frontend): load nostr-provider.js only inside an iframe
Archipelago's current provider (served from ARCHIPELAGO_PROVIDER_PATH)
also runs in a top-level tab: it replaces window.nostr and routes signing
to <origin>/nostr-signer, which only the node dashboard serves. Opened
directly, e.g. on a public hostname, that hid the browser's NIP-07
extension and login failed with "NIP-07 timeout". The bundled copy was a
no-op outside an iframe, which is what index.html assumed.

Load the provider only when framed, via document.write so it stays a
blocking script that runs before the app and keeps document.currentScript
for its data-* settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:52:53 +00:00

28 lines
1.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>podsteadr</title>
<!-- Inside the Archipelago shell, nostr-provider.js provides window.nostr
+ auto sign-in via the node's selected nostr identity. Load it only
in an iframe: Archipelago's current provider also replaces
window.nostr in a top-level tab, routing signing to
<origin>/nostr-signer, which only the node dashboard serves. Opened
directly (a public hostname, a new tab) that hides the browser's own
NIP-07 extension and every request ends in "NIP-07 timeout".
document.write keeps it a blocking script, so it still runs before
the app and document.currentScript still carries the data-*
settings. -->
<script>
if (window !== window.top) {
document.write('<script src="/nostr-provider.js" data-session-url="/api/auth/login" data-session-mode="cookie" data-me-url="/api/auth/me" data-health-url="/api/health"><\/script>');
}
</script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>