question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

infinite resize (enlarging) loop

See original GitHub issue

hi! first off, thank you for iframe-resizer. it’s awesome!

i’m seeing an infinite resize loop when i use it with a Metabase embedded dashboard in an iframe.

this is with iframe-resizer 3.5.15. looking at the changelog, the changes since then seem unrelated, but feel free to let me know if you think it might already be fixed. reproduces for me in firefox 60, chrome 66, and safari 11.1.1 on mac os x 10.13.5.

here’s the outer page’s HTML:

<!DOCTYPE html>
<html>
<head>
<script src="http://localhost:3000/app/iframeResizer.js"></script>
</head>
<body>
foo bar baz
<iframe src="http://localhost:3000/public/dashboard/440e3f82-9c7a-4822-a244-7fb038a5eee4"
        id="metabase" frameborder="0" width="100%" allowtransparency>
</iframe>
<script>iFrameResize({log: true}, "#metabase");</script>
</body>
</html>

one possible cause is that Metabase itself uses window.parent.postMessage() to send messages to the top-level page, so i wonder if iframe-resizer is accidentally handling those. here’s an example message payload from Metabase:

{
  source: "Metabase",
  name: "dashboard-parameters",
  value: "?min=3&max=5"
}

possibly related: #7, #58, https://stackoverflow.com/questions/48563508

metabase docs that recommend iframe-resizer usage: https://www.metabase.com/docs/latest/administration-guide/13-embedding.html#resizing-dashboards-to-fit-their-content

thanks in advance!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
snarfedcommented, Jun 19, 2018

@davidjbradshaw i know it’s probably a big request, but if this has happened before, you all might consider adding loop detection to at least prevent the infinite loop in these kinds of cases. just a thought.

1reaction
snarfedcommented, Jun 19, 2018

The most common cause of the is CSS setting a style to be taller than the page, everytime the page resizes, the CSS sizes past the bottome of the page and around we go again.

good guess! this was indeed the issue. details in metabase/metabase#7903. different height calculation methods didn’t help, so i ended up overriding the offending CSS rule. tolerance would probably work too, but the difference in this case is ~150px, which is a bit big to ignore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Example code]-Infinite loop when resizing images
I am running my code to resize all images in a directory however the code goes on an infinite loop. The images are...
Read more >
Infinite loop when resizing images - python - Stack Overflow
I am running my code to resize all images in a directory however the code goes on an infinite loop. The images are...
Read more >
Resize with Cloudflare Workers
To perform resizing and optimizations, the Worker must be able to fetch the original, unresized image from your origin server. If the path ......
Read more >
Pset4 Resize Error - CS50 Stack Exchange
When I try to run the program, I get the message "file size limit exceeded." After looking over my code many times, I...
Read more >
Repeating animation - Axure RP 8
One of the tricky parts with using OnResize for looping animations is that the resize by default will fire every single time there...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found