Console: Fix iframe size issues
for the four iframe-able apps, by switching to Iframe-resizer as used/recommended by i2p+ This is a two-part solution. Both parent and child have a js file. Child js is inactive unless iframed and activated by parent.
This will also be used in susimail html iframe to follow.
We leave old iframed.js active as a backup.
Source: https://github.com/davidjbradshaw/iframe-resizer Iframe-resizer 4.3.9: Copyright (c) 2013-2023 David J. Bradshaw License: MIT See licenses/LICENSE-Iframe-resizer.txt
Merge request reports
Activity
changed milestone to %2.5.0
added console label
requested review from @idk
assigned to @zzz
Details:
The existing simple js iframe resizer added by str4d 10 years ago has severe limitations on accurately calculating the actual size of the iframe. Still, it works for the sidebar and the 4 iframable apps (i2ptunnel, susidns, susimail, i2psnark). Note that the first two are iframed by default and the last two are not unless the 'embed email and torrent apps' option is enabled on /configui.
Your addition of js open/close sections on the i2ptunnel edit page a couple years ago revealed the limitations of the current resizer, and it looks like you've tried to fix it in the past, but it's not fixable.
See the docs for the new resizer (link in OP) for why simple solutions don't work, and how it's done. The new resizer is used by and recommended by plus. You can also clone that repo and try the demo in there.
This MR has only modest benefit, and only for i2ptunnel. However, an upcoming MR will add support for displaying HTML email to susimail, and it's going to be in an iframe. Testing revealed that the current iframe resizer is woefully insufficient to handle the wide variety of HTML emails out there. That's how I started researching alternatives, and plus pointed me to this new solution.
So the upcoming HTML email MR depends on this one.
mentioned in commit fc8cdfc7
mentioned in merge request !177 (merged)