Backed out changeset e0746c635241 (bug 1637365) for browser_aboutwelcome_multistage.js failures CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Sat, 06 Jun 2020 03:37:11 +0300
changeset 534240 4ea35d706a6be6e403bfb06d4e1b5a1827110360
parent 534239 a6d6d50c239a52081f45ed4348868059f3bbe56c
child 534241 0f152045a4a04b7e37e89f6b57603108039e18eb
push id37484
push userdluca@mozilla.com
push dateSat, 06 Jun 2020 09:46:03 +0000
treeherdermozilla-central@6237102f005d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1637365
milestone79.0a1
backs oute0746c635241e67dec353f1b94fd35e62207c295
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset e0746c635241 (bug 1637365) for browser_aboutwelcome_multistage.js failures CLOSED TREE
browser/components/newtab/aboutwelcome/AboutWelcomeChild.jsm
browser/components/newtab/aboutwelcome/AboutWelcomeParent.jsm
browser/components/newtab/aboutwelcome/content/aboutwelcome.bundle.js
browser/components/newtab/aboutwelcome/content/aboutwelcome.css
browser/components/newtab/content-src/aboutwelcome/aboutwelcome.scss
browser/components/newtab/content-src/aboutwelcome/components/MultiStageAboutWelcome.jsx
browser/components/newtab/content-src/lib/aboutwelcome-utils.js
browser/components/newtab/lib/TippyTopProvider.jsm
browser/components/newtab/test/unit/lib/TippyTopProvider.test.js
browser/components/newtab/test/unit/unit-entry.js
--- a/browser/components/newtab/aboutwelcome/AboutWelcomeChild.jsm
+++ b/browser/components/newtab/aboutwelcome/AboutWelcomeChild.jsm
@@ -7,18 +7,16 @@
 const EXPORTED_SYMBOLS = ["AboutWelcomeChild"];
 
 const { XPCOMUtils } = ChromeUtils.import(
   "resource://gre/modules/XPCOMUtils.jsm"
 );
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   ExperimentAPI: "resource://messaging-system/experiments/ExperimentAPI.jsm",
-  shortURL: "resource://activity-stream/lib/ShortURL.jsm",
-  TippyTopProvider: "resource://activity-stream/lib/TippyTopProvider.jsm",
 });
 
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   const { Logger } = ChromeUtils.import(
     "resource://messaging-system/lib/Logger.jsm"
   );
   return new Logger("AboutWelcomeChild");
 });
@@ -37,45 +35,16 @@ XPCOMUtils.defineLazyPreferenceGetter(
   this,
   "multiStageAboutWelcomeContent",
   "browser.aboutwelcome.overrideContent",
   "",
   null,
   _parseOverrideContent
 );
 
