-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new API for extesnions to register rendering content types #200
Comments
A few thoughts (before I forget!) : one thing is to decide if that should be a web-ext API, or to hook something to The second thing is to figure out the API itself. Gecko has an internal API to convert data from a content type to another (https://searchfox.org/mozilla-central/source/netwerk/streamconv/nsIStreamConverter.idl) which basically boils down to "here are some bytes, and a listener you can send your new bytes to". There is also https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/filterResponseData that could be a good model to be inspired by. |
I didn't know there were plugins! Just extensions aka addons. In #197 we're talking about navigator.registerprotocolhandler which seems like a good way to have a webapp located at an http host take control of protocol links while we are on that domain. But with p2p cypherlinks we aren't really at a location (host server on a domain)... ideally our webapps can be hosted on ssb, hyper, ipfs etc, but that doesn't give us a place quite like the oldweb does:
ssb for instance has urls like I feel like #197, #198, and #200 are all talking essentially about the same problem. What happens when you go from a web address pointing to a dns name and hence to a server, to pointing to content-addressed cypherlinks? I think Paul did some work on this problem in beaker? Names pointing to cypherlinks?
This is intriguing @fabricedesre, so if I'm understanding correctly, instead of an extension highjacking the rendering of a whole page we could provide an api to say, convert from markdown to html, that any extension/link could make use of? Instead of having to develop or bundle it themselves? |
Yes, I would rather implement something similar to a fetch event handler that just deals with data, and let it flow through the regular rendering pipeline. Of course there are edge cases to deal with, eg. what happens if several web-ext register for the same content-type, etc. |
It'd be useful to enable extensions to register themselves as handlers for certain mime types. e.g. for a JSON viewer or a GLTF file renderer.
This could use some Chrome internals that used to be used for plugins or we could hack this in the web request layer.
Might be useful to define it on the
navigator
object for pages in general. 🤔Not sure how hard it would be for mobile.
The text was updated successfully, but these errors were encountered: