morgan pushed to branch mullvad-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Mullvad Browser
Commits: ee9a53d8 by Henry Wilkes at 2024-09-18T20:12:06+00:00 Bug 42831: Remove the shopping components.
- - - - -
12 changed files:
- browser/base/content/browser-init.js - browser/base/content/browser.js - browser/base/content/browser.js.globals - browser/base/content/browser.xhtml - browser/base/content/navigator-toolbox.inc.xhtml - browser/components/BrowserGlue.sys.mjs - browser/components/about/AboutRedirector.cpp - browser/components/about/components.conf - browser/components/shopping/jar.mn - browser/components/shopping/moz.build - toolkit/components/shopping/jar.mn - toolkit/modules/RemotePageAccessManager.sys.mjs
Changes:
===================================== browser/base/content/browser-init.js ===================================== @@ -613,8 +613,6 @@ var gBrowserInit = {
CaptivePortalWatcher.delayedStartup();
- ShoppingSidebarManager.ensureInitialized(); - SessionStore.promiseAllWindowsRestored.then(() => { this._schedulePerWindowIdleTasks(); document.documentElement.setAttribute("sessionrestored", "true");
===================================== browser/base/content/browser.js ===================================== @@ -39,7 +39,7 @@ ChromeUtils.defineESModuleGetters(this, { E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", ExtensionsUI: "resource:///modules/ExtensionsUI.sys.mjs", HomePage: "resource:///modules/HomePage.sys.mjs", - isProductURL: "chrome://global/content/shopping/ShoppingProduct.mjs", + // Removed isProductURL from ShoppingProduct.mjs. tor-browser#42831. LightweightThemeConsumer: "resource://gre/modules/LightweightThemeConsumer.sys.mjs", LoginHelper: "resource://gre/modules/LoginHelper.sys.mjs", @@ -71,8 +71,8 @@ ChromeUtils.defineESModuleGetters(this, { SearchUIUtils: "resource:///modules/SearchUIUtils.sys.mjs", SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs", SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs", - ShoppingSidebarParent: "resource:///actors/ShoppingSidebarParent.sys.mjs", - ShoppingSidebarManager: "resource:///actors/ShoppingSidebarParent.sys.mjs", + // Removed ShoppingSidebarParent and ShoppingSidebarManager. + // tor-browser#42831. ShortcutUtils: "resource://gre/modules/ShortcutUtils.sys.mjs", SiteDataManager: "resource:///modules/SiteDataManager.sys.mjs", SitePermissions: "resource:///modules/SitePermissions.sys.mjs", @@ -4340,10 +4340,6 @@ var TabsProgressListener = { return; }
- // Some shops use pushState to move between individual products, so - // the shopping code needs to be told about all of these. - ShoppingSidebarManager.onLocationChange(aBrowser, aLocationURI, aFlags); - // Filter out location changes caused by anchor navigation // or history.push/pop/replaceState. if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
===================================== browser/base/content/browser.js.globals ===================================== @@ -130,7 +130,6 @@ "E10SUtils", "ExtensionsUI", "HomePage", - "isProductURL", "LightweightThemeConsumer", "LoginHelper", "LoginManagerParent", @@ -161,8 +160,6 @@ "SearchUIUtils", "SessionStartup", "SessionStore", - "ShoppingSidebarParent", - "ShoppingSidebarManager", "ShortcutUtils", "SiteDataManager", "SitePermissions",
===================================== browser/base/content/browser.xhtml ===================================== @@ -127,7 +127,7 @@ Services.scriptloader.loadSubScript("chrome://browser/content/places/places-menupopup.js", this); Services.scriptloader.loadSubScript("chrome://browser/content/search/autocomplete-popup.js", this); Services.scriptloader.loadSubScript("chrome://browser/content/search/searchbar.js", this); - Services.scriptloader.loadSubScript("chrome://browser/content/shopping/shopping-sidebar.js", this); + // Removed shopping-sidebar.js. tor-browser#42831. Services.scriptloader.loadSubScript("chrome://browser/content/languageNotification.js", this);
window.onload = gBrowserInit.onLoad.bind(gBrowserInit);
===================================== browser/base/content/navigator-toolbox.inc.xhtml ===================================== @@ -380,6 +380,8 @@ <image class="urlbar-icon" id="translations-button-circle-arrows" /> <html:span id="translations-button-locale" aria-hidden="true" /> </hbox> + <!-- #shopping-sidebar-button should remain hidden. + - tor-browser#42831. --> <hbox id="shopping-sidebar-button" class="urlbar-page-action" role="button"
===================================== browser/components/BrowserGlue.sys.mjs ===================================== @@ -86,7 +86,7 @@ ChromeUtils.defineESModuleGetters(lazy, { SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs", ShellService: "resource:///modules/ShellService.sys.mjs", ShortcutUtils: "resource://gre/modules/ShortcutUtils.sys.mjs", - ShoppingUtils: "resource:///modules/ShoppingUtils.sys.mjs", + // Removed ShoppingUtils. tor-browser#42831. SpecialMessageActions: "resource://messaging-system/lib/SpecialMessageActions.sys.mjs", TRRRacer: "resource:///modules/TRRPerformance.sys.mjs", @@ -481,19 +481,7 @@ let JSWINDOWACTORS = { matches: ["about:tabcrashed*"], },
- AboutWelcomeShopping: { - parent: { - esModuleURI: "resource:///actors/AboutWelcomeParent.sys.mjs", - }, - child: { - esModuleURI: "resource:///actors/AboutWelcomeChild.sys.mjs", - events: { - Update: {}, - }, - }, - matches: ["about:shoppingsidebar"], - remoteTypes: ["privilegedabout"], - }, + // Removed AboutWelcomeShopping. tor-browser#42831.
AboutWelcome: { parent: { @@ -890,27 +878,7 @@ let JSWINDOWACTORS = { matches: ["about:studies*"], },
- ShoppingSidebar: { - parent: { - esModuleURI: "resource:///actors/ShoppingSidebarParent.sys.mjs", - }, - child: { - esModuleURI: "resource:///actors/ShoppingSidebarChild.sys.mjs", - events: { - ContentReady: { wantUntrusted: true }, - PolledRequestMade: { wantUntrusted: true }, - // This is added so the actor instantiates immediately and makes - // methods available to the page js on load. - DOMDocElementInserted: {}, - ReportProductAvailable: { wantUntrusted: true }, - AdClicked: { wantUntrusted: true }, - AdImpression: { wantUntrusted: true }, - DisableShopping: { wantUntrusted: true }, - }, - }, - matches: ["about:shoppingsidebar"], - remoteTypes: ["privilegedabout"], - }, + // Removed ShoppingSidebar. tor-browser#42831.
SpeechDispatcher: { parent: { @@ -2276,7 +2244,6 @@ BrowserGlue.prototype = { } }, () => lazy.RFPHelper.uninit(), - () => lazy.ShoppingUtils.uninit(), () => { if (AppConstants.MOZ_UPDATER) { lazy.UpdateListener.reset(); @@ -3234,13 +3201,6 @@ BrowserGlue.prototype = { }, },
- { - name: "ShoppingUtils.init", - task: () => { - lazy.ShoppingUtils.init(); - }, - }, - { // Starts the JSOracle process for ORB JavaScript validation, if it hasn't started already. name: "start-orb-javascript-oracle",
===================================== browser/components/about/AboutRedirector.cpp ===================================== @@ -96,12 +96,7 @@ static const RedirEntry kRedirMap[] = { {"sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml", nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT | nsIAboutModule::IS_SECURE_CHROME_UI}, - {"shoppingsidebar", "chrome://browser/content/shopping/shopping.html", - nsIAboutModule::URI_MUST_LOAD_IN_CHILD | - nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS | - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT | - nsIAboutModule::IS_SECURE_CHROME_UI}, + // Removed about:shoppingsidebar. tor-browser#42831. {"tabcrashed", "chrome://browser/content/aboutTabCrashed.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT},
===================================== browser/components/about/components.conf ===================================== @@ -24,7 +24,7 @@ pages = [ 'rights', 'sessionrestore', 'settings', - 'shoppingsidebar', + # Removed 'shoppingsidebar'. tor-browser#42831. 'tabcrashed', 'unloads', 'welcome',
===================================== browser/components/shopping/jar.mn ===================================== @@ -2,30 +2,4 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-browser.jar: - content/browser/shopping/onboarding.mjs (content/onboarding.mjs) - content/browser/shopping/shopping.html (content/shopping.html) - content/browser/shopping/shopping-container.css (content/shopping-container.css) - content/browser/shopping/shopping-page.css (content/shopping-page.css) - content/browser/shopping/shopping-sidebar.js (content/shopping-sidebar.js) - content/browser/shopping/shopping-message-bar.css (content/shopping-message-bar.css) - content/browser/shopping/shopping-message-bar.mjs (content/shopping-message-bar.mjs) - content/browser/shopping/highlights.mjs (content/highlights.mjs) - content/browser/shopping/highlight-item.css (content/highlight-item.css) - content/browser/shopping/highlight-item.mjs (content/highlight-item.mjs) - content/browser/shopping/shopping-card.css (content/shopping-card.css) - content/browser/shopping/shopping-card.mjs (content/shopping-card.mjs) - content/browser/shopping/letter-grade.css (content/letter-grade.css) - content/browser/shopping/letter-grade.mjs (content/letter-grade.mjs) - content/browser/shopping/settings.mjs (content/settings.mjs) - content/browser/shopping/settings.css (content/settings.css) - content/browser/shopping/shopping-container.mjs (content/shopping-container.mjs) - content/browser/shopping/adjusted-rating.mjs (content/adjusted-rating.mjs) - content/browser/shopping/reliability.mjs (content/reliability.mjs) - content/browser/shopping/analysis-explainer.css (content/analysis-explainer.css) - content/browser/shopping/analysis-explainer.mjs (content/analysis-explainer.mjs) - content/browser/shopping/unanalyzed.css (content/unanalyzed.css) - content/browser/shopping/unanalyzed.mjs (content/unanalyzed.mjs) - content/browser/shopping/recommended-ad.css (content/recommended-ad.css) - content/browser/shopping/recommended-ad.mjs (content/recommended-ad.mjs) - content/browser/shopping/assets/ (content/assets/*) +# Removed desktop shopping-sidebar content. tor-browser#42831.
===================================== browser/components/shopping/moz.build ===================================== @@ -6,14 +6,8 @@
JAR_MANIFESTS += ["jar.mn"]
-FINAL_TARGET_FILES.actors += [ - "ShoppingSidebarChild.sys.mjs", - "ShoppingSidebarParent.sys.mjs", -] - -EXTRA_JS_MODULES += [ - "ShoppingUtils.sys.mjs", -] +# Removed ShoppingSidebarParent, ShoppingSidebarChild and ShoppingUtils. +# tor-browser#42831.
BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.toml"]
===================================== toolkit/components/shopping/jar.mn ===================================== @@ -2,19 +2,4 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-toolkit.jar: - content/global/shopping/ProductConfig.mjs (content/ProductConfig.mjs) - content/global/shopping/ProductValidator.sys.mjs (content/ProductValidator.sys.mjs) - content/global/shopping/ShoppingProduct.mjs (content/ShoppingProduct.mjs) - content/global/shopping/analysis_response.schema.json (schemas/analysis_response.schema.json) - content/global/shopping/recommendations_response.schema.json (schemas/recommendations_response.schema.json) - content/global/shopping/analysis_request.schema.json (schemas/analysis_request.schema.json) - content/global/shopping/recommendations_request.schema.json (schemas/recommendations_request.schema.json) - content/global/shopping/attribution_response.schema.json (schemas/attribution_response.schema.json) - content/global/shopping/attribution_request.schema.json (schemas/attribution_request.schema.json) - content/global/shopping/reporting_response.schema.json (schemas/reporting_response.schema.json) - content/global/shopping/reporting_request.schema.json (schemas/reporting_request.schema.json) - content/global/shopping/analysis_status_request.schema.json (schemas/analysis_status_request.schema.json) - content/global/shopping/analysis_status_response.schema.json (schemas/analysis_status_response.schema.json) - content/global/shopping/analyze_request.schema.json (schemas/analyze_request.schema.json) - content/global/shopping/analyze_response.schema.json (schemas/analyze_response.schema.json) +# Removed ShoppingProduct modules and schema JSONs. tor-browser#42831.
===================================== toolkit/modules/RemotePageAccessManager.sys.mjs ===================================== @@ -216,21 +216,7 @@ export let RemotePageAccessManager = { ], RPMRecordTelemetryEvent: ["*"], }, - "about:shoppingsidebar": { - RPMSetPref: [ - "browser.shopping.experience2023.optedIn", - "browser.shopping.experience2023.active", - "browser.shopping.experience2023.ads.userEnabled", - "browser.shopping.experience2023.sidebarClosedCount", - "browser.shopping.experience2023.showKeepSidebarClosedMessage", - "browser.shopping.experience2023.autoOpen.userEnabled", - ], - RPMGetFormatURLPref: ["app.support.baseURL"], - RPMGetIntPref: ["browser.shopping.experience2023.sidebarClosedCount"], - RPMGetBoolPref: [ - "browser.shopping.experience2023.showKeepSidebarClosedMessage", - ], - }, + // Removed about:shoppingsidebar. tor-browser#42831. "about:tabcrashed": { RPMSendAsyncMessage: ["Load", "closeTab", "restoreTab", "restoreAll"], RPMAddMessageListener: ["*"],
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/ee9a...