强制 Chrome 根据 Content-Type 标头打开某些 URL
我尝试寻找一个可以执行此操作的 Chrome 扩展程序,但没有成功找到。基本上,我想访问一个返回 application/rdf+xml 或 application/xml 内容类型标头的 Web 服务,并让 Chrome 自动显示内联内容。我有 XML 树扩展,它可以很好地显示 XML,但 Chrome 默认情况下会下载文件,除非它们具有特定的扩展名。
我的问题是:有没有办法强制 Chrome 根据服务器返回的 Content-Type 内联打开某些内容? Chrome 中的扩展或直接支持对我来说没问题。如果不存在,我将研究开发一个。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很好的问题,多年来我一直试图回答这个问题。与 firefox、chrome 和 chromium 不同,使用外部 xdg mime 类型查询来决定使用哪些帮助应用程序,但通常不希望将 chrome 设置为 application/rdf+xml 的通用处理程序。所以我很高兴发现 chrome 扩展“application/...+json|+xml as inline”。可从网上商店购买,或访问
https://github.com/andreineculau/chrome-inline -媒体类型
谢谢andreineculau!
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!