-
Notifications
You must be signed in to change notification settings - Fork 330
[PoC] libdweb experiment: protocol handler API #533
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
Conversation
This is a first step on the road to native protocol handler and more. mozilla/libdweb is included as a git submodule, which enables us to develop against latest API prototypes with as little overhead as possible. `libdweb-build` will produce extension bundle with access to experimental APIs `firefox:libdweb` will start Firefox Nightly with mentioned bundle. Make sure firefox-nightly is on your PATH
Just a basic handler that reads images and returns them to the browser. TODO: - support directory listing - support streaming - support mime-sniffing
+ cleanup of libdweb scripts
- port directory detection from streaming branch in Muon-Brave - detect streaming responses and return them as async iterator - trivia: switch from uglify-es to terser to support for-await
|
Added:
|
|
Small update: got IPNS working during a short workshop at Dweb Summit :-) Also, simplified |
js-ipfs does not support IPNS yet, but it has ipfs.dns API for dnslink lookup, which actually all we need
We want npm run libdweb work on MS Windows as well.
18e78bf to
89543d1
Compare
|
Ack. We are using async handler for multiple reasons, setting arbitrary (future: ipld/legacy-unixfs-v2#11) content type being only one of them (dnslink lookup and other apis are/will be async as well). Also, some updates:
|
We mix different module types for now, this restores branch to buildable state.
|
This PR was important step towards demonstrating value of IPFS in the browser context, and how future could look like, and unlocked collaborations with Brave, Opera and more to come. Sadly Mozilla dropped the ball on libdweb in 2019 and APIs used in this PR never landed in Firefox Nightly, and after a year of no activity it is time to close it together with #553 |

ipfs://andipns://sitting on a treeBackground
This PR aims to implement
ipfs://andipns://usingbrowser.protocol.registerProtocolAPI frommozilla/libdweb. The goal is to ensure proposed API delivers everything IPFS needs, and squash some bugs in the process.Developer notes on working with libdweb can be found in
docs/libdweb.mdref mozilla/libdweb#2, #343, #164, ipfs/in-web-browsers#6, ipfs/in-web-browsers#14, ipfs/specs#152
cc @Gozala @kyledrake
4 min demo (August 2018)
Tasks
libdwebbranch which runs libdweb experiments from a single commanddocs/libdweb.mdwith developer notes(API supports this, I am just too sleepy to add this today, will happen soon)
- IN PROGRESS 🚧 🏗️
Known Issues
HTML issues
ipfs://pages<img src=<video>if it was not present in browser cache beforeipns://loadingipfs://) do not loadMissing API / Spec Issues
IPFS-specific, UX Issues, Other
addon-lintershipping withweb-extneeds to be updated (Generator function causing JS_SYNTAX_ERROR mozilla/addons-linter#2108 (comment))ipfs://QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR) are lowercasesed and produce an error. We should provide conversion tool for user on the error screen, but we need go-ipfs and js-ipfs to support lookups for CIDv0 converted to CIDv1 first.ipfs://bafybeigwa5rlpq42cj3arbw27aprhjezhimhqkvhbb2kztjtdxyhjalr3q/big-buck-bunny_trailer.mp4ipns://tr.wikipedia-on-ipfs.org/wiki/G%C3%BCne%C5%9F_r%C3%BCzg%C3%A2r%C4%B1.html(lack of unescaping)onBeforeRequestblocked by upstream issue: Allow webRequest.onBeforeRequest to redirect to libdweb protocol handler mozilla/libdweb#74Test Resources
IPFS
ipfs://bafybeie5gq4jxvzmsym6hjlwxej4rwdoxt7wadqvmmwbqi7r27fclha2va(CID codec:dag-pb)ipfs://bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy/(CID coded:raw)ipfs://bafybeidvtwx54qr44kidymvhfzefzxhgkieigwth6oswk75zhlzjdmunoy/linkify-demo.htmlipfs://babybeiccrv3uc3hjipdnwf4nnntbxuwvt4pn5dsgelvvyueucracbevthaipfs://babybeiccrv3uc3hjipdnwf4nnntbxuwvt4pn5dsgelvvyueucracbevtha/go-proofs/README.mdipfs://bafybeigwa5rlpq42cj3arbw27aprhjezhimhqkvhbb2kztjtdxyhjalr3q/big-buck-bunny_trailer.webmipfs://bafybeigxjv2o4jse2lajbd5c7xxl5rluhyqg5yupln42252e5tcao7hbge<video src="ipfs://cidv1b32" />ipfs://bafkreihosso7nxtyhjtpvjmrdoflyup6ex6b2xgzezibavuonobt2l4daiipfs://qmbwqxbekc3p8tqskc98xmwnzrzdtrlmimpl8wbutgsmnr/ipfs://QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6ucoIPNS
ipns://docs.ipfs.ioipns://cid-utils.ipfs.teamipns://tr.wikipedia-on-ipfs.orgipns://explore.ipld.ioipns://explorecatena.comScreenshots