Loading Office js addin inside Iframe gives error

◇◆丶佛笑我妖孽 提交于 2021-01-29 09:44:45

问题


I am trying to load my office addin within an Iframe. However the addin gives an error. The browser console log shows the message "Warning: Office.js is loaded outside of Office client". Is there a limitation in displaying an Office js application within an IFrame?

I am using Chrome browser

The aspx has a js file which loads the Office environment. From the console log I can see that the office environment is loaded. However at the end I get the warning message "Warning: Office.js is loaded outside of Office client"


回答1:


Yes, looks like it is a limitation, Office JS makes use of window.external to communicate with the Office client.

If you iframe it, window.external will not return parent's external, so that could be the reason for the below error.

Warning: Office.js is loaded outside of Office client

You can try updating the external, but I recommend you not to iframe.

window.external = window.parent.external;



来源:https://stackoverflow.com/questions/55744841/loading-office-js-addin-inside-iframe-gives-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!