fix: approval windows open as wide as the page (closes #518)
The approval window was opened 360 pixels wide while the page is 396, so it scrolled sideways and cut off the Reject button. It now opens at 396. The browser counts the window's frame in that width, and a tall screen gives some of it to a vertical scrollbar, so once the approval's screen is up the page widens its own window by however far it would scroll sideways, times the page's zoom. The toolbar popup's window is left alone. The Firefox suite checks that the sign prompt does not scroll sideways; the Chrome suite cannot, as its approval windows open at 1280x720 whatever size is asked. README's Visual Style line now gives the page's real width. Model: opus-5-5
This commit is contained in:
@@ -479,6 +479,9 @@ papered over:
|
||||
forced by clicking Reveal and the settings gear in one page task, which a
|
||||
person cannot do; the case a person can hit, the first decrypt after the popup
|
||||
opens while libsodium is still loading, is not driven.
|
||||
- Approval windows open at 1280x720 whatever size the extension asks for, so
|
||||
whether an approval screen fits its window is checked in the Firefox suite
|
||||
only.
|
||||
|
||||
Any test that drives a failure path on purpose declares the `console.error` it
|
||||
is about to provoke, via `errors.expect()`. That is not a mute: the declaration
|
||||
@@ -551,7 +554,8 @@ suite), wallet creation through the UI, the Add Token screen, and the dApp round
|
||||
trips — `eth_requestAccounts`, `personal_sign`, `wallet_switchEthereumChain`
|
||||
rejected and then approved, `eth_sendTransaction`, and a closed approval window
|
||||
rejecting with EIP-1193 4001 — driven through the real content script,
|
||||
background page and approval windows.
|
||||
background page and approval windows. The `personal_sign` prompt is also
|
||||
required to fit its window without scrolling sideways.
|
||||
|
||||
The suite lives in `tests/e2e/firefox/`. Its WebDriver client (`driver.js`) has
|
||||
**no npm dependencies at all**: it is built on global `fetch` and
|
||||
@@ -908,8 +912,13 @@ discoverable.
|
||||
enough that vanilla JS with simple view switching is sufficient. A framework
|
||||
would add bundle size, build complexity, and attack surface for no benefit at
|
||||
this scale.
|
||||
- **360x600 popup**: Standard browser extension popup dimensions. The UI is
|
||||
designed for this fixed viewport.
|
||||
- **396x600 popup**: The page is 396 pixels wide (`body` in
|
||||
`src/popup/styles/main.css`), and 600 pixels is as tall as the browser lets
|
||||
the toolbar popup grow. The UI is designed for this fixed viewport. The window
|
||||
an approval opens in is given the same size. The browser counts the window's
|
||||
frame in that width, and a screen taller than the window gives some of it to a
|
||||
vertical scrollbar, so once the approval's screen is up the page widens its
|
||||
window by however far it would scroll sideways, scaled by the browser's zoom.
|
||||
|
||||
#### No Layout Shift
|
||||
|
||||
|
||||
Reference in New Issue
Block a user