如何指定使用的 Office.js 的确切版本? [英] How to specify exact version of Office.js used?

查看:22
本文介绍了如何指定使用的 Office.js 的确切版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在运行 Outlook 插件,看起来 Microsoft 已将 Office.js 的版本从 16.00 更新为 16.01:outlook:{ios:"16.00",mac:"16.00",web:"16.01",win32:"16.02"}(通过 https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js)

We're running an Outlook add-in and it looks like Microsoft have updated the version of Office.js from 16.00 to 16.01: outlook:{ios:"16.00",mac:"16.00",web:"16.01",win32:"16.02"} (via https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js)

其中一项更改看起来是对 postMessage 抽象的额外验证,以确保子/父的域(包括子域)相同.

One of the changes looks to be additional verification to the abstraction of postMessage ensuring that the domain (including subdomain) of the child / parent are the same.

因为我们在不同的子域上托管加载项和中央身份验证服务器,因此我们的所有 OAuth 流在 Outlook 网页版中都被破坏了.

Because we host our add-in and central auth server on different subdomains and as a result, all our OAuth flows are broken in Outlook for the web.

outlook-web-16.01.js:18 无法在DOMWindow"上执行postMessage":提供的目标源(https://outlook.domain.com")与收件人窗口的源不匹配('https://auth.domain.com')

桌面版 Outlook(MacOS 和 Windows)不受影响.

Outlook on Desktop (both MacOS and Windows) are unaffected.

我们已经将清单文件中的域列入白名单:

We already whitelist the domains in our manifest file:

<AppDomains>
  <AppDomain>https://outlook.domain.com</AppDomain>
  <AppDomain>https://outlook-staging.domain.com</AppDomain>
  <AppDomain>https://auth.domain.com</AppDomain>
</AppDomains>

是否可以手动指定在每个平台中加载的 Office.js 版本,以便我们可以按照自己的节奏进行升级并避免此类破坏性更改?

Is it possible to manually specify the version of Office.js that is loaded in each platform so we can upgrade at our own pace and avoid breaking changes like these?

推荐答案

对于此特定错误,您需要将子域添加到清单中的 appdomain/appdomains 部分.见:

For this specific error, you need to add your subdomains to the appdomain/appdomains section in your manifest. See:

https://dev.office.com/reference/add-ins/manifest/appdomainshttps://dev.office.com/reference/add-ins/manifest/应用域

主要版本变化,即16.00 -> 16.01,一般不能指定,不应回滚.如果主机(OWA 客户端或 Outlook)期望某个版本 (16.01) 强制其使用 16.00,则会导致意外行为(很可能 apis 只是返回错误).

Major version changes, i.e. 16.00 -> 16.01, in general cannot be specified, and should not be rolled back to. If a host (OWA client or Outlook) is expecting a certain version (16.01) forcing it to use 16.00 would result in unexpected behavior (most likely apis just returning errors).

如果您希望对我们对这些文件所做的更改(即我们对 16.01 所做的更改)更具弹性,您可以将这些文件从 appsforoffice 中提取出来并自行托管.但这不被支持/推荐.这意味着我们对这些文件所做的任何错误修复或改进都将被遗漏.

If you wanted to be more resilient to the changes we make to those files (i.e. changes we make to 16.01) you could pull the files off appsforoffice and selfhost them. But this is not supported/recommended. This means that any bug fixes or improvements we made to those files would be missed.

这篇关于如何指定使用的 Office.js 的确切版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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