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 oraction.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
bodya fixed width of about 320 to 400 px,margin: 0, andmin-heightandmax-height: 600pxin pixels; avoidvh,vwandheight: 100%; reserve space for late images, fonts and async data to stop the jump; usescrollbar-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.htmlandentrypoints/sidepanel/index.htmlbecome 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-schemeon 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 reportedprefers-color-schemequeries 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