cd /news/developer-tools/responsive-iframes-in-chrome-154 · home topics developer-tools article
[ARTICLE · art-137983] src=developer.chrome.com ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Responsive Iframes in Chrome 154

Google's Chrome 154 adds support for responsively-sized iframes, letting an `<iframe>` size itself to the intrinsic dimensions of its embedded document via the new CSS `frame-sizing` property. The feature replaces the common pattern of manually measuring iframe content and sending dimensions through `postMessage()`, and embedded documents opt in with a `<meta name="responsive-embedded-sizing" content="allow-origins=*">` tag that can restrict cross-origin sizing to specific origins. Dynamic content changes require the embedded document to call `window.requestResize()`, an explicit update model the Chrome team says avoids resize loops.

read3 min views1 publishedSep 23, 2026
Responsive Iframes in Chrome 154
Image: Developer (auto-discovered)

Published: September 16, 2026

Chrome 154 adds support for responsively-sized iframes, letting an <iframe> size itself based on the intrinsic size of its embedded document. This is perfect for seamlessly embedding third-party comment widgets, varying-height social media embeds, or any other type of embed that uses an <iframe>.

Responsively-sized iframes replace a common pattern where developers manually measure iframe content, send dimensions with postMessage() and manually update the iframe size in the embedding page.

Size an iframe to its content #

By default, an iframe has its own viewport. If the embedded document is taller than that viewport, users may get an additional scrollbar. With responsive iframe sizing, the embedding page can instead use content-based sizing:

.embed {
  width: 100%;
  frame-sizing: content-height;
}

The embedded document must opt in:

<meta name="responsive-embedded-sizing" content="allow-origins=*">

Here is a full example:

<style>
  .embed {
    width: 100%;
    frame-sizing: content-height;
  }
</style>
<iframe class="embed" src="https://developer.chrome.com/comments.html" title="Comments">
</iframe>

And in /comments.html:

<!doctype html>
<html>
  <head>
    <meta name="responsive-embedded-sizing" content="allow-origins=*">
  </head>
  <body>
    ...
  </body>
</html>

The iframe can now use the embedded document's content height instead of behaving like a fixed-height viewport.

Use frame-sizing #

The new frame-sizing property controls which dimension is derived from the iframe's content.

Supported values include:

frame-sizing: auto;
frame-sizing: content-width;
frame-sizing: content-height;
frame-sizing: content-inline-size;
frame-sizing: content-block-size;

auto keeps the existing iframe sizing behavior.

For most horizontal writing modes, content-height and content-block-size are the most useful values for vertically expanding embeds.

You can also combine frame-sizing with other CSS constraints:

.embed {
  width: 100%;
  max-height: 80vh;
  frame-sizing: content-height;
}

Resizing after dynamic content changes #

The browser doesn't continuously observe every layout change inside the embedded document.

If the iframe's content changes after the initial layout, for example after more comments or expanding a panel, the embedded document can request a new size calculation with window.requestResize().

async function loadMore() {
  const items = await fetchMoreItems();
  renderItems(items);
  window.requestResize();
}

It's best to call window.requestResize() before layout, after all changes to the document have been made. This explicit update model helps avoid resize loops where changing the iframe size changes its viewport, which changes its contents, which changes its size again.

Cross-origin embeds #

Responsive sizing can also be used with cross-origin iframes. The embedded document can restrict which origins are allowed:

<meta
  name="responsive-embedded-sizing"
  content="allow-origins=https://publisher.example">

This will limit responsive sizing to only https://publisher.example. Multiple origins are separated by space: content="allow-origins=https://publisher1.example https://publisher2.example".

For third-party widgets, restrict access to the origins that need it. This mechanism complements existing iframe security controls such as Content Security Policy's frame-ancestors directive, which controls which sites can embed a page.

Progressive enhancement #

You can use feature queries to keep an existing fallback for browsers that don't support frame-sizing:

.widget {
  width: 100%;
  height: 500px;
}

@supports (frame-sizing: content-height) {
  .widget {
    height: auto;
    frame-sizing: content-height;
  }
}

If the embedded document updates dynamically, you can also feature-detect requestResize():

if ("requestResize" in window) {
  window.requestResize();
}

Existing iframe sizing code can therefore remain as a fallback while support expands.

Try it #

Try out responsive iframe-sizing in the following demo:

── more in #developer-tools 4 stories · sorted by recency
── more on @google 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/responsive-iframes-i…] indexed:0 read:3min 2026-09-23 ·