window.opener lost after split screen in iOS safari

87 views Asked by At

I have a website where a popup window is opened by:

// main window
const url = ...
const popup = window.open(url, "popup_workflow", "popup=yes")

And I rely on popup_workflow window's opener to communicate workflow result.

// popup_workflow window
const result = ...
window.opener.postMessage(result , "*")

This workflow works in most browser, only breaks on an iPad when:

  1. Open the popup_workflow window in safari.
  2. Drag the tab of popup_workflow window to edge of iPad screen, open it in split view.
  3. Now in the new popup_workflow window, window.opener is gone.
// in main window, this does not work
popup.postMessage("something", "*")

// in popup_workflow window, this does not work
window.opener.postMessage("something", "*")

While I test in other OS or browser, window.opener will not lost even after refresh.

How could I get my opener back in iOS safari's split screen view?

0

There are 0 answers