【问题标题】:firefox do not set iframe designMode to on with Angular Directivefirefox 不使用 Angular Directive 将 iframe designMode 设置为 on
【发布时间】:2016-11-02 07:26:11
【问题描述】:

我想创建一个带有角度指令的富文本编辑器。 designMode Attr 在 Chrome、Opera 和其他 chrome 基础浏览器中运行良好,但在 FireFox 中无法运行,这里有一个plunker 来看看:

https://plnkr.co/edit/Ow6BxOAneLsNjkyZmGiy

但是当浏览器加载时,我们可以在 firefox 控制台中将 designMode 设置为 on:

document.getElementById('richtextfield').contentDocument.designMode = 'on';

我们可以轻松地将 iframe 上的 angular 指令记录到 firefox 控制台:

console.log( element.find( 'iframe' )[0] );

为什么会这样??

【问题讨论】:

    标签: angularjs firefox iframe angularjs-directive rich-text-editor


    【解决方案1】:

    如果您尝试在 SSL 加密网站 (https://) 上添加此 iframe,自 Firefox 23 起它将不再起作用,因为 Mozilla 已决定阻止加密网站上的所有未加密内容(例如 https 网站上的 http-iframes)。您可以在自己的 Firefox 安装中更改此行为,方法是在地址栏中键入 about:config 并将 security.mixed_content.block_active_content 设置为 false。但这对您网站上的所有其他 FF23 访问者没有帮助。

    【讨论】:

    • 我设置了security.mixed_content.block_active_content to false,但没有解决问题。虽然我在没有任何 SSL 加密的情况下在 localhost 中运行项目
    • 你可以查看ff论坛support.mozilla.org/en-US/questions/737230,我的建议是避免使用iframe并使用角度模板..
    • 请尝试在您的Firefox中打开plunker,看看您是否也遇到了这个问题?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-27
    相关资源
    最近更新 更多