ipfs / ipfs-companion

Browser extension that simplifies access to IPFS resources on the web
https://docs.ipfs.tech/install/ipfs-companion/
Creative Commons Zero v1.0 Universal
2.08k stars 325 forks source link

Improve onboarding on Firefox for Android #690

Open comntr opened 5 years ago

comntr commented 5 years ago

I've installed it on my Firefox Android, hoping that it'll use some native APIs not available to web apps to connect to the IPFS network, but it didn't. Instead it's shown me a screen with instructions to run an IPFS daemon (on a phone?). It's fine if the extension is merely a relay to the local daemon, but this needs to be clearly called out in the description in the first paragraph.

lidel commented 5 years ago

Thank you for raising these issues to our attention.

Which specific description you have in mind? Text on Firefox Add-On store or the one in README#features? Do you have any specific wording in mind that would be appropriate?

I fully agree, we should display different instructions when running on a phone.

For now:

Our goal is to enable "embedded node" by default, but we are not there yet (need to ensure proper connection management is in place, as we don't want to drain your battery).

comntr commented 5 years ago

Something along the lines: "This extension connects to the locally running IPFS daemon/node and exposes its interface via the window.ipfs JS variable."

lidel commented 5 years ago

window.ipfs is just an experiment, so I simplified it to:

This extension connects to the locally running IPFS node and exposes its interface and selected features to the user.

Let's keep this issue open until:

Mikaela commented 5 years ago

Is the extension only for connecting to local gateway? I think I have seen discussions where the goal is said to be the first taste of IPFS (for a new user even if they don't run their own node) or a "gateway drug" for making them to install a full IPFS node and contribute to the network (which is probbaly enabling the embedded node?).

lidel commented 5 years ago

@Mikaela You will have the best experience if you run ipfs-companion with local/remote go-ipfs or ipfs-desktop, but we are working on making embedded js-ipfs more and more useful, and there is even an issue about WASM build of go-ipfs. Ideally, the node embedded in extension itself would work out of the box and be "good enough" for casual users, but we are not there yet:

With currently existing WebExtension APIs ipfs-companion is unable to inject/spoof HTTP responses, or register a streaming protocol handler. We can only redirect. That is why we need local or public gateway (as an endpoint to redirect to).

There are experimental APIs in customized Firefox Nightly (streaming protocol handler from libdweb) and Chromium (exposing embedded HTTP gateway via chrome.sockets) that remove this limitation, but in mainstream browsers (Firefox/Google Chrome) we are stuck with existing APIs and the need for local gateway.

As a sidenote, an alternative approach may come from recent Progressive P2P Web Apps experiments. That work might enable ipfs-companion to act as a provider for Service Worker-based access point, and return IPFS payloads that way. But for now, its just my speculation :)