DEV Community

Cover image for How to disable iFrames after a few seconds like they do on codePen.

How to disable iFrames after a few seconds like they do on codePen.

Jochem Stoel on January 17, 2018

Most of us use CodePen, a nice HTML/CSS/JS playground to create and share snippets. You have probably noticed that iFrame previews in search result...
Collapse
 
kspeakman profile image
Kasey Speakman

Hi Joel, could you mention a bit about why you want to disable iframes? Just curious.

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
kspeakman profile image
Kasey Speakman • Edited

My apologies on the name mixup Jochem. It was an auto-correct accident (in my brain instead of my smartphone), no disrespect intended.

Ok cool. This was the first I heard of disabling iframes, so I was curious also. I figure CodePen might do it for XSS-related reasons, considering the nature of their site. But I always like to understand the specific use cases for such things.

Thanks for the informative article.