带有TinyMCE的对话框导致错误12003 [英] Dialog with TinyMCE causes error 12003

查看:143
本文介绍了带有TinyMCE的对话框导致错误12003的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用TinyMCE对Word(1611)对话框进行最新更新会导致错误12003:无效的URL语法.

With the newest update to Word (1611) dialogs with TinyMCE causes error 12003: Invalid URL Syntax.

根据

对话框定向到具有HTTP协议的URL.需要HTTPS.

The dialog box was directed to a URL with the HTTP protocol. HTTPS is required.

一个简单的示例是将下面的代码放在对话框中(奇怪的是它可以在面板中工作).

Simple example is to put below code in a dialog (oddly enough it works in a panel).

更新代码

<!DOCTYPE html>
<html>
<head>
    <title>Office.js with TinyMCE</title>
    <meta charset="utf-8" />
    <script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript"></script>
    <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
    <script src="https://cdn.tinymce.com/4/tinymce.min.js"></script>
    <script type="text/javascript">
        (function () {
            "use strict";

            // The initialize function must be run each time a new page is loaded.
            Office.initialize = function (reason) {
                $(document).ready(function () {
                    tinymce.init({ selector: 'textarea' });
                });
            };
        })();
    </script>
</head>
<body>
    <textarea></textarea>
</body>
</html>

Edit1 :这仅在Windows上是一个问题.在Mac上运行正常.

This is only a problem on Windows. On Mac it works fine.

Edit2 :用于打开对话框的代码

The code for opening the dialog

var url = 'https://' + location.host + '/dialog.html';
console.log('url: ' + url); // url: https://localhost:44341/dialog.html
Office.context.ui.displayDialogAsync(url, { height: 30, width: 20 });

推荐答案

我们已经确定了问题.事实证明,我们阻止了 javascript: URL协议,该协议似乎在使用TinyMCE时被调用.我们正在努力解决.

We've identified the issue. Turns out we are blocking the javascript: URL protocol which seems to be invoked when using TinyMCE. We are working on a fix.

这篇关于带有TinyMCE的对话框导致错误12003的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