-
Notifications
You must be signed in to change notification settings - Fork 36
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
iframes reload from source #14
Comments
Unfortunately, this isn't a limitation of reverse portals, this is a limitation of the DOM itself: https://stackoverflow.com/a/8318401/68051. As far as I can tell, the iframe is being moved around the DOM totally correctly, so the DOM node in the new location is the same as the old one, but iframes have unique behaviour where they reload every time they're moved in any way. This isn't likely to be fixable, as its core browser behaviour, so the only way to move an iframe around the page without reloading is with CSS. Sorry about that! If you do find any ways to do this I'd love to hear about them. For now though, I'm going to assume this is impossible, so I'll close this issue. |
Thanks @pimterry for your insightful reply :) I'll keep poking around and see if I figure out something |
@evanfrawley did you discover anything? Struggling with getting my iframes not to reload currently. |
@wyhinton nope, we just didn't go down this road anymore |
@pimterry This is something that could definitely be included in the Important notes section of the documentation. I've spent about half a day setting up and trying to determine why this isn't working using an iframe. |
@ryanhartwig sure, good idea, I'd accept a PR for that if you're interested |
Chrome 133 (released yesterday) has a solution for this iframe problem! I'll reopen this issue now. They've introduced a new PRs welcome if somebody has a minute to set this up and test it works as expected in Chrome 133. Looks like Safari & Firefox have shared positive signals on implementing this too, so eventually this will go away everywhere. |
Hi! Really cool library, thanks for building it.
I've found though that if I use an iframe to render an embedded video, changing the parent will reload the embed from source each time. The actual source URL of the iframe doesn't matter. Do you have any idea why this might be the case?
The text was updated successfully, but these errors were encountered: