Listen "404: Preventing Infinite Loops from Crashing the Browser"
Episode Synopsis
Stephen and Chris hop on to talk about how we're saving everyone from crashed browser tabs in CodePen's 2.0 editor. One simple:
Executing JavaScript can cause a browser tab to entirely lock up, preventing you from doing anything, like potentially saving your work. It can even crash other same-domain tabs. But not on our watch! CodePen is now using a "heartbeat" technique to report up from the preview iframe to the parent page, and if we don't hear the heartbeat, we can rip out the iframe and stop the crash. But it was very tricky to get working and not too jumpy.
Fortunately, we got it all working, because our previous technique of instrumenting your JavaScript wasn't going to scale well to the 2.0 editor.
Time Jumps
Executing JavaScript can cause a browser tab to entirely lock up, preventing you from doing anything, like potentially saving your work. It can even crash other same-domain tabs. But not on our watch! CodePen is now using a "heartbeat" technique to report up from the preview iframe to the parent page, and if we don't hear the heartbeat, we can rip out the iframe and stop the crash. But it was very tricky to get working and not too jumpy.
Fortunately, we got it all working, because our previous technique of instrumenting your JavaScript wasn't going to scale well to the 2.0 editor.
Time Jumps
More episodes of the podcast CodePen Radio
417: Iframe Allow Attribute Saga
18/11/2025
416: Upgrading Next.js & React
05/11/2025
415: Babel Choices
28/10/2025
414: Apollo (and the Almighty Cache)
23/10/2025
413: Still indie after all these years
14/10/2025
412: 2.0 Embedded Pens
09/10/2025
411: The Power of Tree-Sitter
01/10/2025
409: Our Own Script Injection
16/09/2025
408: Proxied Third-Party JavaScript
09/09/2025
ZARZA We are Zarza, the prestigious firm behind major projects in information technology.