mfoster.io on Nostr: Have you looked into Shared Workers?You can use postMessage across different browser ...
Have you looked into Shared Workers?You can use postMessage across different browser contexts with them allowing you to maintain a single WebSocket connection shared across several tabs, windows and iframes.
The key thing to think about is origins and the secure context. On another note, I was inspecting cashu.me and saw you are utilizing local storage. Have you looked into OPFS - (Origin Private File System) yet? You can tuck away any files or data away in a safe non viewable local file storage api with it. You can also store SQLite databases there and even encrypt the data at rest with the seed phrase. There is an in WebAuthn pseudorandom function HMAC secret in the FIDO spec. It could add some added security as well.
https://levischuck.com/blog/2023-02-prf-webauthn
https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-hmac-secret-extension
I was digging into all this for my project here.
https://mfosterio.github.io/ldux-local/
The key thing to think about is origins and the secure context. On another note, I was inspecting cashu.me and saw you are utilizing local storage. Have you looked into OPFS - (Origin Private File System) yet? You can tuck away any files or data away in a safe non viewable local file storage api with it. You can also store SQLite databases there and even encrypt the data at rest with the seed phrase. There is an in WebAuthn pseudorandom function HMAC secret in the FIDO spec. It could add some added security as well.
https://levischuck.com/blog/2023-02-prf-webauthn
https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-hmac-secret-extension
I was digging into all this for my project here.
https://mfosterio.github.io/ldux-local/