Hacker News new | ask | show | jobs
by lhdj 2758 days ago
I really haven't researched this topic very much. It was a case of implementing as fast as possible.

Take a look at my repo for how it's implemented; it is not the most responsive site in the world.

What I can tell you is: 1) display=none is a good idea 2) Certain sites have the HTTP header 'X-Frame-Options': BLOCK' or something along those lines. Modern web-browsers wont render those pages in iframes 3) It's a good idea to add sandbox="allow-forms allow-scripts" on every iframe to stop top-level redirects.

I have noticed that it is quite heavy, and my phone's browser handles this for me under-the-hood by saving pages to disk when the iframe is collapsed (I think. I haven't actually tested this but the performance would suggest that this is the case.)