PWA with handlers for ipfs:// and ipns:// #21
Labels
effort/hours
Estimated to take one or several hours
enhancement
New feature or request
exp/beginner
Can be confidently tackled by newcomers
help wanted
Extra attention is needed
kind/architecture
Core architecture of project
kind/enhancement
A net-new feature or improvement to an existing feature
P2
Medium: Good to have, but can wait until someone steps up
status/ready
Ready to be worked
When packaged as PWA, SW gateway root could double as a very nice light mobile client. If we create a compelling landing page that could double as a mobile app, we would be bringing light IPFS node with built-in verifiable
ipfs://
andipns://
URL support to mobile users (android etc) virtually for free.Background
It is possible to create a Progressive Web App (PWA) with a manifest file that declares the app as a handler for specific protocols or URLs. This allows PWAs to provide handler of certain URLs or protocols.
The user experience is pretty good on mobile platforms, especially Android, where PWA support is built into the operating system.
Implementation notes and caveats
example.com
<link rel="manifest" href="/manifest.json">
and there would be PWA manifest atexample.com/manifest.json
manifest.json
would haveurl_handlers
section which defines two handlers that implementuri
router from subdomain spec:ipfs:
→/ipfs/?uri=%s
→ decodeipfs://
URL, redirect to proper subdomainipns:
→/ipns/?uri=%s
→ decodeipns://
URL, redirect to proper subdomain#uri
here to avoid sending request to http server, and doing URI decoding and redirect viawindow.location.replace
%s
is percent-encoded URL with custom scheme likeipfs://cid/optional/path
making the URL looks like this:?uri=ipfs%3A%2F%2FQmYizgL5Gn6zZFK8n5thwULT4q12P5yVAT1V4xuicp8226%2Ffavicon-32x32.png
The text was updated successfully, but these errors were encountered: