For a web application which allows in-browser preview of documents, I'd like to check whether the user's browser supports preview of the current document's mime type.
Is there a Javascript-based way to match the current mime type against the types supported by the browser?
Thanks!
accept
request header). So you can actually know before you even show them the page (and you can make that information available to JavaScript by embedding it in the response). Of course, that requires you to dynamically respond to the initial request, and may not be what you're looking for. – Ossifragenavigator.mimeTypes
which probably won't work in all browsers... – Valentinavalentine