Daniel Phan
Daniel Phan

Reputation: 227

Force Outlook Add-in popup to open with embedded browser

I'm seeing an issue with my Outlook Add-in (running in Outlook 2016) where when I open a popup window using window.open, it sometimes opens in the user's default browser (e.g. Chrome) instead of the browser running the add-in (e.g. the IE11 web view embedded in Outlook 2016). This is a problem because it prevents the popup window from communicating with the add-in, which is necessary for clickjacking protection.

Is there a way to force the popup window to be opened in the same browser that is running the add-in, without using the Dialog API? I would like to support requirement set 1.3.

Upvotes: 17

Views: 3996

Answers (2)

abestrad
abestrad

Reputation: 906

As 2022 docs were updated.

The API documentation was moved from dev.office.com (these links don't work anymore) to learn.microsoft.com. And here you will find an example on how to use this api.

Upvotes: 0

user7823505
user7823505

Reputation:

You should check to see if the displayDialogAsync API exists. It was added in requirement set 1.4.

If it exists, we recommend using it. Please note that the dialog can only call the Office.context.ui.messageParent API. This API allows the dialog to communicate one-way with the add-in. The add-in can use those messages to leverage the Office.js APIs.

If the displayDialogAsync API doesn’t exist you can leverage window.open. However, in this case the default browser will not be launched.

Upvotes: 2

Related Questions