Jump to content

Welcome to CodeNameJessica

✨ Welcome to CodeNameJessica! ✨

πŸ’» Where tech meets community.

Hello, Guest! πŸ‘‹
You're just a few clicks away from joining an exclusive space for tech enthusiasts, problem-solvers, and lifelong learners like you.

πŸ” Why Join?
By becoming a member of CodeNameJessica, you’ll get access to:
βœ… In-depth discussions on Linux, Security, Server Administration, Programming, and more
βœ… Exclusive resources, tools, and scripts for IT professionals
βœ… A supportive community of like-minded individuals to share ideas, solve problems, and learn together
βœ… Project showcases, guides, and tutorials from our members
βœ… Personalized profiles and direct messaging to collaborate with other techies

🌐 Sign Up Now and Unlock Full Access!
As a guest, you're seeing just a glimpse of what we offer. Don't miss out on the complete experience! Create a free account today and start exploring everything CodeNameJessica has to offer.

417: Iframe Allow Attribute Saga

(0 reviews)
by: Chris Coyier
Tue, 18 Nov 2025 23:11:32 +0000


There was a day not long ago where a Google Chrome browser update left any page with a CodePen Embed on it throwing a whole big pile of red JavaScript errors in the console. Not ideal, obviously.

The change was related to how the browser handles allow attributes on iframes (i.e. <iframe allow="...">). CodePen was calculating the appropriate values inside an iframe for a nested iframe. That must have been a security issue of sorts, as now those values need to be present on the outside iframe as well.

We documented all this in a blog post so hopefully we could get some attention from Chrome on this, and for other browser makers as well since it affects all of us.

And I posted it on the ol’ social media:

Hi @developer.chrome.com πŸ‘‹πŸ‘‹πŸ˜¬blog.codepen.io/2025/10/20/g…Having some iframe `allow` issues over here. Not sure if it's a "bug" to log, but we could use an assist.

Chris Coyier (@chriscoyier.net) 2025-10-20T20:25:43.360Z

Huge thanks to Bramus Van Damme who saw this, triaged it at Chrome, and had a resolution within a day:

I followed up on this one with engineering (issues.chromium.org/issues/45408…), and we decided on a small tweak to only show these console messages when a reporting endpoint is set.The tweak landed in Chrome 143.0.7490.0 (current Canary)(See next message for before and after screenshots)

Bramus (@bram.us) 2025-10-24T12:21:00.246Z

I think the patch is a great change so hats off to everyone involved for getting it done so quickly. It’s already in Canary and don’t really know when it’ll get the stable but that sure will be good. It follows how Safari is doing things where values that aren’t understood are just ignored (which we think is fine and inline with how HTML normally works).

Fortunately we were able to mitigate the problem a little until then. For most Embedded Pens, a <script> is loaded on the page embedding it, and we dynamically create the <iframe> for you. This is just nice as it makes making an accessible fallback easier and gives you access to API-ish features for the embeds. We were able to augment that script to do a little browser user-agent sniffing and apply the correct set of allow attributes on the iframe, as to avoid those JavaScript errors we were seeing.

But there’s the rub: we’d rather not do any user-agent sniffing at all.

If we could just put all the possible allow attributes we want on there, and not be terribly concerned if any particular browser didn’t support any particular value, that would be ideal. We just can’t have the scary console errors, out of concern for our users who may not understand them.

Where we’re at in the saga now is that:

  1. We’re waiting for the change to Chrome to get to stable.
  2. We’re hoping Safari stays the way it is.
  3. OH HI FIREFOX.

On that last point, if we put all the allow attributes we would want to on an <iframe> in Firefox, we also get console-bombed. This time not with red-errors but with yellow-warnings.

So yes, hi Firefox, if you could also not display these warnings (unless a reporting URL is set up) that would be great. We’d be one less website out there relying on user-agent sniffing.

0 Comments

Recommended Comments

There are no comments to display.

Guest
Add a comment...

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions β†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.