"View As MIME Type" in Chrome or Firefox

Is there any way to force either Firefox or Chrome to interpret a loaded resource as a particular MIME type?

For example, the raw code views provided by online SCC interfaces such as Google Code send content as text/plain by default. If I'm looking at an HTML file, I'd like to be able to override this in the browser and view it as text/html .

Are there any extensions or hidden commands for Firefox or Chrome that provide "View as MIME type" functionality?


For Firefox, there is an add-on provides almost the function you wanted: https://addons.mozilla.org/en-US/firefox/addon/force-content-type/ . No idea if there is a Chrome extension or not.

Even if the functionality exists, I wouldn't recommend you to use it in your example: Arbitrary HTML would have access to google.com domain for cookie and script, which is really really bad in terms of security.


Shameless plug: I just published a (free) Chrome extension to do just what you ask. It's available on the Chrome web store. It works by listening to the chrome.webRequest.onHeadersReceived event and patching in a custom content-type HTTP header. If you'd like the build it yourself or see how it's implemented, the source is available on GitHub.


Ubuntu 12.04 has an extension to the System Settings called Tweak. This has a FileType Manager.

链接地址: http://www.djcxy.com/p/61330.html

上一篇: Chrome扩展程序:自定义协议?

下一篇: Chrome或Firefox中的“以MIME类型查看”