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

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

问题描述

我们正在运行一个Outlook加载项,并且看起来Microsoft已将Office.js的版本从16.00更新为16.01:outlook:{ios:"16.00",mac:"16.00",web:"16.01",win32:"16.02"}(通过

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流在Web的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 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://outlook.domain.com') does not match the recipient window's origin ('https://auth.domain.com')

台式机(MacOS和Windows)上的Outlook不受影响.

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/addins /manifest/appdomains https://dev.office.com/reference/add-ins/manifest/应用程序域

主要版本更改,即16.00-> 16.01,通常无法指定,也不应该回滚到该版本.如果主机(OWA客户端或Outlook)期望某个版本(16.01)强制其使用16.00,则将导致意外行为(最有可能的API仅返回错误).

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天全站免登陆