Create WebExtensions Experiments to Prototype Missing APIs
#343 创建于 2017年12月19日
仓库指标
- Star
- (1,992 star)
- PR 合并指标
- (平均合并 53天 3小时) (30 天内合并 1 个 PR)
描述
Background
WebExtensions are a cross-browser system for developing browser add-ons.
Firefox has a transparent process for triaging requests for new APIs, plus there is a special SDK for creating WebExtensions Experiments .
WebExtensions Experiments allow developers to write experimental WebExtensions APIs for Firefox. They can be used to prototype APIs for landing in Firefox, or for use on Nightly or Developer Edition.
Open Problems in Browser Contexts
- Problem #1: Inability to Inject HTTP Responses by WebExtension
- Problem #2: Inability to Control How Origin Is Calculated
- FYSA this is a complex problem and there is very little will to change how existing Origin-based perimeter is calculated. Due to this, we decided to focus on re-using current Origin logic by putting CID in the authority component:
ipfs://<cidv1b32>/in the near future
- FYSA this is a complex problem and there is very little will to change how existing Origin-based perimeter is calculated. Due to this, we decided to focus on re-using current Origin logic by putting CID in the authority component:
- Problem #3: Inability to Control Address in Location Bar
- WebRTC does not work in Web Worker
- No access TCP/UDP Socket API
- No way to announce node in local network (need for a beacon API, such as Multicast DNS)
- No filesystem API, low performance of IDB
Experiments to Prototype
Work below is up-for-grabs, unless marked as "in progress".
mozilla/libdweb
This repositiory hosts community effort of implementing experimental APIs for Firefox WebExtensions with a goal of enabling dweb protocols in Firefox through an add-ons. The long term goal of this project is to eventually integrate this APIs into WebExtensions ecosystem. – https://github.com/mozilla/libdweb
- Streaming protocol handler (with mime-sniffing and directory listing) (https://github.com/mozilla/libdweb/issues/2)
- MulticastDNS (https://github.com/mozilla/libdweb/issues/7)
- TCP/UDP Sockets (https://github.com/mozilla/libdweb/issues/5, https://github.com/mozilla/libdweb/issues/4)
- Virtual Filesystem API (improved storage backend for js-ipfs-repo) (https://github.com/mozilla/libdweb/issues/13)
- Real Filesystem API (mounting directory picked by user) (https://github.com/mozilla/libdweb/issues/8)
References
- https://github.com/ipfs/team-mgmt/blob/master/meeting-notes/2017/2017-10-02--lab-week-discussions-on-ipfs-in-browser-extension.md
- https://webextensions-experiments.readthedocs.io/en/latest/
- https://github.com/web-ext-experiments/about
- Bugzilla: Bug 1271553 - Add ability to implement programmable custom protocol handler
- "Problems 2&3" were born in comment 47
(note that it is 1 year old, was written before our
browser.protocolPoC in Brave) - "Problem 1" – comment 52
- "Problems 2&3" were born in comment 47
(note that it is 1 year old, was written before our
- protocol handler prior art
browser.protocol.*APIs from brave/muon and electron (background: https://github.com/ipfs-shipyard/ipfs-companion/issues/312#issuecomment-352471005)protocol.registerStringProtocol(electron, brave/muon)protocol.registerBufferProtocol(brave/muon)protocol.registerStreamProtocol(electron)