Repository navigation
Description
- Electron version: 1.6.8
- Operating system: MacOS
Apologies if this is a duplicate, I found issues related to window.open, however I believe none covered my use case
Expected behavior
Communication between an iframe and windows it opens should be possible (via postMessage API). Therefore, window.open should behave correctly when used within an iframe.
Opener to opened
Calling window.open from within an iframe should return the created BrowserProxyWindow, allowing the opener to post messages to the opened
Opened to opener
The opened windows window.opener should point back to the iframes window (the window that opened it), allowing the opened to post messages to the opener
Actual behavior
Communication between the opener and the opened window is broken in both directions when the
opener is an iframe.
Opener to opened
window.open returns null when called within an iframe. Therefore, it is impossible for the opener to communicate to the opened window.
window.open uses Chromiums implementation instead of Electron's proxy from within an iframe.
Opened to opener
window.opener points to top instead of the iframe which opened the window. Therefore, it is impossible to communicate from the opened window to the opener window (the iframe).
How to reproduce
The easiest way to reproduce is to:
- open up the example electron app
- open dev tools and insert an iframe
- from dev tools console set the context to the iframe, and execute
window.open(it will returnnull) - open the dev tools in the opened window and inspect
window.opener... it will NOT point to the opener (the iframe) instead it will be pointing attop
Activity
ddxdental commentedon Jul 18, 2017
Are there any notable work arounds for this issue currently?
groundwater commentedon Aug 7, 2017
Gonna re-open because we have to revert this fix #10204
alexstrat commentedon Jan 17, 2018
@MarshallOfSound so that the investigation you made to get to #9961 are not lost, would you mind writing them down in this issue please? Others could continue from there.
(I could not find a summary of your investigations, but I may have missed it 😉)
codebytere commentedon Sep 24, 2018
We are no longer implementing bugfixes for versions of Electron <=
1.7.x, so i'm going to close this issue but if it is still persisting in more recent versions of Electron we can certainly reopen it!Anrock commentedon Sep 24, 2018
@codebytere just reproduced on 1.8.8, 2.0.10, 3.0.0. Please reopen and add corresponding version tags.
Anrock commentedon Oct 4, 2018
Seems the same happens if using BrowserView instead of iframe.
Gozala commentedon Oct 17, 2018
I have identified source of the issues and proposed solution based on the exploration described in the the corresponding comment. Posting this here given that that issue is closed & I don't seem to get any response.
sofianguy commentedon Aug 9, 2019
Thank you for taking the time to report this issue and helping to make Electron better.
The version of Electron you reported this on has been superseded by newer releases.
If you're still experiencing this issue in Electron v4.2.x or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know.
I'm setting the
blocked/need-infolabel for the above reasons. This issue will be closed 7 days from now if there is no response.Thanks in advance! Your help is appreciated.
sofianguy commentedon Aug 19, 2019
Thank you for your issue!
We haven't gotten a response to our questions in our comment above. With only the information that is currently in the issue, we don't have enough information to take action. I'm going to close this but don't hesitate to reach out if you have or find the answers we need, we'll be happy to reopen the issue.