Skip to content

Resizing broken if iframed page loads iFrameResizer.contentWindow.js asynchronously #101

Closed
@caseyhoward

Description

@caseyhoward

I'm having an issue where the host page is sending messages to the iframed page too soon. I even moved the iFrameResize call to the onload handler for the iframe. That doesn't work, because even at the time the iframed page is loaded, the message handler hasn't been set up yet (iFrameResizer.contentWindow.js hasn't loaded). We are using requirejs to load the javascript file, so it loads asynchronously.

Right now I just wrapped the call to iFrameResize in a setTimeout with an arbitrary wait of 1 second. It would be nice if I didn't have to worry about this as the solution I came up with is non-optimal and could still potentially not work. Is this an issue you have addressed before? Is there a better solution than what I did?

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