fix(extension): pin the popup width to 360px on the root element - #358
Merged
Conversation
The popup opened in a window roughly twice its usual width: a 720x539 viewport with the fixed 360px body floating in the middle. Nothing in the extension asks for that size - the unlock fallback requests 384x640 and the CSS body has been 360x540 throughout - so the width was inferred by the browser from a page that pinned its width only on body, with a `width=device-width` viewport meta inviting the device to decide. Pins the width (and the auto margins that centre it) on html as well, and drops the viewport meta, which an extension popup has no use for. The body keeps its own 360x540 box and the sub-viewport scroll fallback is untouched.
vineethkrishnan
force-pushed
the
fix/extension-popup-window-width
branch
from
August 19, 2026 12:45
f18fd19 to
8ba0ad3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The popup opened in a window about twice its usual width. Measured from the report screenshot, the window's content area was 720x539: the height matches the CSS body height (540), while the width is exactly 2x the 360px body, which floated centred in an oversized viewport.
Nothing in the extension asks for that size:
windows.create(extension/entrypoints/background.ts:1688) requests 384x640, and never requested anything wider in its history (400x620 -> 376x600 -> 384x640);body{width:360px;height:540px;...}, so the fixed box is intact;So the width was chosen by the browser, not by us. The page gave it room to: the width was pinned only on
body,htmlhad a height but no width, andindex.htmlcarried<meta name="viewport" content="width=device-width, initial-scale=1.0">, which hands the layout viewport to the device rather than to our CSS.Change
width: 360px(and the auto margins that centre it) onhtml, so the popup's width cannot be inferred from whatever viewport the browser hands the page.width=device-widthviewport meta from the popup document; an extension popup has no device viewport to adapt to.bodykeeps its own 360x540 box, and the sub-viewport scroll fallback added in fix(extension): recognize the unlock window as an extension page #347 is untouched.Verification
CSS has no automated coverage here, so this was checked against a real build. Built the extension and served
.output/chrome-mv3/popup.htmlin a 1920px-wide Chrome viewport:The UI renders as a centred 360px column with the themed background filling the window, instead of stretching or drifting. Built CSS confirms
html{width:360px;height:100%;margin:0 auto}and the body theme block is unchanged.