Privileged window.ipfs API access for WebUI #514
Labels
area/window-ipfs
Issues related to IPFS API exposed on every page
kind/enhancement
A net-new feature or improvement to an existing feature
kind/maintenance
Work required to avoid breaking changes or harm to project's status quo
P1
High: Likely tackled by core team if no one steps up
status/in-progress
In progress
topic/security
Work related to security
Milestone
Background
We need a way to expose full API without any sandboxing or ACL controls for use in safe pages bundled with extension itself (eg. we plan to do that with new WebUI).
Below is the battle plan and work done so far.
cc @olizilla
Tasks
Prerequisites
window.ipfs
first (remove access to sensitive namespaces)window.ipfs
support to WebUIipfs.config.get
and other sensitive spaceswindow.ipfs
without sandboxing (full MFS, r/w config etc)Research
window.ipfs
inmoz-extension://
contextsmoz-extension://
URLs, even if<all_urls>
is used (most likely a security feature to block extensions from snooping in internals of other extensions).moz-extension://<companion>/webui/index.html
, it will be running in browser extension context. This means it will seebrowser.*
namespace, enabling it to detectbrowser.extension.getBackgroundPage()
just like regular websites detectwindow.ipfs
. This way the IPFS API Client used by extension itself can be obtained via WebExtension API directly.postMessage
is no fun performance-wise (eg. Storing files of a few megabytes to window.ipfs.files.add hangs Firefox for a minute or more #485) and this approach works around that problem space entirely.Implementation
getBackgroundPage
) in WebUIwindow.ipfs
in WebUIwindow.ipfs
getBackgroundPage
is in browser extension.Professor Butts and the Privileged API Access for WebUI (1931)
The text was updated successfully, but these errors were encountered: