Skip to content

Commit

Permalink
Bug 42831: Remove the shopping components.
Browse files Browse the repository at this point in the history
  • Loading branch information
henry-torproject authored and morganava committed Sep 18, 2024
1 parent 7414b29 commit ee9a53d
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 129 deletions.
2 changes: 0 additions & 2 deletions browser/base/content/browser-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,6 @@ var gBrowserInit = {

CaptivePortalWatcher.delayedStartup();

ShoppingSidebarManager.ensureInitialized();

SessionStore.promiseAllWindowsRestored.then(() => {
this._schedulePerWindowIdleTasks();
document.documentElement.setAttribute("sessionrestored", "true");
Expand Down
10 changes: 3 additions & 7 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 0 additions & 3 deletions browser/base/content/browser.js.globals
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
"E10SUtils",
"ExtensionsUI",
"HomePage",
"isProductURL",
"LightweightThemeConsumer",
"LoginHelper",
"LoginManagerParent",
Expand Down Expand Up @@ -161,8 +160,6 @@
"SearchUIUtils",
"SessionStartup",
"SessionStore",
"ShoppingSidebarParent",
"ShoppingSidebarManager",
"ShortcutUtils",
"SiteDataManager",
"SitePermissions",
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/browser.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions browser/base/content/navigator-toolbox.inc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
46 changes: 3 additions & 43 deletions browser/components/BrowserGlue.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -2276,7 +2244,6 @@ BrowserGlue.prototype = {
}
},
() => lazy.RFPHelper.uninit(),
() => lazy.ShoppingUtils.uninit(),
() => {
if (AppConstants.MOZ_UPDATER) {
lazy.UpdateListener.reset();
Expand Down Expand Up @@ -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",
Expand Down
7 changes: 1 addition & 6 deletions browser/components/about/AboutRedirector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion browser/components/about/components.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pages = [
'rights',
'sessionrestore',
'settings',
'shoppingsidebar',
# Removed 'shoppingsidebar'. tor-browser#42831.
'tabcrashed',
'unloads',
'welcome',
Expand Down
28 changes: 1 addition & 27 deletions browser/components/shopping/jar.mn
Original file line number Diff line number Diff line change
Expand Up @@ -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.
10 changes: 2 additions & 8 deletions browser/components/shopping/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
17 changes: 1 addition & 16 deletions toolkit/components/shopping/jar.mn
Original file line number Diff line number Diff line change
Expand Up @@ -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.
16 changes: 1 addition & 15 deletions toolkit/modules/RemotePageAccessManager.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: ["*"],
Expand Down

0 comments on commit ee9a53d

Please sign in to comment.