Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initCallback won't be called #554

Closed
shotasenga opened this issue Jan 11, 2018 · 3 comments
Closed

initCallback won't be called #554

shotasenga opened this issue Jan 11, 2018 · 3 comments

Comments

@shotasenga
Copy link
Contributor

It seems like some times the throttle() (sizeIFrameThrottled()) prevents init event.

When the init event was fired, the sizeIFrameThrottled() postpone the event firing process. During the waiting time, if some other event occurred, the initial init event was skipped. As a consequence, initCallback won't be called.

Steps

  1. load frame from the main page
  2. load iframreResizer.contentWindow.js in the frame
  3. modify content as soon as possible (In the test case below, I just put style tag on the bottom of the document.)
  4. the main page receives iFrameResizer0:136:300:mutationObserver event instead of init

I made a quick test case to reproduce the bag. http://shared.senta.me.s3-website-us-east-1.amazonaws.com/iframe-resizer-000/

My environment

  • OS :: macOS High Sierra 10.13.2
  • Browser :: Chrome 63.0.3239.132 (Official Build) (64-bit)

Thanks,

@davidjbradshaw
Copy link
Owner

Not seem that before. I guess init should not be throttled. Would welcome a PR if you have the time to fix this.

@shotasenga
Copy link
Contributor Author

I think I have the time to fix it later today (or weekend) I'll send a PR then.

shotasenga pushed a commit to shotasenga/iframe-resizer that referenced this issue Jan 16, 2018
* call original unthrottled function for the `init` event
davidjbradshaw pushed a commit that referenced this issue Jan 21, 2018
* call original unthrottled function for the `init` event
@davidjbradshaw
Copy link
Owner

Fixed in v3.6.0

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

No branches or pull requests

2 participants