我正在努力检查我的托管 Web 应用程序是否由浏览器或 Outlook 2013/2016 客户端打开。
我有一个 Web 应用程序,它必须在浏览器和 Outlook 2013/2016 沙盒 iframe 中为用户提供不同的功能。
我的方法
在主 Controller 中使用 AngularJS:
$rootScope.isIFrame = false;
if (window.location !== window.parent.location) {
// The page is in an iframe
$rootScope.isIFrame = true;
};
$log.debug('isIFrame: ' + $rootScope.isIFrame);
最佳答案
查看 Office.context.mailbox.diagnostics.hostName:
Gets a string that represents the name of the host application. A string that can be one of the following values:
Outlook
,Mac Outlook
orOutlookWebApp
.
关于javascript - 检测是否在 outlook-add-in 中打开了 Web 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34935571/