Mozilla project libdweb was an attempt to bridge the gaps in the web platform and enable new protocols like IPFS, Dat, SSB within the Firefox. In collaboration with corresponding protocol authors I have identified set of missing capabilities and implemented those as an experimental Firefox extensions APIs.
Protocol API provided a mechanism for adding custom protocol implementation to Firefox. I mostly followed ServiceWorker API, but in unlike that API registration happens against a protocol scheme (e.g. dat://
) instead of an origin and a path.
API provides DNS-Based Service Discovery API as per rfc6763. It allows user to broadcast / discover available services on the local network.
Implementation provides raw UDP Socket access and I mostly followed W3C UDP Socket specification. To simply adoption I have also implemented NodeJS dgram API adapter @libdweb/dgram-adapter.
Implementation provides access to TCP client and server sockets. I mostly following W3C TCP Socket specification. @substack developed NodeJS net API compatibility adapter.
Implementation provided API to provide access to an OS file system, restricted to a user chosen directory. However later API was dropped in favor of non-standard IDBMutableFile Web API.
I have also implemented random-access-idb-mutable-file providing random-access-storage backed by IDBMutableFile to make hypercore usable from with-in protocol handler.