OfficeDev / office-js-helpers

[ARCHIVED] A collection of helpers to simplify development of Office Add-ins & Microsoft Teams Tabs
MIT License
126 stars 56 forks source link

Fix for isAddin returning true while in browser #134

Closed YannickRe closed 5 years ago

YannickRe commented 5 years ago

This fixes #133 :

In a browser the Utilities.isAddin check return true, even when using it outside of Office. This results in the helpers trying to use the Dialog framework to open an authentication window instead of a normal browser popup.

Problematic code: https://github.com/OfficeDev/office-js-helpers/blob/a7b02821b9ffc9a5d89efaaa2d8f8de701524dc2/src/helpers/utilities.ts#L180

When used in the browser, the host property is undefined. This doesn't equal WEB and therefor it is considered being in an AddIn.

Not sure who owns this anymore, so I'm tagging all: @casieber, @Zlatkovsky, @sumurthy & @LouMM

YannickRe commented 5 years ago

135 is a better fix, closing this one!