强制 Outlook 加载项弹出窗口使用嵌入式浏览器打开 [英] Force Outlook Add-in popup to open with embedded browser

查看:94
本文介绍了强制 Outlook 加载项弹出窗口使用嵌入式浏览器打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现 Outlook 加载项(在 Outlook 2016 中运行)存在问题,当我使用 window.open 打开弹出窗口时,它有时会在用户的默认浏览器中打开(例如Chrome)而不是运行加载项的浏览器(例如嵌入在 Outlook 2016 中的 IE11 Web 视图).这是一个问题,因为它会阻止弹出窗口与加载项进行通信,而这是防止点击劫持所必需的.

I'm seeing an issue with my Outlook Add-in (running in Outlook 2016) where when I open a popup window using window.open, it sometimes opens in the user's default browser (e.g. Chrome) instead of the browser running the add-in (e.g. the IE11 web view embedded in Outlook 2016). This is a problem because it prevents the popup window from communicating with the add-in, which is necessary for clickjacking protection.

有没有办法在不使用 Dialog API 的情况下强制在运行加载项的同一浏览器中打开弹出窗口?我想支持需求集 1.3.

Is there a way to force the popup window to be opened in the same browser that is running the add-in, without using the Dialog API? I would like to support requirement set 1.3.

推荐答案

您应该检查 displayDialogAsync API 存在.它是在需求集 1.4 中添加的.

You should check to see if the displayDialogAsync API exists. It was added in requirement set 1.4.

如果存在,我们建议使用它.请注意,该对话框只能调用 Office.context.ui.messageParent API.此 API 允许对话框与加载项进行单向通信.加载项可以使用这些消息来利用 Office.js API.

If it exists, we recommend using it. Please note that the dialog can only call the Office.context.ui.messageParent API. This API allows the dialog to communicate one-way with the add-in. The add-in can use those messages to leverage the Office.js APIs.

如果 displayDialogAsyncAPI 不存在,您可以利用 window.open.但是,在这种情况下,不会启动默认浏览器.

If the displayDialogAsync API doesn’t exist you can leverage window.open. However, in this case the default browser will not be launched.

这篇关于强制 Outlook 加载项弹出窗口使用嵌入式浏览器打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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