infinite resize (enlarging) loop
See original GitHub issuehi! 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:
- Created 5 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top GitHub Comments
@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.
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.