Comments (2)
By default, for the way the addon is develop at this moment, the scripts that load the addon are loaded after the page completed to load.
Specifically, the file that creates the window.nostr
object is this nostr-provider.js, which is injected here content-script.js. According to https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts we could configure the manifest.json so that the addon content scripts file loads while the page is loading (that is, earlier) by specifying run_at: 'document_start'
. But the behavior should be properly tested.
Having said that, what you want is some kind of notification or event once the window.nostr
is ready to use, right? As you detected, there's nothing like that yet because the addon behaves mainly as a reactive extenstion.
You can try and modifiy this extension so after having everything ready it fires some event. Otherwise I would suggest you implement some timed logic after the page loads. For example, after the page loads you wait a few seconds and keep looking for window.nostr
until it's there.
I'll keep this in mind to add something in the future. But happy to accept a PR if you want to add it.
from nos2x-fox.
Did you make progress on this @donpdonp ?
from nos2x-fox.
Related Issues (20)
- [Feature Request] Mask or hide private keys HOT 3
- [Feature Request] Add support for setting up multiple profiles keypair HOT 6
- Install on Firefox mobile HOT 2
- [Feature request] Add ability to sign for longer periods of time (1 hour, 8 hours?) HOT 2
- Improving security with manual approval code for each sign? HOT 1
- Support of multiple keys for using the extension with multiple identities HOT 1
- [Feature Req] Allowlist certain specific types or kinds of requests HOT 1
- [FEATURE REQUEST] Private Key Masking HOT 1
- The logo is invisible on my FF HOT 3
- Permissions not showing in Options HOT 3
- Failed to save a key with version 1.12.0 HOT 1
- Unable to Export profile HOT 2
- [Feature Request] Master password HOT 1
- Extension can easily flood the user with popups HOT 6
- Allow probing for permissions HOT 6
- will this be available for android? HOT 4
- Name a Profile
- Closing the prompt window doesn't reject events HOT 1
- Add nip44 support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nos2x-fox.