It’s a race condition, so it doesn’t happen all the time, I don’t have a URL to point to since an app that doesn’t handle it already for you is essentially non-functional, but it’s a known issue that apps need to handle.

I use alby, so I’ve observed this with it but people using nos2x report the same. I guess particularly when loading other extensions the context of the page runs before the extension

Reply to this note

Please Login to reply.

Discussion

if you still see this, point me to a page where this happens.

Quite a long time ago this was optimized and with MV3 browsers I think also made this easier.

There was the discussion of adding an event similar to how it actually works with DOMContentLoaded and other events which I think would be the cleaner way if something is really needed.

and isn't it easy to do this fully on the client side?

for example like this: https://gist.github.com/bumi/050a29cef2f6f9f9d7960d834104890a

making a queue and wait a but until window.nostr is enabled?

I think the window.nostr should be as stupid as possible to also make it easier for other ways to implement it. (e.g. nsecbunker and such)

syntactic sugar and such nice things I would try to put in the client -maybe even some library.