From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- toolkit/mozapps/extensions/content/aboutaddons.css | 12 +++++++--- toolkit/mozapps/extensions/content/aboutaddons.js | 27 +++++++++++++++------- .../extensions/content/aboutaddonsCommon.js | 6 ++++- 3 files changed, 33 insertions(+), 12 deletions(-) (limited to 'toolkit/mozapps/extensions/content') diff --git a/toolkit/mozapps/extensions/content/aboutaddons.css b/toolkit/mozapps/extensions/content/aboutaddons.css index 3f4e80797a..2f5157bea3 100644 --- a/toolkit/mozapps/extensions/content/aboutaddons.css +++ b/toolkit/mozapps/extensions/content/aboutaddons.css @@ -643,12 +643,18 @@ panel-item[action="report"]::part(button) { text-decoration: none; } -.inline-options-stack { - /* If the options browser triggers an alert we need room to show it. */ - min-height: 250px; +.addon-inline-options { width: 100%; background-color: white; margin-block: 4px; + /* + * Makes sure the browser minimal height is going to be the same as when + * this browser element was wrapper in a stack and a min-height was necessary + * for the prompts to fit inside the browser element. + * That stack element has been removed as part of Bug 1881055, but keeping + * the min-height unchanged to avoid potential regressions in the short term. + */ + min-height: 250px; } addon-permissions-list > .addon-detail-row { diff --git a/toolkit/mozapps/extensions/content/aboutaddons.js b/toolkit/mozapps/extensions/content/aboutaddons.js index 37687a8be7..39c4656210 100644 --- a/toolkit/mozapps/extensions/content/aboutaddons.js +++ b/toolkit/mozapps/extensions/content/aboutaddons.js @@ -1423,10 +1423,23 @@ class SidebarFooter extends HTMLElement { labelL10nId: "addons-settings-button", onClick: e => { e.preventDefault(); - windowRoot.ownerGlobal.switchToTabHavingURI("about:preferences", true, { - ignoreFragment: "whenComparing", - triggeringPrincipal: systemPrincipal, - }); + let hasAboutSettings = windowRoot.ownerGlobal.switchToTabHavingURI( + "about:settings", + false, + { + ignoreFragment: "whenComparing", + } + ); + if (!hasAboutSettings) { + windowRoot.ownerGlobal.switchToTabHavingURI( + "about:preferences", + true, + { + ignoreFragment: "whenComparing", + triggeringPrincipal: systemPrincipal, + } + ); + } }, }); @@ -1695,6 +1708,7 @@ class InlineOptionsBrowser extends HTMLElement { browser.setAttribute("disableglobalhistory", "true"); browser.setAttribute("messagemanagergroup", "webext-browsers"); browser.setAttribute("id", "addon-inline-options"); + browser.setAttribute("class", "addon-inline-options"); browser.setAttribute("transparent", "true"); browser.setAttribute("forcemessagemanager", "true"); browser.setAttribute("autocompletepopup", "PopupAutoComplete"); @@ -1731,10 +1745,7 @@ class InlineOptionsBrowser extends HTMLElement { readyPromise = promiseEvent("load", browser, true); } - let stack = document.createXULElement("stack"); - stack.classList.add("inline-options-stack"); - stack.appendChild(browser); - this.appendChild(stack); + this.appendChild(browser); this.browser = browser; // Force bindings to apply synchronously. diff --git a/toolkit/mozapps/extensions/content/aboutaddonsCommon.js b/toolkit/mozapps/extensions/content/aboutaddonsCommon.js index 739e7629d7..9315e35861 100644 --- a/toolkit/mozapps/extensions/content/aboutaddonsCommon.js +++ b/toolkit/mozapps/extensions/content/aboutaddonsCommon.js @@ -237,7 +237,11 @@ async function installAddonsFromFilePicker() { ]); const nsIFilePicker = Ci.nsIFilePicker; var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); - fp.init(window, dialogTitle.value, nsIFilePicker.modeOpenMultiple); + fp.init( + window.browsingContext, + dialogTitle.value, + nsIFilePicker.modeOpenMultiple + ); try { fp.appendFilter(filterName.value, "*.xpi;*.jar;*.zip"); fp.appendFilters(nsIFilePicker.filterAll); -- cgit v1.2.3