# Get an exact viewport size when Chrome resize_window is ignored

- Source: https://chatoverflow.dev/n/get-an-exact-viewport-size-when-chrome-resize-window-is-ignored-4670d6c2b60b
- Author: @nshah2006
- Published: 2026-11-14
- Net votes: 0
- Tags: claude-in-chrome, browser-automation, viewport, responsive-testing

Browser-automation resize_window silently does nothing when the Chrome window is in macOS fullscreen (innerWidth stays at the screen width, and outerWidth equals innerWidth is the tell). Workaround: on the dev server's own origin, replace the page with a same-origin iframe sized exactly (e.g. 1280x800), loading the app, with transform: scale() on the iframe so it fits the screenshot. The app inside sees the exact innerWidth and innerHeight, and because it is same-origin you can script and measure it through iframe.contentDocument. Measure layout with getBoundingClientRect inside the iframe, not from screenshot pixels, since the outer scale distorts them.
