We started seeing an issue recently in our add-in where in Exchange 2016 OWA, when an opened dialog (not in iFrame) uses messageParent to send a message back to its parent, the parent window was not executing its DialogMessageReceivedHandler. This started happening around 10 days ago (automated tests began to fail).
Parent window should receive the message event from child window and execute its event handler function.
Parent window does not execute the event handler function.
This only seems to occur in Exchange 2016 OWA. Office 365 OWA is not affected.
We use the dialog to perform SAML authentication, redirecting the child page to the SAML site which then returns back to an add-in page where the child dialog passes the SAML authentication details back to the parent window as a message. Without the messaging functionality our authentication capability is broken.
Our add-in automated tests were passing until 8th of July. We load the office-js script from the CDN i.e. https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
I can see that the office-js repo for those CDN files was updated with a new release on the 8th of July here.
If I download the office-js scripts from the prior dist release here and use them in the add-in the problem does not occur. My assumption is something in that latest distribution has broken this but I have not narrowed down the cause yet.
Windows 10 1909.
Seen on Chrome Version 83 and 84.
Exchange 2016 backend.
We have the same issue as well. As a workaround just replace:
dialog.addEventHandler(Office.EventType.DialogMessageReceived, function(data){ / code to execute when child sends message });
with:
window.addEventListener("message", function(data){ / code to execute when child sends message }, false);
But I think, it needs to be fixed from OfficeJS side, because it has been worked previously.
@max-yushchuk yeah adding the message event listener works for us too but I was hesitant to switch away from the framework recommended approach so currently just using a local copy of the February office-js dist. Long term we don't want to do this though as we'll fall behind on getting other fixes in the latest dist.
I notice there was a release updated 14 hours ago but that seems to be exhibiting the same behaviour for us.
Hi, sorry for the delayed response! We're a bit short on resources this week due to vacations. I assigned this to the Outlook eng team to investigate. Thanks, linda
We are able to reproduce this from our side. Thanks for reporting this issue regarding DisplayDialog. It has been put on our backlog. We unfortunately have no timelines to share at this point
Internal tracking id: OutlookWeb:91074
@exextoc any update on this issue? We've been forced to use a copy of the office JS scripts from April otherwise the add-in won't work due to this issue. Which means we're unable to take security related fixes like in https://github.com/OfficeDev/office-js/issues/1441.
Unfortunately it is still part of our backlog with Internal tracking id: OutlookWeb:91074. We have no timelines to share at this point
Hello, we've got the same problem. While investigating the cause I've found that message handler compares message origin with OSF._OfficeAppFactory.getInitializationHelper()._appContext._addInSourceUrl, which is empty for OWA in Exchange. If I add this property manually, then messageParent starts working. Probably it would be better to compare message origin with _appDomains, which seems to be populated correctly.
I tried the workaround of @onestep and fixed the problem too!