首页 > 解决方案 > Outlook 插件:对话框:Office.js 已在 Office 客户端之外加载”在对话框弹出窗口 - IE 和 Edge

问题描述

背景

目前,我有一个 Outlook 插件,在 Outlook 厚客户端、Chrome 和 Firefox 上的 OWA 中完全可以使用。

问题)

在 IE Edge 和 IE 11(仅限 Owa)上我有以下问题:

除了 Edge 和 IE,其他所有浏览器都按预期工作。

给我看代码(片段)

        // height and width are percentages of the size of the screen.
        Office.context.ui.displayDialogAsync(fullUrl, {height: 45, width: 55, displayInIframe: false},
            function (asyncResult) {
            console.log(asyncResult);
            if (asyncResult.status === "failed") {

                LogMessage(LOG_MESSAGES.DISPLAY_DIALOG_ASYNC_FAILED + " Error: " + asyncResult.error.code + " " + asyncResult.error.message);

                //Error code 12009 means "user chose to ignore the dialog box"
                if (asyncResult.error.code === 12009) {
                    authenticationFailure();
                } else {
                    myLogin();
                }
            } else {
                dialog = asyncResult.value;
                dialog.addEventHandler(Office.EventType.DialogMessageReceived, handleToken);
                dialog.addEventHandler(Office.EventType.DialogEventReceived, dialogClosing);

                LogMessage(LOG_MESSAGES.DISPLAY_DIALOG_ASYNC_SUCCEED);
            }
        });

保护模式:

默认开启。在查看其他答案时,这似乎与保护模式有关。我关闭并在 Edge 中重新测试,但问题仍然存在。然而,在 IE11 中,问题得到了解决。

还有其他信息吗?

是的,在 IE 和 Edge 中,由于某种原因,弹出窗口打开并立即失去焦点。

标签: office-jsoutlook-web-addins

解决方案


推荐阅读