fix: approval windows open as wide as the page (closes #518)
The approval window opened 360 pixels wide while the page is 396, cutting 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 zoom of its own tab. Firefox draws some zoom steps a little larger than it reports, so the page measures again after each widening, three times at most. The toolbar popup's window is left alone. The Firefox suite checks that the sign prompt fits at 170%. README's Visual Style line now gives the page's real width. Model: opus-5-5
This commit was merged in pull request #555.
This commit is contained in:
@@ -243,6 +243,22 @@ function tabsSendMessage(tabId, message) {
|
||||
return invoke(tabsApi(), "sendMessage", tabId, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Object|undefined>} the tab the calling page is in, or
|
||||
* undefined for a page not in a tab, such as the toolbar popup.
|
||||
*/
|
||||
function tabsGetCurrent() {
|
||||
return invoke(tabsApi(), "getCurrent");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} tabId
|
||||
* @returns {Promise<number>} that tab's zoom: 1.5 at 150%.
|
||||
*/
|
||||
function tabsGetZoom(tabId) {
|
||||
return invoke(tabsApi(), "getZoom", tabId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} createData
|
||||
* @returns {Promise<Object>} the created window.
|
||||
@@ -258,6 +274,22 @@ function windowsGetLastFocused() {
|
||||
return invoke(windowsApi(), "getLastFocused");
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Object>} the window the calling page is in.
|
||||
*/
|
||||
function windowsGetCurrent() {
|
||||
return invoke(windowsApi(), "getCurrent");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} windowId
|
||||
* @param {Object} updateInfo
|
||||
* @returns {Promise<Object>} the updated window.
|
||||
*/
|
||||
function windowsUpdate(windowId, updateInfo) {
|
||||
return invoke(windowsApi(), "update", windowId, updateInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} windowId
|
||||
* @returns {Promise<void>}
|
||||
@@ -280,10 +312,14 @@ module.exports = {
|
||||
storageRemove,
|
||||
storageSet,
|
||||
tabsApi,
|
||||
tabsGetCurrent,
|
||||
tabsGetZoom,
|
||||
tabsQuery,
|
||||
tabsSendMessage,
|
||||
windowsApi,
|
||||
windowsCreate,
|
||||
windowsGetCurrent,
|
||||
windowsGetLastFocused,
|
||||
windowsRemove,
|
||||
windowsUpdate,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user