diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index b3362badcaf..dc4aea1fc82 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -834,6 +834,9 @@ pref("browser.shopping.experience2023.sidebarClosedCount", 0); // When conditions are met, shows a prompt on the shopping sidebar asking users if they want to disable auto-open behavior pref("browser.shopping.experience2023.showKeepSidebarClosedMessage", true); +// Integrates the Review Checker shopping feature into the global sidebar +pref("browser.shopping.experience2023.integratedSidebar", false); + // Spin the cursor while the page is loading pref("browser.spin_cursor_while_busy", false); @@ -947,9 +950,6 @@ pref("browser.tabs.tabMinWidth", 76); // of the text at small font sizes. pref("browser.tabs.secondaryTextUnsupportedLocales", "ar,bn,bo,ckb,fa,gu,he,hi,ja,km,kn,ko,lo,mr,my,ne,pa,si,ta,te,th,ur,zh"); -//Control the visibility of Tab Manager Menu. -pref("browser.tabs.tabmanager.enabled", true); - // When tabs opened by links in other tabs via a combination of // browser.link.open_newwindow being set to 3 and target="_blank" etc are // closed: @@ -1230,15 +1230,9 @@ pref("network.manage-offline-status", true); // We want to make sure mail URLs are handled externally... pref("network.protocol-handler.external.mailto", true); // for mail -#ifdef XP_WIN - pref("network.protocol-handler.external.ms-windows-store", true); -#endif // ...without warning dialogs pref("network.protocol-handler.warn-external.mailto", false); -#ifdef XP_WIN - pref("network.protocol-handler.warn-external.ms-windows-store", false); -#endif // By default, all protocol handlers are exposed. This means that // the browser will respond to openURL commands for all URL types. @@ -1740,6 +1734,10 @@ pref("browser.partnerlink.campaign.topsites", "amzn_2020_a1"); // Activates preloading of the new tab url. pref("browser.newtab.preload", true); +// Mozilla Ad Routing Service (MARS) unified ads service +pref("browser.newtabpage.activity-stream.unifiedAds.enabled", false); +pref("browser.newtabpage.activity-stream.unifiedAds.endpoint", "https://ads.mozilla.org/"); + // Weather widget for newtab pref("browser.newtabpage.activity-stream.showWeather", true); pref("browser.newtabpage.activity-stream.weather.query", ""); diff --git a/browser/base/content/browser-addons.js b/browser/base/content/browser-addons.js index e81885a220e..64e7f5897b5 100644 --- a/browser/base/content/browser-addons.js +++ b/browser/base/content/browser-addons.js @@ -87,6 +87,165 @@ const ERROR_L10N_IDS = new Map([ ], ]); +customElements.define( + "addon-webext-permissions-notification", + class MozAddonPermissionsNotification extends customElements.get( + "popupnotification" + ) { + show() { + super.show(); + + if (!this.notification) { + return; + } + + if (!this.notification.options?.customElementOptions) { + throw new Error( + "Mandatory customElementOptions property missing from notification options" + ); + } + + this.textEl = this.querySelector("#addon-webext-perm-text"); + this.introEl = this.querySelector("#addon-webext-perm-intro"); + this.permsSingleEl = this.querySelector( + "#addon-webext-perm-single-entry" + ); + this.permsListEl = this.querySelector("#addon-webext-perm-list"); + + this.render(); + } + + get hasNoPermissions() { + const { strings, showIncognitoCheckbox } = + this.notification.options.customElementOptions; + return !(showIncognitoCheckbox || strings.msgs.length); + } + + get hasMultiplePermissionsEntries() { + const { strings, showIncognitoCheckbox } = + this.notification.options.customElementOptions; + return ( + strings.msgs.length > 1 || + (strings.msgs.length === 1 && showIncognitoCheckbox) + ); + } + + render() { + const { strings, showIncognitoCheckbox } = + this.notification.options.customElementOptions; + + const { textEl, introEl, permsSingleEl, permsListEl } = this; + + const HTML_NS = "http://www.w3.org/1999/xhtml"; + const doc = this.ownerDocument; + + this.#clearChildElements(); + + if (strings.text) { + textEl.textContent = strings.text; + // By default, multiline strings don't get formatted properly. These + // are presently only used in site permission add-ons, so we treat it + // as a special case to avoid unintended effects on other things. + if (strings.text.includes("\n\n")) { + textEl.classList.add("addon-webext-perm-text-multiline"); + } + textEl.hidden = false; + } + + if (strings.listIntro) { + introEl.textContent = strings.listIntro; + introEl.hidden = false; + } + + // Return earlier if there are no permissions to list. + if (this.hasNoPermissions) { + return; + } + + // If there are multiple permissions entries to be shown, + // add to the list element one entry for each granted permission + // (and one for the private browsing checkbox, if it should + // be shown) and return earlier. + if (this.hasMultiplePermissionsEntries) { + for (let msg of strings.msgs) { + let item = doc.createElementNS(HTML_NS, "li"); + item.classList.add("webext-perm-granted"); + item.textContent = msg; + permsListEl.appendChild(item); + } + if (showIncognitoCheckbox) { + let item = doc.createElementNS(HTML_NS, "li"); + item.classList.add( + "webext-perm-optional", + "webext-perm-privatebrowsing" + ); + item.appendChild(this.#createPrivateBrowsingCheckbox()); + permsListEl.appendChild(item); + } + permsListEl.hidden = false; + return; + } + + // Render a single permission entry, which will be either: + // - an entry for the private browsing checkbox + // - or single granted permission entry. + if (showIncognitoCheckbox) { + permsSingleEl.appendChild(this.#createPrivateBrowsingCheckbox()); + permsSingleEl.hidden = false; + permsSingleEl.classList.add( + "webext-perm-optional", + "webext-perm-privatebrowsing" + ); + return; + } + + permsSingleEl.textContent = strings.msgs[0]; + permsSingleEl.hidden = false; + } + + #clearChildElements() { + const { textEl, introEl, permsSingleEl, permsListEl } = this; + + // Clear all changes to the child elements that may have been changed + // by a previous call of the render method. + textEl.textContent = ""; + textEl.hidden = true; + textEl.classList.remove("addon-webext-perm-text-multiline"); + + introEl.textContent = ""; + introEl.hidden = true; + + permsSingleEl.textContent = ""; + permsSingleEl.hidden = true; + permsSingleEl.classList.remove( + "webext-perm-optional", + "webext-perm-privatebrowsing" + ); + + permsListEl.textContent = ""; + permsListEl.hidden = true; + } + + #createPrivateBrowsingCheckbox() { + const { onPrivateBrowsingAllowedChanged, grantPrivateBrowsingAllowed } = + this.notification.options.customElementOptions; + + const doc = this.ownerDocument; + + let checkboxEl = doc.createXULElement("checkbox"); + checkboxEl.checked = grantPrivateBrowsingAllowed; + checkboxEl.addEventListener("CheckboxStateChange", () => { + onPrivateBrowsingAllowedChanged?.(checkboxEl.checked); + }); + doc.l10n.setAttributes( + checkboxEl, + "popup-notification-addon-privatebrowsing-checkbox" + ); + return checkboxEl; + } + } +); + customElements.define( "addon-progress-notification", class MozAddonProgressNotification extends customElements.get( diff --git a/browser/base/content/browser-box.inc.xhtml b/browser/base/content/browser-box.inc.xhtml index 5e4eaf77b66..7f71abe7d80 100644 --- a/browser/base/content/browser-box.inc.xhtml +++ b/browser/base/content/browser-box.inc.xhtml @@ -5,7 +5,7 @@