-/**
- * Lazily get importable sites from parent or reuse cached ones.
- */
-function getImportableSites(child) {
-  return (
-    getImportableSites.cache ??
-    (getImportableSites.cache = (async () => {
-      // Use tippy top to get packaged rich icons
-      const tippyTop = new TippyTopProvider();
-      await tippyTop.init();
-
-      // Remove duplicate entries if they would appear the same
-      return `[${[
-        ...new Set(
-          (await child.sendQuery("AWPage:IMPORTABLE_SITES")).map(url => {
-            // Get both rich icon and short name and save for deduping
-            const site = { url };
-            tippyTop.processSite(site, "*");
-            return JSON.stringify({
-              icon: site.tippyTopIcon,
-              label: shortURL(site),
-            });
-          })
-        ),
-      ]}]`;
-    })())
-  );
-}
-
 class AboutWelcomeChild extends JSWindowActorChild {
   actorCreated() {
     this.exportFunctions();
     this.initWebProgressListener();
   }
 
   initWebProgressListener() {
     const webProgress = this.manager.browsingContext.top.docShell
@@ -128,36 +97,29 @@ class AboutWelcomeChild extends JSWindow
     Cu.exportFunction(this.AWGetMultiStageScreens.bind(this), window, {
       defineAs: "AWGetMultiStageScreens",
     });
 
     Cu.exportFunction(this.AWGetFxAMetricsFlowURI.bind(this), window, {
       defineAs: "AWGetFxAMetricsFlowURI",
     });
 
-    Cu.exportFunction(this.AWGetImportableSites.bind(this), window, {
-      defineAs: "AWGetImportableSites",
-    });
-
     Cu.exportFunction(this.AWSendEventTelemetry.bind(this), window, {
       defineAs: "AWSendEventTelemetry",
     });
 
     Cu.exportFunction(this.AWSendToParent.bind(this), window, {
       defineAs: "AWSendToParent",
     });
 
     Cu.exportFunction(this.AWWaitForMigrationClose.bind(this), window, {
       defineAs: "AWWaitForMigrationClose",
     });
   }
 
-  /**
-   * Wrap a promise so content can use Promise methods.
-   */
   wrapPromise(promise) {
     return new this.contentWindow.Promise((resolve, reject) =>
       promise.then(resolve, reject)
     );
   }
 
   /**
    * Send multistage welcome JSON data read from aboutwelcome.overrideConetent pref to page
@@ -193,20 +155,16 @@ class AboutWelcomeChild extends JSWindow
     }
     return Cu.cloneInto(experimentData || {}, this.contentWindow);
   }
 
   AWGetFxAMetricsFlowURI() {
     return this.wrapPromise(this.sendQuery("AWPage:FXA_METRICS_FLOW_URI"));
   }
 
-  AWGetImportableSites() {
-    return this.wrapPromise(getImportableSites(this));
-  }
-
   /**
    * Send Event Telemetry
    * @param {object} eventData
    */
   AWSendEventTelemetry(eventData) {
     this.AWSendToParent("TELEMETRY_EVENT", {
       ...eventData,
       event_context: {
--- a/browser/components/newtab/aboutwelcome/AboutWelcomeParent.jsm
+++ b/browser/components/newtab/aboutwelcome/AboutWelcomeParent.jsm
@@ -8,18 +8,16 @@ const EXPORTED_SYMBOLS = ["AboutWelcomeP
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const { XPCOMUtils } = ChromeUtils.import(
   "resource://gre/modules/XPCOMUtils.jsm"
 );
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   FxAccounts: "resource://gre/modules/FxAccounts.jsm",
-  MigrationUtils: "resource:///modules/MigrationUtils.jsm",
-  OS: "resource://gre/modules/osfile.jsm",
   SpecialMessageActions:
     "resource://messaging-system/lib/SpecialMessageActions.jsm",
   AboutWelcomeTelemetry:
     "resource://activity-stream/aboutwelcome/lib/AboutWelcomeTelemetry.jsm",
 });
 
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   const { Logger } = ChromeUtils.import(
@@ -38,57 +36,16 @@ const DID_SEE_ABOUT_WELCOME_PREF = "trai
 const AWTerminate = {
   UNKNOWN: "unknown",
   WINDOW_CLOSED: "welcome-window-closed",
   TAB_CLOSED: "welcome-tab-closed",
   APP_SHUT_DOWN: "app-shut-down",
   ADDRESS_BAR_NAVIGATED: "address-bar-navigated",
 };
 
-async function getImportableSites() {
-  const sites = [];
-
-  // Just handle these chromium-based browsers for now
-  for (const browserId of ["chrome", "chromium-edge", "chromium"]) {
-    // Skip if there's no profile data.
-    const migrator = await MigrationUtils.getMigrator(browserId);
-    if (!migrator) {
-      continue;
-    }
-
-    // Check each profile for top sites
-    const dataPath = await migrator.wrappedJSObject._getChromeUserDataPathIfExists();
-    for (const profile of await migrator.getSourceProfiles()) {
-      let path = OS.Path.join(dataPath, profile.id, "Top Sites");
-      // Skip if top sites data is missing
-      if (!(await OS.File.exists(path))) {
-        Cu.reportError(`Missing file at ${path}`);
-        continue;
-      }
-
-      try {
-        for (const row of await MigrationUtils.getRowsFromDBWithoutLocks(
-          path,
-          `Importable ${browserId} top sites`,
-          `SELECT url
-           FROM top_sites
-           ORDER BY url_rank`
-        )) {
-          sites.push(row.getString(0));
-        }
-      } catch (ex) {
-        Cu.reportError(
-          `Failed to get importable top sites from ${browserId} ${ex}`
-        );
-      }
-    }
-  }
-  return sites;
-}
-
 class AboutWelcomeObserver {
   constructor() {
     Services.obs.addObserver(this, "quit-application");
 
     this.win = Services.focus.activeWindow;
     if (!this.win) {
       return;
     }
@@ -173,18 +130,16 @@ class AboutWelcomeParent extends JSWindo
           log.debug(`Fails to set ${DID_SEE_ABOUT_WELCOME_PREF}.`);
         }
         break;
       case "AWPage:SPECIAL_ACTION":
         SpecialMessageActions.handleAction(data, browser);
         break;
       case "AWPage:FXA_METRICS_FLOW_URI":
         return FxAccounts.config.promiseMetricsFlowURI("aboutwelcome");
-      case "AWPage:IMPORTABLE_SITES":
-        return getImportableSites();
       case "AWPage:TELEMETRY_EVENT":
         Telemetry.sendTelemetry(data);
         break;
       case "AWPage:LOCATION_CHANGED":
         this.AboutWelcomeObserver.terminateReason =
           AWTerminate.ADDRESS_BAR_NAVIGATED;
         break;
       case "AWPage:WAIT_FOR_MIGRATION_CLOSE":
--- a/browser/components/newtab/aboutwelcome/content/aboutwelcome.bundle.js
+++ b/browser/components/newtab/aboutwelcome/content/aboutwelcome.bundle.js
@@ -273,19 +273,16 @@ module.exports = ReactDOM;
 /* harmony import */ var _asrouter_templates_FirstRun_addUtmParams__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 
 
 
-const DEFAULT_SITES = ["youtube-com", "facebook-com", "amazon", "reddit-com", "wikipedia-org", "twitter-com"].map(site => ({
-  icon: `resource://activity-stream/data/content/tippytop/images/${site}@2x.png`
-}));
 const MultiStageAboutWelcome = props => {
   const [index, setScreenIndex] = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(0);
   Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => {
     // Send impression ping when respective screen first renders
     props.screens.forEach(screen => {
       if (index === screen.order) {
         _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__["AboutWelcomeUtils"].sendImpressionTelemetry(`${props.message_id}_${screen.id}`);
       }
@@ -305,29 +302,17 @@ const MultiStageAboutWelcome = props => 
 
   const handleTransition = index < props.screens.length ? Object(react__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(() => setScreenIndex(prevState => prevState + 1), []) : _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__["AboutWelcomeUtils"].handleUserAction({
     type: "OPEN_ABOUT_PAGE",
     data: {
       args: "home",
       where: "current"
     }
   });
-  const useImportable = props.message_id.includes("IMPORTABLE");
-  const [topSites, setTopSites] = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(DEFAULT_SITES);
-  Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => {
-    (async () => {
-      const importable = JSON.parse((await window.AWGetImportableSites()));
-      const showImportable = useImportable && importable.length >= 5;
-      _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__["AboutWelcomeUtils"].sendImpressionTelemetry(`${props.message_id}_SITES`, {
-        display: showImportable ? "importable" : "static",
-        importable: importable.length
-      });
-      setTopSites(showImportable ? importable : DEFAULT_SITES);
-    })();
-  }, [useImportable]);
+  const [topSites] = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(["resource://activity-stream/data/content/tippytop/images/youtube-com@2x.png", "resource://activity-stream/data/content/tippytop/images/facebook-com@2x.png", "resource://activity-stream/data/content/tippytop/images/amazon@2x.png", "resource://activity-stream/data/content/tippytop/images/reddit-com@2x.png", "resource://activity-stream/data/content/tippytop/images/wikipedia-org@2x.png", "resource://activity-stream/data/content/tippytop/images/twitter-com@2x.png"]);
   return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
     className: `multistageContainer`
   }, props.screens.map(screen => {
     return index === screen.order ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WelcomeScreen, {
       id: screen.id,
       totalNumberOfScreens: props.screens.length,
       order: screen.order,
       content: screen.content,
@@ -412,31 +397,23 @@ class WelcomeScreen extends react__WEBPA
       value: "secondary_button",
       onClick: this.handleAction
     })));
   }
 
   renderTiles() {
     return this.props.content.tiles && this.props.topSites ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
       className: "tiles-section"
-    }, this.props.topSites.slice(0, 5).map(({
-      icon,
-      label
-    }) => react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
-      className: "site",
-      key: label
-    }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
+    }, this.props.topSites.slice(0, 5).map(icon => react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
       className: "icon",
-      style: icon ? {
-        backgroundColor: "transparent",
+      key: icon,
+      style: {
         backgroundImage: `url(${icon})`
-      } : {}
-    }, icon ? "" : label[0].toUpperCase()), label && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
-      className: "host"
-    }, label)))) : null;
+      }
+    }))) : null;
   }
 
   renderStepsIndicator() {
     let steps = [];
 
     for (let i = 0; i < this.props.totalNumberOfScreens; i++) {
       let className = i === this.props.order ? "current" : "";
       steps.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
@@ -544,20 +521,19 @@ const Localized = ({
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 const AboutWelcomeUtils = {
   handleUserAction(action) {
     window.AWSendToParent("SPECIAL_ACTION", action);
   },
 
-  sendImpressionTelemetry(messageId, context) {
+  sendImpressionTelemetry(messageId) {
     window.AWSendEventTelemetry({
       event: "IMPRESSION",
-      event_context: context,
       message_id: messageId
     });
   },
 
   sendActionTelemetry(messageId, elementId) {
     const ping = {
       event: "CLICK_BUTTON",
       event_context: {
--- a/browser/components/newtab/aboutwelcome/content/aboutwelcome.css
+++ b/browser/components/newtab/aboutwelcome/content/aboutwelcome.css
@@ -308,43 +308,22 @@ body {
   .multistageContainer .tiles-section {
     display: grid;
     grid-gap: 24px;
     grid-template-columns: repeat(5, auto);
     margin: 0 auto; }
     @media (max-width: 610px) {
       .multistageContainer .tiles-section {
         grid-template-columns: repeat(3, auto); } }
-    .multistageContainer .tiles-section .site {
-      width: 96px; }
     .multistageContainer .tiles-section .icon {
       background-size: cover;
       border-radius: 4px;
       box-shadow: var(--newtab-card-shadow);
-      color: rgba(255, 255, 255, 0.5);
-      font-size: 24px;
-      font-weight: bold;
       height: 96px;
-      line-height: 96px; }
-    .multistageContainer .tiles-section .host {
-      font-size: 12px;
-      line-height: 36px;
-      overflow: hidden;
-      text-overflow: ellipsis;
-      white-space: nowrap; }
-    .multistageContainer .tiles-section .site:nth-child(1) .icon {
-      background-color: #7542E5; }
-    .multistageContainer .tiles-section .site:nth-child(2) .icon {
-      background-color: #952BB9; }
-    .multistageContainer .tiles-section .site:nth-child(3) .icon {
-      background-color: #E31587; }
-    .multistageContainer .tiles-section .site:nth-child(4) .icon {
-      background-color: #E25920; }
-    .multistageContainer .tiles-section .site:nth-child(5) .icon {
-      background-color: #0250BB; }
+      width: 96px; }
   .multistageContainer button {
     font-family: inherit;
     cursor: pointer;
     border: 0; }
     .multistageContainer button.primary {
       font-size: 16px;
       margin-inline-start: 12px;
       margin: 26px 0 0;
--- a/browser/components/newtab/content-src/aboutwelcome/aboutwelcome.scss
+++ b/browser/components/newtab/content-src/aboutwelcome/aboutwelcome.scss
@@ -299,69 +299,33 @@ body {
       font-weight: normal;
       margin: 0 6px;
       color: var(--grey-subtitle-1);
       line-height: 28px;
     }
   }
 
   .tiles-section {
-    $host-size: 12px;
     $tile-size: 96px;
 
     display: grid;
-    grid-gap: $tile-size / 4;
+    grid-gap: 24px;
     grid-template-columns: repeat(5, auto);
     margin: 0 auto;
 
     @media (max-width: $break-point-medium) {
       grid-template-columns: repeat(3, auto);
     }
 
-    .site {
-      width: $tile-size;
-    }
-
     .icon {
       background-size: cover;
       border-radius: 4px;
       box-shadow: var(--newtab-card-shadow);
-      color: rgba(255, 255, 255, 0.5);
-      font-size: $host-size * 2;
-      font-weight: bold;
       height: $tile-size;
-      line-height: $tile-size;
-    }
-
-    .host {
-      font-size: $host-size;
-      line-height: $host-size * 3;
-      overflow: hidden;
-      text-overflow: ellipsis;
-      white-space: nowrap;
-    }
-
-    .site:nth-child(1) .icon {
-      background-color: #7542E5;
-    }
-
-    .site:nth-child(2) .icon {
-      background-color: #952BB9;
-    }
-
-    .site:nth-child(3) .icon {
-      background-color: #E31587;
-    }
-
-    .site:nth-child(4) .icon {
-      background-color: #E25920;
-    }
-
-    .site:nth-child(5) .icon {
-      background-color: #0250BB;
+      width: $tile-size;
     }
   }
 
   button {
     font-family: inherit;
     cursor: pointer;
     border: 0;
 
--- a/browser/components/newtab/content-src/aboutwelcome/components/MultiStageAboutWelcome.jsx
+++ b/browser/components/newtab/content-src/aboutwelcome/components/MultiStageAboutWelcome.jsx
@@ -2,27 +2,16 @@
  * 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/. */
 
 import React, { useState, useCallback, useEffect } from "react";
 import { Localized } from "./MSLocalized";
 import { AboutWelcomeUtils } from "../../lib/aboutwelcome-utils";
 import { addUtmParams } from "../../asrouter/templates/FirstRun/addUtmParams";
 
-const DEFAULT_SITES = [
-  "youtube-com",
-  "facebook-com",
-  "amazon",
-  "reddit-com",
-  "wikipedia-org",
-  "twitter-com",
-].map(site => ({
-  icon: `resource://activity-stream/data/content/tippytop/images/${site}@2x.png`,
-}));
-
 export const MultiStageAboutWelcome = props => {
   const [index, setScreenIndex] = useState(0);
   useEffect(() => {
     // Send impression ping when respective screen first renders
     props.screens.forEach(screen => {
       if (index === screen.order) {
         AboutWelcomeUtils.sendImpressionTelemetry(
           `${props.message_id}_${screen.id}`
@@ -45,29 +34,24 @@ export const MultiStageAboutWelcome = pr
   const handleTransition =
     index < props.screens.length
       ? useCallback(() => setScreenIndex(prevState => prevState + 1), [])
       : AboutWelcomeUtils.handleUserAction({
           type: "OPEN_ABOUT_PAGE",
           data: { args: "home", where: "current" },
         });
 
-  const useImportable = props.message_id.includes("IMPORTABLE");
-  const [topSites, setTopSites] = useState(DEFAULT_SITES);
-  useEffect(() => {
-    (async () => {
-      const importable = JSON.parse(await window.AWGetImportableSites());
-      const showImportable = useImportable && importable.length >= 5;
-      AboutWelcomeUtils.sendImpressionTelemetry(`${props.message_id}_SITES`, {
-        display: showImportable ? "importable" : "static",
-        importable: importable.length,
-      });
-      setTopSites(showImportable ? importable : DEFAULT_SITES);
-    })();
-  }, [useImportable]);
+  const [topSites] = useState([
+    "resource://activity-stream/data/content/tippytop/images/youtube-com@2x.png",
+    "resource://activity-stream/data/content/tippytop/images/facebook-com@2x.png",
+    "resource://activity-stream/data/content/tippytop/images/amazon@2x.png",
+    "resource://activity-stream/data/content/tippytop/images/reddit-com@2x.png",
+    "resource://activity-stream/data/content/tippytop/images/wikipedia-org@2x.png",
+    "resource://activity-stream/data/content/tippytop/images/twitter-com@2x.png",
+  ]);
 
   return (
     <React.Fragment>
       <div className={`multistageContainer`}>
         {props.screens.map(screen => {
           return index === screen.order ? (
             <WelcomeScreen
               id={screen.id}
@@ -150,33 +134,22 @@ export class WelcomeScreen extends React
         </Localized>
       </div>
     );
   }
 
   renderTiles() {
     return this.props.content.tiles && this.props.topSites ? (
       <div className="tiles-section">
-        {this.props.topSites.slice(0, 5).map(({ icon, label }) => (
-          <div className="site" key={label}>
-            <div
-              className="icon"
-              style={
-                icon
-                  ? {
-                      backgroundColor: "transparent",
-                      backgroundImage: `url(${icon})`,
-                    }
-                  : {}
-              }
-            >
-              {icon ? "" : label[0].toUpperCase()}
-            </div>
-            {label && <div className="host">{label}</div>}
-          </div>
+        {this.props.topSites.slice(0, 5).map(icon => (
+          <div
+            className="icon"
+            key={icon}
+            style={{ backgroundImage: `url(${icon})` }}
+          />
         ))}
       </div>
     ) : null;
   }
 
   renderStepsIndicator() {
     let steps = [];
     for (let i = 0; i < this.props.totalNumberOfScreens; i++) {
--- a/browser/components/newtab/content-src/lib/aboutwelcome-utils.js
+++ b/browser/components/newtab/content-src/lib/aboutwelcome-utils.js
@@ -1,20 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 export const AboutWelcomeUtils = {
   handleUserAction(action) {
     window.AWSendToParent("SPECIAL_ACTION", action);
   },
-  sendImpressionTelemetry(messageId, context) {
+  sendImpressionTelemetry(messageId) {
     window.AWSendEventTelemetry({
       event: "IMPRESSION",
-      event_context: context,
       message_id: messageId,
     });
   },
   sendActionTelemetry(messageId, elementId) {
     const ping = {
       event: "CLICK_BUTTON",
       event_context: {
         source: elementId,
--- a/browser/components/newtab/lib/TippyTopProvider.jsm
+++ b/browser/components/newtab/lib/TippyTopProvider.jsm
@@ -1,40 +1,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 const { XPCOMUtils } = ChromeUtils.import(
   "resource://gre/modules/XPCOMUtils.jsm"
 );
 
-XPCOMUtils.defineLazyModuleGetters(this, {
-  Services: "resource://gre/modules/Services.jsm",
-});
-
 XPCOMUtils.defineLazyGlobalGetters(this, ["fetch", "URL"]);
 
 const TIPPYTOP_PATH = "resource://activity-stream/data/content/tippytop/";
 const TIPPYTOP_JSON_PATH =
   "resource://activity-stream/data/content/tippytop/top_sites.json";
 
-/*
- * Get a domain from a url optionally stripping subdomains.
- */
-function getDomain(url, strip = "www.") {
-  let domain = "";
+function getDomain(url) {
+  let domain;
   try {
     domain = new URL(url).hostname;
   } catch (ex) {}
-  if (strip === "*") {
-    try {
-      domain = Services.eTLD.getBaseDomainFromHost(domain);
-    } catch (ex) {}
-  } else if (domain.startsWith(strip)) {
-    domain = domain.slice(strip.length);
+  if (domain && domain.startsWith("www.")) {
+    domain = domain.slice(4);
   }
   return domain;
 }
 
 this.TippyTopProvider = class TippyTopProvider {
   constructor() {
     this._sitesByDomain = new Map();
     this.initialized = false;
@@ -55,18 +44,18 @@ this.TippyTopProvider = class TippyTopPr
         }
       }
       this.initialized = true;
     } catch (error) {
       Cu.reportError("Failed to load tippy top manifest.");
     }
   }
 
-  processSite(site, strip) {
-    const tippyTop = this._sitesByDomain.get(getDomain(site.url, strip));
+  processSite(site) {
+    const tippyTop = this._sitesByDomain.get(getDomain(site.url));
     if (tippyTop) {
       site.tippyTopIcon = TIPPYTOP_PATH + tippyTop.image_url;
       site.smallFavicon = TIPPYTOP_PATH + tippyTop.favicon_url;
       site.backgroundColor = tippyTop.background_color;
     }
     return site;
   }
 };
--- a/browser/components/newtab/test/unit/lib/TippyTopProvider.test.js
+++ b/browser/components/newtab/test/unit/lib/TippyTopProvider.test.js
@@ -53,30 +53,16 @@ describe("TippyTopProvider", () => {
       "resource://activity-stream/data/content/tippytop/images/facebook-com.png"
     );
     assert.equal(
       site.smallFavicon,
       "resource://activity-stream/data/content/tippytop/images/facebook-com.png"
     );
     assert.equal(site.backgroundColor, "#3b5998");
   });
-  it("should not provide an icon for other.facebook.com", () => {
-    const site = instance.processSite({ url: "https://other.facebook.com" });
-    assert.isUndefined(site.tippyTopIcon);
-  });
-  it("should provide an icon for other.facebook.com with stripping", () => {
-    const site = instance.processSite(
-      { url: "https://other.facebook.com" },
-      "*"
-    );
-    assert.equal(
-      site.tippyTopIcon,
-      "resource://activity-stream/data/content/tippytop/images/facebook-com.png"
-    );
-  });
   it("should provide an icon for facebook.com/foobar", () => {
     const site = instance.processSite({ url: "https://facebook.com/foobar" });
     assert.equal(
       site.tippyTopIcon,
       "resource://activity-stream/data/content/tippytop/images/facebook-com.png"
     );
     assert.equal(
       site.smallFavicon,
--- a/browser/components/newtab/test/unit/unit-entry.js
+++ b/browser/components/newtab/test/unit/unit-entry.js
@@ -290,19 +290,16 @@ const TEST_GLOBAL = {
     tm: {
       dispatchToMainThread: cb => cb(),
       idleDispatchToMainThread: cb => cb(),
     },
     eTLD: {
       getBaseDomain({ spec }) {
         return spec.match(/\/([^/]+)/)[1];
       },
-      getBaseDomainFromHost(host) {
-        return host.match(/.*?(\w+\.\w+)$/)[1];
-      },
       getPublicSuffix() {},
     },
     io: {
       newURI: spec => ({
         mutate: () => ({
           setRef: ref => ({
             finalize: () => ({
               ref,