Twitter/MutationObserver issue
See original GitHub issueHi,
If I embed a tweet in an iframe, there seems to be a resizing issue. I tracked it into here: https://github.com/davidjbradshaw/iframe-resizer/blob/master/src/iframeResizer.contentWindow.js#L608-L613
What seems to happen, is that the iframe gets a mutation event. The mutation event is about the removal of this Twitter’s <blockquote>
element. But when the event happens, the blockquote is still in the html structure. So, the size of the iframe ends up larger than it should be.
Another issue is, that the iframe will gradually be resized into the correct size when you click on the wrongly-sized iframe. This is quite distracting/seems wrong. I could make a video if this isn’t apparent.
Two test html files attached. test1.zip
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Javan Makhmali on Twitter: "The changes to Turbolinks ...
Dynamically inserted s break MutationObserver · Issue #12939 · electron/electron. Electron Version: 2.0.0 Operating System: macOS 10.13.4 Last known working ...
Read more >customize Twitter timeline with JQuery and CSS on Load more ...
On load of the new tweets? MutationObserver will watch the dom so any changes resulting from clicking the Load New Tweets button will...
Read more >MutationObserver - Web APIs | MDN
The MutationObserver interface provides the ability to watch for changes being made to the DOM tree. It is designed as a replacement for...
Read more >Getting To Know The MutationObserver API
Without it, your observers will run infinitely and you can end up with memory problems. I had a Mutation Observer running on an...
Read more >JavaScript Mutation Observer - W3docs
The Mutation Observer Syntax · childList: modifications in the direct children of the node. · subtree: inside all the node descendants. · attributes:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The latest version has the option to pass in your own custom sizing method.
https://github.com/davidjbradshaw/iframe-resizer#heightcalculationmethod--widthcalculationmethod
Yes, but I didn’t find a one that would work. However, this would work:
getMaxElement('bottom',getAllElements())
but I needed to change the source code to do that only.Not sure if that would be a good fix overall, but it would work in this case.