Outlook客户端加载项:链接和JS重定向到其他域,打开一个新的浏览器选项卡

问题描述 投票:1回答:1

我的网站是domaina.com。当我在Microsoft Edge DevTools Preview上执行此代码时:

location.href = domainb.com/xxx/xxx

它无法重定向到右侧站点附加面板上的domainb.com,它将打开我的默认浏览器以加载我的链接。

我已经将domainb.com这样添加到清单中:

<AppDomain>https://domainb.com</AppDomain>

当我执行如下代码时:

var displayUrl = "https://domainb.com";
Office.context.ui.displayDialogAsync(displayUrl, { height: 75, width: 40 }, function(result) {
    console.log('displayDialogAsync: ');
    console.log(result);
});

Edge DevTools将控制台记录错误结果,如下所示:

[object Object]: {error: Object, status: "failed", value: undefined}

error: Object
code: 12004
message: "The domain of the URL is not included in the AppDomains element in the manifest, and is not subdomain of source location."
name: "Display Dialog Error"

__proto__: Object
status: "failed"
value: undefined

__proto__: Object

但实际上,我将domainb.com添加到清单中:

<AppDomains>
<AppDomain>https://domainb.com</AppDomain>
<AppDomains>

但是对]没有用>

Window 10 1903 Verison OS build: 18362.535
Outlook client: Verison 1911 (Build 12228.20364 Click-to-Run) MSO (16.0.12228.20322) 64Bit.

我认为这是Edge引擎引起的。 https://docs.microsoft.com/en-us/office/dev/add-ins/concepts/browsers-used-by-office-web-add-ins

更多详细信息:https://github.com/OfficeDev/office-js/issues/917

我的网站是domaina.com。当我在Microsoft Edge DevTools Preview上执行以下代码时:location.href = domainb.com/xxx/xxx,它无法重定向到右侧站点附加面板上的domainb.com,它会打开...

office-js appdomain outlook-web-addins
1个回答
1
投票

[IIRC,当您用displayDialogAsync打开对话框时,您传递的网址必须在本地主机上(例如https://localhost:3000/dialog.html),从那里您可以重定向到您添加到<AppDomains>的任何站点

© www.soinside.com 2019 - 2024. All rights reserved.