I have an Office Add-In written in the new JavaScript API, inside of it, I have a JS function which after some logic opens a web app in a new window using window.open(url, '_blank')
It works when called from the add-in pane in Outlook Web in both, localhost
hosted add-in, as well as after deployment on heroku.
However when called from a command (add-in button on ribbon) it works only when the add-in is hosted on localhost, after I deploy it on heroku, the add-in works, shows commands in the ribbon, performs the JS logic, but window.open
does nothing.
Looks like the only way to open a new window is by using Office.context.ui.displayDialogAsync
but even then it works only if the page is on the same origin as the add-in code.
I would think that there are some security restrictions, but why then it worked when hosted on localhost? Is there any way, to open a browser window from a command in Outlook using the new Javascript API?