Summary: I am working on an electron app where we load a clients web app into an iframe and at one point the code in this iframe calls window.top.close() which causes the ui to become unresponsive. The client is not able to fix this functionality at this point so we need to handle it ourselves. What are some options, if there are any, for resolving this issue?
I am thinking I should be able to loosen some security on the iframe. Maybe with some CSP on the parent? I see some frameworks like NodeWebkit have custom v8 handled html attributes to force iframes to return its own window when trying to access window.top or window.parent, but i feel like there has to be away to just replace wondow.top.close
- iframe is already in a webview and cannot use nested webviews
- iframe content is a different domain
- iframe cannot be sandboxed because client code runs flash plugins
- App in question is Electron 1.3.0
What I have tried: Replacing window.top.close: replacing iframe.contentwindow.top.close from the parent window context works if i load content from the same domain but does not for the client cross domain code. I do not get any errors, the ui just locks up