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

Make share a Web Share Target #106

Open
autonome opened this issue Feb 4, 2021 · 7 comments
Open

Make share a Web Share Target #106

autonome opened this issue Feb 4, 2021 · 7 comments
Labels
effort/days Estimated to take multiple days, but less than a week exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature need/analysis Needs further analysis before proceeding P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked

Comments

@autonome
Copy link

autonome commented Feb 4, 2021

Adds to the existing PWA functionality by allowing page to be listed in the share sheet on Android, ChromeOS and more OS are interested and heading this direction.

https://web.dev/web-share-target/

@autonome autonome added the need/triage Needs initial labeling and prioritization label Feb 4, 2021
@jessicaschilling
Copy link
Contributor

@rafaelramalho19 can you please take this one when you are done with translation?

@lidel
Copy link
Member

lidel commented Feb 4, 2021

Quick thoughts:

  • This will be difficult to pull off without having a regular HTTP backend:
    • The API is designed around
      • 💛 HTTP GET for sharing smaller data types (text, links)
        • We could explore accepting smaller data types and pass it via #share:{data}. Success depends on the type of shared data:
          • 💚 TEXT – should be easy, just add it to IPFS as note-{timestamp}.txt or something
          • 💛 CID or IPFS PATH or URL to public gateway – easy-ish. Add it to the list of shared items + trigger preload on public gateway.
          • 💔 URL – it could trigger download of data behind it via fetch, read bytes from fetched body (if possible due to CORS etc) and import to IPFS on the fly
            • CORS is the main problem, it's very difficult to get it to work everywhere. For a prior art example, Twitter on Firefox won't allow our JS to read the payload (Right click upload via ipfs.util.addFromURL sometimes does not work ipfs/ipfs-companion#227), we may have a similar type of problem with regular JS not running in privileged extension, being limited by fetch and CORS (lack of access to the body). This means we need to do additional analysis if this approach is even feasible, my guess is that is not.
      • 💔 HTTP POST for file upload
        • share.ipfs.io is a static app that takes CID via #fragment, we don't have POST /api/v0/add exposed anywhere
        • we could consider running a writable gateway or something, but that's way out of scope for a hack week

TLDR worth exploring, but requires more analysis and time than we have this week, I advise against shipping suboptimal experience too fast.

Before we go into this rabbit home, we should add basic PWA manifest, so people can install share.ipfs.io as an icon on their phone.
I created #108 for tracking PWA support.

@jessicaschilling
Copy link
Contributor

Makes sense. @rafaelramalho19 if you're able to work on #108 instead, that would be good.

@rafaelramalho19
Copy link
Contributor

@lidel correct me if I'm wrong, but we can actually upload files in the webapp. Read https://web.dev/web-share-target/#processing-post-shares

@lidel
Copy link
Member

lidel commented Feb 4, 2021

@rafaelramalho19 that is possible only if user runs local IPFS node (eg. IPFS Desktop) that exposes http://localhost:5001/api/v0/add` (POST endpoint)

Mobile users won't have that, and share.ipfs.io will use js-ipfs node embedded on the page itself, so they won't have localhost endpoint.

@rafaelramalho19
Copy link
Contributor

Couldn't allow this on my phone (Android Samsung S8) 😢

@jessicaschilling
Copy link
Contributor

Going to move this out of the hack week to-do list since we merged #108, but community contributions on this are more than welcome! 🙏 Please comment in this issue with any questions, or to let us know when you get started. Thanks!

@jessicaschilling jessicaschilling added exp/intermediate Prior experience is likely helpful effort/days Estimated to take multiple days, but less than a week help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature need/analysis Needs further analysis before proceeding P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked and removed need/triage Needs initial labeling and prioritization labels Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/days Estimated to take multiple days, but less than a week exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature need/analysis Needs further analysis before proceeding 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

4 participants