Communicate from the popup back to the parent window. Click on the button to open the popup window, then in the popup submit the form. This should trigger a postMessage back to this (parent) window to close the popup window. If there is a breakage in connection between the parent and child the parent will still show a message to manually close the popup window.