0

I'm working on an add-in for Microsoft Outlook, and we've been encountering an issue with the Outlook 2016 taskpane not being able to talk to a new window. This currently only occurs on the Version 1810, Build 10927.20001.

To reproduce the issue in this particular version of outlook:

  1. Launch a new window from the taskpane (in our case it was the OAuth login window, redirecting to a successful login page)
  2. Inspect the window - it appears that the window.opener object is undefined

If we compare this behavior to an older version of outlook, we have access to the window object, the window.opener object and other properties defined in the window.opener object. This issue started occurring as of about 2 weeks ago.

Steve M
  • 147
  • 1
  • 1
  • 9
  • have you considered using Dialog API to open the new window? It includes a method for messaging the taskpane. https://learn.microsoft.com/en-us/javascript/api/office/office.ui?product=outlook&version=v1.4&view=office-js#displaydialogasync-startaddress--options--callback- – Outlook Add-ins Team - MSFT Oct 06 '18 at 05:12
  • Yes, we use the Dialog API elsewhere in our app and have used it to message the taskpane. Unfortunately, since we must redirect the user multiple times inside this particular window to OAuth the user with our application, we’d built this authentication flow without using the Dialog API. In this new Outlook build, was a change made to forbid the use of the window.opener object for security reasons? We thought this might have been the case since it works in the previous build. If not, should we expect our existing authentication flow using window.opener to work when this build released? – Steve M Oct 09 '18 at 21:09
  • Since 16.0.8110.1000 and later, windows opened in window.open will open in the DEFAULT browser. (Chrome, Edge, etc). If you need access to that window then the call to window.open must be in the AppDomains list and the URL must be https. – Outlook Add-ins Team - MSFT Oct 10 '18 at 18:13
  • Our domain is in the AppDomains list, and we are using https. We've checked and confirmed that the window is opening in IE. However, we still can't access window.opener. Is there anything else that could be preventing us from accessing window.opener? – Steve M Oct 29 '18 at 19:24
  • You should be able to use the Dialog API even if your page does multiple redirects as long as it redirects back to a page in the end which has office.js loaded to be able to message the addin back. – Outlook Add-ins Team - MSFT Nov 21 '18 at 22:46

1 Answers1

1
mywindow = window.open("https://contoso/test/blah.html");

mywindow.document.write("foo");

mywindow.opener.document.write("bar");

This code will only work if https://contoso/ is in the AppDomains List. Otherwise mywindow will be null.