hastur
hastur copied to clipboard
Support dispatching on content-type when parsing/rendering
The IANA gives these as the acceptable types, https://www.iana.org/assignments/media-types/media-types.xhtml
I'm assuming we probably want to use a subset of them?
For browser parsing and rendering purposes, obviously a lot of these look irrelevant or out-of-date, but I think we should at least handle the stuff that Firefox and Chromium handle. For example, we open application/pdf
content in a new tab with pdf.js, we open the JSON viewer for application/json
, open the file dialog for application/octet-stream
, open the image viewer for image/png
, etc etc
In Firefox, some amount of this is user-configurable: https://support.mozilla.org/en-US/kb/change-firefox-behavior-when-open-file .
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types