Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Chrome to open certain URLs based on Content-Type header

I tried looking for a Chrome extension that does this, but was unsuccessful in finding one. Basically, I want to hit a web service that returns a content type header of application/rdf+xml or application/xml and have Chrome automatically display the content inline. I have the XML Tree extension which displays the XML just fine, but Chrome by default will download files unless they have a certain extension.

My question is: Is there a way to force Chrome to open certain things inline based on Content-Type returned from the server? Extension or direct support in Chrome is fine with me. If one doesn't exist, I'll investigate developing one.

like image 819
Marc Baumbach Avatar asked Feb 15 '12 16:02

Marc Baumbach


People also ask

What is a mod header?

ModHeader is a devtool used to quickly change request and response headers. It is available on Chrome, Firefox, Edge, and Opera on Windows, MacOS, and Linux. ModHeader is consistently ated 4+ stars on Chrome web store and used by 550,000+ users.

How do I change content type?

On the Ribbon, click the Library tab, and then click Library Settings. Under Content Types, click the name of the content type that you want to change. Note: If the document library has not been set up to allow multiple content types, the Content Types section does not appear on the Customize page for the library.


1 Answers

Great question, one I've been trying to answer for ages. Unlike firefox, chrome, and chromium, use an external xdg mime-type query to decide what helper applications to use, but one generally doesn't want to set chrome as a generic handler for application/rdf+xml. So I was very pleased to discover the chrome extension "application/...+json|+xml as inline." Available from the web store, or at

https://github.com/andreineculau/chrome-inline-media-type

Thanks andreineculau!

like image 105
Cam Avatar answered Nov 11 '22 15:11

Cam