playing with iframes and I'm suddenly drunk with power. This is amazing.
-
playing with iframes and I'm suddenly drunk with power. This is amazing.
-
I’m pretty sure this is going to be me when I run into the big reasons why people don’t use iframes anymore (what were those again? Are they still relevant if you forget about using iframes for layout and such?)
[looks it up]
The only thing that seems like it might be a concern is usability. Are screen readers just unable to drill into iframes??
Update: looks like it’s fine. Adding a title can be helpful so I’ll do that. See https://webaim.org/techniques/frames/
The two other things seem to be security (because you can have an injected form post using a logged in user’s credentials). This is always mitigated through csrf tokens and regular xss protection. Then there’s memory usage, and my answer to that is that my js bundle is very very small and the iframe is simple :)))
-
@zkat IIRC big things are loading, iframes loading is like the lowest thing in the fetch priority queue and rendering queue, the fact iframes don't auto grow to the size of content is obnoxious. Screen readers are pretty fine with iframes. As a whole they're not bad, they just have some annoying pieces that make things slightly worse than just using your existing page.
-
@konnorrogers @zkat I agree with everything Konnor said. Security and performance we're the primary reasons they fell out of best practice. I wouldn't call myself up to date on the latest with iframes. But with the upgrades to security, they are viable again as far as I understand.
It does feel like one of those areas where we need to brush up on the best practices again though.
-
@konnorrogers @zkat to be clear, I believe loading has gotten a lot faster as well. And you have ways to signal that you want to give them higher fetch priority. (I don't know exactly how that works though)