Vasyl Oliinyk’s Post

Have you ever tried to show a full-screen modal from inside a 300×600 iframe? I had to. The setup: a JS snippet embedded on a publisher's page. It reads attributes from its own <script> tag, creates an iframe, injects a full React app into it, and renders an ad. When a user clicks, a large modal needs to open. But the React app lives inside an iframe. Which lives inside a Google ad iframe. Two levels deep. Each has its own sandbox restrictions. Render the modal inside the widget, and 90% of it is invisible. Clipped to 300×600. Completely broken UX. The only way out? Break through both iframe boundaries and inject the modal directly into the publisher's root document. With inline styles. No access to their CSS. No control over their layout. Cross-origin limitations. Not the most glamorous problem - but one of those real-world engineering puzzles that teach you how browsers actually work. It shipped. It scaled. It handled 50M+ monthly interactions across major news portals. Frontend engineering isn’t just about components and design systems. Sometimes it’s about finding the door when the browser gives you walls. #Frontend #JavaScript #React #WebDevelopment #Engineering

To view or add a comment, sign in

Explore content categories