oddsdk / ts-odd

An SDK for building apps with decentralized identity and storage.
https://odd.dev/
Apache License 2.0
178 stars 24 forks source link

Add browser extension support #460

Closed bgins closed 1 year ago

bgins commented 1 year ago

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 to true 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.

bgins commented 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.

jeffgca commented 1 year ago

Some initial bootstrapped code is here:

https://github.com/therealjeffg/webnative-devtools

bgins commented 1 year ago

Tracking issue for work on the extension: https://github.com/webnative-examples/webnative-devtools/issues/2

bgins commented 1 year ago

Issue covering communication with the extension: https://github.com/webnative-examples/webnative-devtools/issues/8