简体   繁体   English

允许Google Caja HTML电子邮件中的图像和链接

[英]Allow images and links in Google Caja HTML emails

I am trying to display an html email in a webpage using caja. 我正在尝试使用caja在网页中显示html电子邮件。 I am loading it like this: 我正在像这样加载它:

caja.load(document.getElementById('messagebox'), undefined, function(frame) {
    frame.code(contentUrl, 'text/html').run();
});

When it renders, all anchor href and image src tags are stripped. 呈现时,将删除所有的anchor href和image src标签。 So you cannot see images or click links. 因此,您将看不到图像或单击链接。 I am guessing this is the default behaviour to prevent attacks. 我猜这是防止攻击的默认行为。

Is there a way to allow the html to be rendered as intended, displaying all images and having clickable links? 有没有一种方法可以允许html呈现预期的效果,显示所有图像并具有可点击的链接?

just starting using caja today and the links to api docs go to 404 so cannot find the info. 今天才开始使用caja,而指向api文档的链接将转到404,因此无法找到该信息。

Thanks 谢谢

调用load时,请使用此策略caja.policy.net.ALL而不是未定义

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM