强制 Chrome 根据 Content-Type 标头打开某些 URL

发布于 2025-01-06 01:57:56 字数 392 浏览 2 评论 0原文

我尝试寻找一个可以执行此操作的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故事未完 2025-01-13 01:57:56

很好的问题,多年来我一直试图回答这个问题。与 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文