我正在努力检查我的托管网络应用程序是由浏览器还是在Outlook 2013/2016客户端中打开。
我有一个Web应用程序,它必须在浏览器和Outlook 2013/2016沙盒iframe中为用户提供不同的功能。
我的方法
在mainController中使用AngularJS:
$rootScope.isIFrame = false;
if (window.location !== window.parent.location) {
// The page is in an iframe
$rootScope.isIFrame = true;
};
$log.debug('isIFrame: ' + $rootScope.isIFrame);
答案 0 :(得分:1)
查看Office.context.mailbox.diagnostics.hostName:
获取一个表示主机应用程序名称的字符串。 一个字符串,可以是以下值之一:
Outlook
,Mac Outlook
或OutlookWebApp
。