什么是加载外部资源的 HTML 元素列表?(HTML 电子邮件) [英] What is a list of HTML elements that load external resources? (HTML Email)
问题描述
如果不允许通过 JavaScript 进行额外的 DOM 操作,我正在寻找可以加载外部资源的元素列表.我正在尝试使用 HTML 查看器托管来自第三方的电子邮件,当发生这种情况时,我需要删除任何自动加载的资源,以便仅显示基本 HTML,即使这会导致内容显示不正确.
I'm looking for a list of elements that can load external resources given no additional DOM manipulation via JavaScript is allowed. I am trying to host e-mails from third parties with an HTML viewer and when that happens, I need to remove any resources that load automatically so that only the base HTML is displayed even if that makes the content show up incorrectly.
目前的名单是:
<img />
<embed />
<object />
<link />
<script />
<audio />
<video />
<style type="text/css">selector { property: uri('') }</style>
我是否需要考虑其他任何元素或模式以防止加载第三方资源.而且,是的,我熟悉沙箱属性,但我们也需要对旧浏览器的支持.
Are there any other elements or patterns I need to take into account to prevent third-party resources from being loaded. And, yes, I am familiar with the sandbox attribute, but we require support for older browsers as well.
推荐答案
具有普遍支持,并且是在电子邮件中引用外部图像的标准.也可以使用
url:www.website.com/image.jpg
以 显示图像.
<img>
has universal support and is the standard for referencing external images in email. Images can also be displayed in <style>
using url:www.website.com/image.jpg
.
有不错的支持用于引用诸如 webfonts 和外部样式表之类的东西.
<link>
has decent support for referencing things like webfonts and external stylesheets.
、
和
,但不是很多.
<object>
, <video>
, and <audio>
are supported by a few clients, but not many.
是另一个具有一些支持的值得关注的.
<svg>
is another that has some support that's worth watching out for.
我认为电子邮件客户端不支持 或
.它们通常没有任何标记.
I don't believe <embed>
or <script>
are supported in email clients. they're generally stripped from any markup.
这篇关于什么是加载外部资源的 HTML 元素列表?(HTML 电子邮件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!