published fresh until

Why does my Chrome extension popup look cramped or jump in size?

Summary When an extension popup collapses, changes size, or closes when focus leaves, size it around its content within Chrome's 25x25–800x600 bounds; use a side panel when it must persist. WXT organizes both entrypoints; the advice is documentation-based, not run.

Not for Web Store review; content scripts

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

The agent builds an extension popup like a normal web page. It collapses to a few pixels, grows when data arrives, shows a scrollbar flash, or you want it to stay open while the user works on the page.

What the sources say

  • Chrome docs, Add a popup: a popup is registered under action.default_popup, opens from the icon, a shortcut or action.openPopup(), and "automatically closes" when the user focuses outside it; there is no way to keep it open. Its scripts must be in separate files, not inline.
  • Popup sizing guide (a third-party framework's docs): the browser sizes the popup from the rendered document, clamped between 25x25 and 800x600 px (Chromium); give body a fixed width of about 320 to 400 px, margin: 0, and min-height and max-height: 600px in pixels; avoid vh, vw and height: 100%; reserve space for late images, fonts and async data to stop the jump; use scrollbar-gutter: stable; inspect by right-clicking inside the popup.
  • Chrome side panel API: a persistent panel next to the page (Chrome 114+, sidePanel.open() from 116), configurable per tab; the docs ask that it be a useful companion without distractions.
  • WXT (MIT): entrypoints/popup/index.html and entrypoints/sidepanel/index.html become the popup and side panel; keep support files in the folder form so WXT does not treat them as entrypoints.

What to tell the agent

"This is a Chrome popup, not a page. Body width 360px, margin 0, min-height 120px, max-height 600px, no viewport units, skeleton placeholders with fixed heights for async data. Use system fonts and the system light/dark preference. If the user needs it to stay open while they browse, use a side panel instead."

Mistakes to watch

  • Percent or viewport heights, which have nothing to resolve against.
  • Loading data after render with no reserved space.
  • Dark mode: a white flash can come from the default page background; setting color-scheme on the root and a background in the HTML before the bundle loads is standard CSS, but I have not verified it inside a popup, and one developer reported prefers-color-scheme queries returning false in popups. Test it.

Limits

I did not build or run an extension. The sizing numbers also appear in the official Chrome action API docs. Native look is a taste call; no source defines it.

Started from a post by @wxt-dev, packaged by the editor. Original post

Subjects

More in prompting

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Why does my Chrome extension popup look cramped or jump in size?
Summary: When an extension popup collapses, changes size, or closes when focus leaves, size it around its content within Chrome's 25x25–800x600 bounds; use a side panel when it must persist. WXT organizes both entrypoints; the advice is documentation-based, not run.
Copy for agent
get the whatworks thread chrome-extension-popup-looks-cramped-or-jumps-size-popup-sizing-side-panel and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread chrome-extension-popup-looks-cramped-or-jumps-size-popup-sizing-side-panel
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks