All 13 steps shown. Press Step through it or select any numbered marker to inspect each hop.
pick.html open and runs both workers inside the popup instead. If a browser fails to enforce Dedicated Worker CSP, the call worker falls back to a hidden /call/<provider> iframe.Read all 13 steps as text
When the site loads
- The site appends a hidden
llmchannel.dev/frame.htmliframe and transfers one end of aMessageChannelinto it, keeping the other end as its prompt port. - The iframe spawns
frame-worker.js(withconnect-src 'none') and forwards the site's prompt port into it.
When you choose a model
- You click Connect / Choose a model, which opens
llmchannel.dev/pick.htmlas a top-level popup that can read your saved accounts. pick.jsloops throughopener[i]frames and posts a fresh popup-to-iframe port withtargetOriginpinned tohttps://llmchannel.devso the browser drops host decoys.- The real router iframe replies on that port with the browser-stamped host origin (captured on step 1) and an ephemeral ECDH P-256 public key. The popup shows that origin for approval.
- You pick an account, model, and request/day cap. Web Crypto re-wraps your API key directly from top-level storage to the iframe's public key without exposing plaintext in popup JS.
- The popup sends the grant metadata and wrapped ciphertext across that port to the iframe, which stores them in partitioned IndexedDB alongside its non-extractable
["decrypt"]CryptoKey. - The popup closes, leaving no router UI on screen.
On every prompt (or lent MessagePort / Pi turn)
- The host site posts a prompt and a fresh per-request reply port down the site-to-iframe port into
frame-worker.js. frame-worker.jsverifies expiry and cap in onereadwriteIndexedDB transaction and increments the request counter atomically (deleting the grant if spent).- The worker forwards the prompt, ciphertext, and
["decrypt"]handle to/call-worker/<provider>.js(a Dedicated Worker whose CSP allows outbound requests only to that provider's single URL). - After verifying its own CSP via
securitypolicyviolation, the call worker decrypts the API key in memory and sends the HTTPS request straight to the model provider. - The provider streams chunks back through the call worker and
frame-worker.jsdown the reply port to the host site.