I would like support for safely using `window.open()` and `postMessage()` within Office add-ins.

I would like support for safely using `window.open()` and `postMessage()` within Office add-ins.
0

Upvotes

Upvote

 Dec 24 2023
2 Comments (2 New)
New

I reported the issues to the Office Add-ins team on GitHub, and they instructed me to submit a feature request on this forum. Therefore, I am posting the request here.

https://github.com/OfficeDev/office-js/issues/3906 

 

 

Currently, our company provides an add-in for preventing misdelivery using the "ItemSend" event and the "displayDialogAsync" method in Office add-ins. This add-in utilizes the Office Add-ins API to retrieve and display data for "To," "Subject," "Attachments," and "Body" in a dialog. Users can perform self-checks using checkboxes. However, since its launch two years ago, we have been experiencing recurring issues, affecting approximately 10,000 users each time. The problems are as follows:

Case 1: The dialog does not launch and remains in a waiting state (occurred twice in the past).
Case 2: The dialog is displayed in an empty state (occurred twice in the past).

To prevent similar issues in the future, we are considering replacing the use of displayDialogAsync with commonly used programming methods. According to my research, using JavaScript's `window.open()` and `postMessage()` is believed to function as an alternative. However, currently, a window opened with `window.open()` is not considered part of the add-in, as mentioned by the Office Add-ins team, citing security concerns associated with these methods.

Please note that the use of `window.open()` and `postMessage()` is just an example of program modification. It is acceptable to achieve tasks such as "ensuring the correct opening of dialogs," "displaying email information for self-checking," or "allowing users to send emails upon their instruction (being able to send by clicking the send button on the dialog)" through alternative approaches. Your consideration is appreciated.

Comments
Copper Contributor
0x253E619E7c2BB336c51bC37242e2486D3D28710A
Bronze Contributor
  • Please note that the use of `window.open()` and `postMessage()` is just an example of program modification. It is acceptable to achieve tasks such as "ensuring the correct opening of dialogs,"

 

Sorry,I can not get what you mean.

 

If window.open not be supported,how about dialog element?

 

 

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog