-
Notifications
You must be signed in to change notification settings - Fork 490
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
Problem with window.ipfs and Files/Settings #787
Comments
I don't think we can ask You are right, the sandboxed version of WebUI is going to cause confusion and bug reports. I feel like we should put our energy into coming up with a mechanism to let apps get hold of an unsandboxed api. Right now we are blocking access to things from window.ipfs that can be trivially circumvented by making an XHR request from the page. Possible routes through are
In the meantime we should fix the issue you identify in this issue. We still need to show a sensible UI if the user decides to not give web ui access to all the things. |
Final thoughts:
|
Why not just |
We want to avoid defaulting to webui.ipfs.io as the source of truth in go-ipfs and companion for various reasons, most important being:
|
@lidel gotcha and it makes sense. We need to have it embedded to make sure it works on private networks and in places where ipfs.io might be blocked, as well as when there is some DNS error. |
@lidel Do you think we should we be skipping window.ipfs in Web UI as a priority? It's a shame, but it does seem like a source of confusion. If Companion is set up to redirect to it's bundled version, and as regular Web UI allows you pick your API endpoint, and there are additional gotchas in using window.ipfs here, most notably the files list silo-ing, it feel like that's the conclusion here. |
@olizilla I think it makes sense to skip it for now. There is UI for customizing HTTP port now, so there would be no functional regression. We can revisit the decision when window.ipfs 2.0 lands (+we will take needs of webui into consideration while designing it). (Alternative is to add a banner in Files screen explaining sandboxing (#818)). |
Something that we should address before shipping the first iteration:
Background
When WebUI is bundled with IPFS Companion it detects and uses original API object available in WebExtension context, but if WebUI is loaded over HTTP it tries to use
window.ipfs
injected by IPFS Companion.Problem
The problem with
window.ipfs
in current form is a limited subset of IPFS API and sensitive things like access toipfs.config.*
is blocked and access toipfs.files.*
is sandboxed.Current UX is problematic.
window.ipfs
not only disables the Settings screen, but the sandboxing make it look like Files screen is broken.User will be really confused if
ipfs files ls
shows files in the terminal, but WebUI claims it is empty.Solution
String(error)
):https://github.com/ipfs-shipyard/ipfs-webui/blob/a67135c0a5041ed5c7a6d5216e9b664cb5336726/src/bundles/config.js#L64
It may be a good UX to display faded-out breadcrumbs prefixing root with the path of sandbox root.
Thoughts?
The text was updated successfully, but these errors were encountered: