Chromium: prompt user to approve protocol handler registration #1128
Labels
area/chromium
Issues related to Chromium-based browsers
effort/days
Estimated to take multiple days, but less than a week
kind/enhancement
A net-new feature or improvement to an existing feature
P2
Medium: Good to have, but can wait until someone steps up
Firefox supports preregistration of handlers via
protocol_handlers
in webextension Manifest, but Chromium does not:Talked with Igalia today, and we will ask Google to reconsider
protocol_handlers
support in Chromium: landscape is bit different, Microsoft Edge's improves the way PWA and we may find alignment / deduplication of efforts around this.That being said, these things take way more time that we initially anticipated, so it may be useful to implement a stop-gap solution, as
protocol_handlers
ETA in Chromium is unknown.First, understand what is possible
https://bugs.chromium.org/p/chromium/issues/detail?id=64100 is unclear if
3) Allowing extensions to redirect to a third-party domain (instead of chrome-extension://<id>/...)
was implemented.My suggestion is to make a PoC first that tries to register handler via
registerProtocolHandler
from browser extension's background page:https://dweb.link/ipfs/?uri=%s
chrome-extension://<id>/dist/router.html#uri=%s
This will inform our next step.
Ideally, we would point at (1), if we can't then we would create a router page (2) which has JS that reads URI from
window.location.hash
and performswindow.location.replace
to the correct destination.Proposed implementation
Create utility function that checks if
ipfs://
andipns://
handlers are registered viaregisterProtocolHandler
, and if not, attempt to register a handler.https://dweb.link/ipfs/?uri=%s
).This way it works when local node is off or redirect is disabled, IPFS URIs still resolve, but we need to work with whatever is actually possible in Chromium.
When user installs IPFS Companion OR toggles global redirect, we run the check again.
cc @autonome @whizzzkid ipfs/in-web-browsers#168 #164
The text was updated successfully, but these errors were encountered: