fix: approval windows open as wide as the page (closes #518)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run

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:
2026-10-14 19:34:18 +00:00
parent f4551dcb67
commit 7d841b39f6
8 changed files with 174 additions and 10 deletions
+14
View File
@@ -242,6 +242,13 @@ async function settle() {
* "?approval=" and an id for the popup opened as an approval window.
* @param {object} [options.runtime] members of chrome.runtime that replace the
* stub's own, for a test that has to answer the background's messages.
* @param {object} [options.windows] chrome.windows, for a test of the approval
* window resizing itself.
* @param {object} [options.tabs] chrome.tabs, for the same test: the page's
* zoom.
* @param {object} [options.documentElement] members of document.documentElement
* that replace the stub's own: scrollWidth and clientWidth, which are equal
* unless a test says otherwise, so the page does not scroll sideways.
* @returns {Promise<object>} handles onto the booted page.
*/
async function bootPopup(stored, options) {
@@ -277,6 +284,11 @@ async function bootPopup(stored, options) {
(options && options.storage) ||
makeStorageStub(stored === undefined ? {} : { autistmask: stored });
const document = makeDocument(POPUP_HTML);
Object.assign(
document.documentElement,
{ scrollWidth: 396, clientWidth: 396 },
options && options.documentElement,
);
const reloads = [];
globalThis.chrome = {
@@ -287,6 +299,8 @@ async function bootPopup(stored, options) {
onMessage: { addListener: () => {} },
...(options && options.runtime),
},
windows: options && options.windows,
tabs: options && options.tabs,
};
globalThis.document = document;
globalThis.window = {