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

PWA with handlers for ipfs:// and ipns:// #21

Open
lidel opened this issue Feb 13, 2024 · 1 comment
Open

PWA with handlers for ipfs:// and ipns:// #21

lidel opened this issue Feb 13, 2024 · 1 comment
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

Comments

@lidel
Copy link
Member

lidel commented Feb 13, 2024

This is something we could explore when more pressing things are implemented, after we deploy service worker gateway under long-term domain name.

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:// and ipns:// 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

  • Assuming we have subdomain service worker gateway at example.com
  • Requesting main domain would return HTML with <link rel="manifest" href="/manifest.json"> and there would be PWA manifest at example.com/manifest.json
  • manifest.json would have url_handlers section which defines two handlers that implement uri router from subdomain spec:
    • ipfs:/ipfs/?uri=%s → decode ipfs:// URL, redirect to proper subdomain
    • ipns:/ipns/?uri=%s → decode ipns:// URL, redirect to proper subdomain
    • note: we may be able to use #uri here to avoid sending request to http server, and doing URI decoding and redirect via window.location.replace
    • note: %s is percent-encoded URL with custom scheme like ipfs://cid/optional/path making the URL looks like this: ?uri=ipfs%3A%2F%2FQmYizgL5Gn6zZFK8n5thwULT4q12P5yVAT1V4xuicp8226%2Ffavicon-32x32.png
@SgtPooki SgtPooki added this to the Prod: Initial release milestone Apr 8, 2024
@lidel lidel self-assigned this Jun 24, 2024
@lidel lidel mentioned this issue Jul 1, 2024
4 tasks
@SgtPooki SgtPooki added enhancement New feature or request effort/days Estimated to take multiple days, but less than a week exp/intermediate Prior experience is likely helpful kind/architecture Core architecture of project kind/enhancement A net-new feature or improvement to an existing feature P1 High: Likely tackled by core team if no one steps up status/ready Ready to be worked labels Nov 4, 2024
@lidel
Copy link
Member Author

lidel commented Dec 5, 2024

Mostly done in #310, remaining work here here is to add protocol handlers to manifest:

It should use the same handler as one described in

@lidel lidel added P2 Medium: Good to have, but can wait until someone steps up and removed P1 High: Likely tackled by core team if no one steps up labels Dec 5, 2024
@lidel lidel removed their assignment Dec 5, 2024
@lidel lidel removed this from the IPFS Camp 2024 milestone Dec 5, 2024
@lidel lidel added effort/hours Estimated to take one or several hours help wanted Extra attention is needed exp/beginner Can be confidently tackled by newcomers and removed effort/days Estimated to take multiple days, but less than a week exp/intermediate Prior experience is likely helpful labels Dec 5, 2024
@lidel lidel changed the title Package as PWA with handlers for ipfs:// and ipns:// PWA with handlers for ipfs:// and ipns:// Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants