Skip to content

Pass child window as an argument to the onUnload callback? #6

@anmcn

Description

@anmcn

I have observed onUnload being called multiple times. I suspect, but have not been able to confirm, this happens when the pop-up window follows a redirect (attempts to debug with chrome devtools result in the behaviour changing).

In our application, we need to trigger certain actions when the popup closes, and this multiple triggering is causing those actions to be run prematurely. Ideally, onUnload would only be called when the pop-up actually closes, but this may be hard to achieve. If the child window was passed to the onLoad callback, one work-around would be to look at the child window.location.href, and only trigger those actions when the child window has reached it's final state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions