Skip to content

iframe window.open broken #9581

Closed
Closed

Description

@majames
  • 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:

  1. open up the example electron app
  2. open dev tools and insert an iframe
  3. from dev tools console set the context to the iframe, and execute window.open (it will return null)
  4. 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 at top

Activity

  1. ddxdental commented on Jul 18, 2017

    @ddxdental

    Are there any notable work arounds for this issue currently?

  2. groundwater commented on Aug 7, 2017

    @groundwater
    Contributor

    Gonna re-open because we have to revert this fix #10204

  3. alexstrat commented on Jan 17, 2018

    @alexstrat
    Contributor

    @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 😉)

  4. codebytere commented on Sep 24, 2018

    @codebytere
    Member

    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!

  5. Anrock commented on Sep 24, 2018

    @Anrock
    Contributor

    @codebytere just reproduced on 1.8.8, 2.0.10, 3.0.0. Please reopen and add corresponding version tags.

  6. Anrock commented on Oct 4, 2018

    @Anrock
    Contributor

    Seems the same happens if using BrowserView instead of iframe.

  7. Gozala commented on Oct 17, 2018

    @Gozala

    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.

  8. sofianguy commented on Aug 9, 2019

    @sofianguy
    Contributor

    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-info label 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.

  9. added
    blocked/need-info ❌
    on Aug 9, 2019
  10. sofianguy commented on Aug 19, 2019

    @sofianguy
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions