Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add browser extension support #460

Closed
bgins opened this issue Jan 9, 2023 · 4 comments · Fixed by #504
Closed

Add browser extension support #460

bgins opened this issue Jan 9, 2023 · 4 comments · Fixed by #504
Assignees
Labels
enhancement New feature or request

Comments

@bgins
Copy link
Member

bgins commented Jan 9, 2023

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:

  • Webnative version
  • App namespace
  • Username
  • Account DID
  • Agent DID
  • Filesystem skeleton
  • Data root CID
  • Capabilities (what parts of WNFS does the app have access to?)
  • Bitswap activity and connection details (Maybe not? We may be abandoning bitswap soon.)

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 bgins added the enhancement New feature or request label Jan 9, 2023
@bgins
Copy link
Member Author

bgins commented Jan 9, 2023

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
Copy link
Contributor

jeffgca commented Jan 10, 2023

Some initial bootstrapped code is here:

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

@bgins
Copy link
Member Author

bgins commented Jan 17, 2023

Tracking issue for work on the extension: oddsdk/odd-devtools#2

@bgins
Copy link
Member Author

bgins commented Jan 25, 2023

Issue covering communication with the extension: oddsdk/odd-devtools#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants