robinlinden / hastur

A web browser.
BSD 2-Clause "Simplified" License
31 stars 10 forks source link

Support dispatching on content-type when parsing/rendering #480

Open GrayHatter opened 1 year ago

GrayHatter commented 1 year ago

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?

Zer0-One commented 1 year ago

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 .

Zer0-One commented 1 year ago

https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types