Closed billiegoose closed 6 years ago
Holyshit I just realized this idea can be generalized to any node module. Oh man. Hang on this is nutz. I can't believe nobody has done this. (Also, I can't believe the Chrome Web Store is flooded with extensions that do nothing but replace the text "Node.js" with "The One True Dev Language" or "My Butt".)
I don't think you even need an extension if you have a local service running. My goal is to allow browser pages to talk to the local gateway directly, and fallback to public discovery-swarm gateways if one doesn't exist. With this you can skip the first step and have the JS import a library which implements the discoverySwarm API and auto-discovers a gateway.
A few years ago I was inspired by leapmotion's JavaScript SDK, it started a local WS server along with the software needed to make the leapmotion work, and the JS SDK automatically connected to the server if it existed. From the point of view of a developer, I just had to focus on the JS API, and the integration was handled for me behind the scenes.
I really want to have a similar experience with this. Just import the module in your JS, and use it (optionally specifying a domain for the WS server).
Ah, I see. Yeah... so a raw WebSocket API would be annoying, I think, but wrapped in a small JS library that makes a lot of sense. I still think there's room for a browser extension - I really like the IPFS Companion chrome extension - but that might be orthogonal / unrelated to the WebSocket idea.
@fsteff is working on an Android thing that injects globals into a WebView in order to provide the dns-discovery functionality.
😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁
So much good stuff happening! I decided not to pursue the browser extension idea, and stay focused on hypergit
and isomorphic-git
. I need to get isomorphic-git to the point where you can clone over WebRTC.
My dream / vision would be:
Example page usage: