Closed bgins closed 1 year ago
A couple of early thoughts about implementation.
We could add a webnative
property to a global like window.navigator
to expose the information. This would make the information available, but we would still need to send messages when values change.
We may also be able to implement this entirely with message passing. Rather than exposing the values on a global, send a message at initialization and with each update.
Some initial bootstrapped code is here:
Tracking issue for work on the extension: https://github.com/webnative-examples/webnative-devtools/issues/2
Issue covering communication with the extension: https://github.com/webnative-examples/webnative-devtools/issues/8
Summary
Problem
Webnative does not expose information in a way that is accessible to browser extensions.
Impact
Browser extensions cannot easily interface with apps that use Webnative.
Solution
Implement an API that browser extensions can interface with to query Webnative for:
The information should only be exposed when the developer has set
debug
totrue
when initializing a Webnative program.Webnative should send messages to a browser extension when any of the above values change. We want to avoid polling for changes.