ServiceWorker-like protocol handlers for WebExtensions #212
Labels
dif/expert
Extensive knowledge (implications, ramifications) required
effort/weeks
Estimated to take multiple weeks
env:browser
epic
P1
High: Likely tackled by core team if no one steps up
specs
Problem
Currently (2023Q3):
navigator.registerProtocolHandler
.manifest.json/protocol_handlers
protocol_handlers
fieldThe downside in all the three cases above is that
foo://
registered this way can ONLY do HTTP redirect to some other HTTP URL. There is no built-in way to return bytes to the renderer process directly.Web platform has a way to return a synthetic byte response with custom headers: register a ServiceWorker to resolve requests for specific scope and create
Response
objects.Problem? Currently there is no way to leverage ServiceWorker for resolving protocols registered via
manifest.json/protocol_handlers
. Only redirect-based handlers are supported. ServiceWorker support is missing.Prototyping Solution
There is an opportunity to streamline the UX/DX around registering protocol handlers via manifest of extension (2) or PWA (3).
Both PWAs and WebExtensions (with Manifest V3) already have ServiceWorker capabilities, but we could focus on WebExtensions as it is safer environment with more clear boundary and UX around installation.
What is missing, is the ability for a protocol handler
foo://
to be a scope for a ServiceWorker that takes care of fullfiling all requests sent to thefoo://
scheme.If we had that, browser extensions or PWAs would be able to fetch content-addressed content from
ipfs://
and perform hash verification on the client, the way that benefits user the most.IPFS Use Case is for WebExtension
References
The text was updated successfully, but these errors were encountered: