diff options
| author | Adam Soltys <[email protected]> | 2026-11-19 21:53:03 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-11-19 21:53:03 -0700 |
| commit | 69997b1cf47470bbe098ca042b5b64ef5e8873e6 (patch) | |
| tree | faa48099ca3582bf483bde0273fbe751aabb4219 /extension/src/popup.html | |
| parent | 01c03a199f8aafacfcdbaac30af074dd1d56fc53 (diff) | |
| download | coinosv3-master.tar.gz coinosv3-master.zip | |
A browser extension that signs for nostr sites without asking twice, and pays from a Coinos wallet. "I'm using Sidecar right now, and I don't like how I have to reauthorize it. It prompts me too much. I just want it to automatically sign all the time with my key" (Adam, 2026-11-19). The extension (extension/, Chrome, Manifest V3) gives every page window.nostr (NIP-07: getPublicKey, signEvent, nip04, nip44) and window.webln. A site is asked once: "Always allow" is remembered with no expiry until the site is removed in the popup, "Never for this site" blocks it, and closing the window refuses that one call. Signing and paying are separate permissions. The key is an nsec or a wallet's twelve words (NIP-06), kept in the extension's storage unencrypted so it can sign without a prompt. The wallet is the person's own Coinos wallet over Nostr Wallet Connect: the extension holds a connection string, the wallet enforces that connection's budget, and the popup shows the balance and recent payments. Build with `bun extension/build.js` and load extension/dist unpacked. New extension-test loads the built extension into Chrome with its own relay and wallet service and passes (28 checks).HEADmaster
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VMan6WFVA5qCuTtny8PRL6
Diffstat (limited to 'extension/src/popup.html')
| -rw-r--r-- | extension/src/popup.html | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/extension/src/popup.html b/extension/src/popup.html new file mode 100644 index 0000000..331b838 --- /dev/null +++ b/extension/src/popup.html @@ -0,0 +1,49 @@ +<!doctype html> +<html lang="en"> +<head><meta charset="utf-8"><title>Coinos</title><link rel="stylesheet" href="ui.css"></head> +<body> + <section id="setup" hidden> + <div class="card"> + <h1>Set up your key</h1> + <p class="muted" style="margin-top:6px">Paste your nsec, or the twelve words of a Coinos wallet. It stays in this browser and is never shown to a site.</p> + <textarea id="key-input" spellcheck="false" autocomplete="off" aria-label="nsec or twelve words"></textarea> + <p class="err" id="key-err"></p> + <button id="key-save" class="primary" style="width:100%">Save key</button> + </div> + </section> + + <section id="main" hidden> + <div class="head"> + <img id="pic" src="icon-192.png" alt=""> + <div class="who"> + <div id="name" style="font-weight:650"></div> + <div class="mono muted" id="npub"></div> + </div> + <button id="copy">Copy</button> + </div> + + <div class="card" id="wallet-on" hidden> + <h2>Wallet</h2> + <div class="balance" id="balance">…</div> + <p class="err" id="wallet-err"></p> + <ul id="txs"></ul> + <p class="small" style="margin:10px 0 0"><button id="wallet-remove" class="link">Disconnect wallet</button></p> + </div> + <div class="card" id="wallet-off" hidden> + <h2>Wallet</h2> + <p class="muted">To pay from sites, open Coinos, go to Settings and add a connection under Nostr Wallet Connect, then paste its connection string here.</p> + <textarea id="nwc-input" spellcheck="false" autocomplete="off" aria-label="Connection string" placeholder="nostr+walletconnect://…"></textarea> + <p class="err" id="nwc-err"></p> + <button id="nwc-save" class="primary" style="width:100%">Connect wallet</button> + </div> + + <div class="card"> + <h2>Sites</h2> + <p class="muted small" id="no-sites">No site has asked yet. The first time one does, you choose once.</p> + <ul id="sites"></ul> + </div> + <p class="small" style="text-align:center"><button id="key-remove" class="link">Remove key from this browser</button></p> + </section> + <script type="module" src="popup.js"></script> +</body> +</html> |
