Thanks to webRequest.onBeforeRequest API WebExtensions are able to inspect HTTP request before it is sent and redirect it to a different URL.
It would be neat if we could use this WebExtension API for uplifting protocol-specific HTTP requests by cancelling and redirecting them to native protocol handler.
Example: IPFS Gateway on HTTP
In context of IPFS we want to redirect requests made to HTTP gateways:
detect HTTP gateways: https://ipfs.io/ipfs/<cid> and https://<cid>.ipfs.foo.tld
redirect to ipfs://<cid>
Problem
Right now cross-protocol redirect via webRequest.onBeforeRequest is not possible.
PoC redirect from https:// to ipfs:// gets blocked:
It feels related to discussion in https://github.com/mozilla/libdweb/issues/52, but here we talk about redirecting from http:// to foo:// via webextension API, not loading content embedded in HTML page.
Summary
Thanks to
webRequest.onBeforeRequest
API WebExtensions are able to inspect HTTP request before it is sent and redirect it to a different URL.It would be neat if we could use this WebExtension API for uplifting protocol-specific HTTP requests by cancelling and redirecting them to native protocol handler.
Example: IPFS Gateway on HTTP
In context of IPFS we want to redirect requests made to HTTP gateways:
https://ipfs.io/ipfs/<cid>
andhttps://<cid>.ipfs.foo.tld
ipfs://<cid>
Problem
Right now cross-protocol redirect via
webRequest.onBeforeRequest
is not possible. PoC redirect fromhttps://
toipfs://
gets blocked:It feels related to discussion in https://github.com/mozilla/libdweb/issues/52, but here we talk about redirecting from
http://
tofoo://
via webextension API, not loading content embedded in HTML page.Let me know if more data or MVP demo is needed.