I'm having trouble determining whether my hosted web application is being accessed through a browser or from within the Outlook 2013/2016 client.
I have developed a web application that offers different functionalities depending on whether it is accessed through a browser or within the sandboxed iframe of Outlook 2013/2016.
My Solution
I am using AngularJS in the mainController to achieve this:
$rootScope.isIFrame = false;
if (window.location !== window.parent.location) {
// The page is loaded inside an iframe
$rootScope.isIFrame = true;
};
$log.debug('isIFrame: ' + $rootScope.isIFrame);