diff options
author | New Tobin Paradigm <email@mattatobin.com> | 2019-05-25 18:31:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-25 18:31:02 -0400 |
commit | 63d67703534b8af4b15d9fa53b3a19c6df17b263 (patch) | |
tree | 970ccd2c2cb3a6ef0a3e869b8eff06009bf39899 /application/basilisk/base/content/newtab/page.js | |
parent | 104cd501aa42ccb1839be5c5b8338c83dacd97c6 (diff) | |
parent | 97477c1e96fded7c40534afa3ad0bfc3980658e3 (diff) | |
download | UXP-63d67703534b8af4b15d9fa53b3a19c6df17b263.tar UXP-63d67703534b8af4b15d9fa53b3a19c6df17b263.tar.gz UXP-63d67703534b8af4b15d9fa53b3a19c6df17b263.tar.lz UXP-63d67703534b8af4b15d9fa53b3a19c6df17b263.tar.xz UXP-63d67703534b8af4b15d9fa53b3a19c6df17b263.zip |
Merge pull request #1122 from adeshkp/remove-newtab-basilisk
Remove code for sponsored "enhanced" tiles in NewTab page
Diffstat (limited to 'application/basilisk/base/content/newtab/page.js')
-rw-r--r-- | application/basilisk/base/content/newtab/page.js | 61 |
1 files changed, 2 insertions, 59 deletions
diff --git a/application/basilisk/base/content/newtab/page.js b/application/basilisk/base/content/newtab/page.js index f7626ced2..7c19a9827 100644 --- a/application/basilisk/base/content/newtab/page.js +++ b/application/basilisk/base/content/newtab/page.js @@ -48,11 +48,6 @@ var gPage = { let enabled = gAllPages.enabled; this._updateAttributes(enabled); - // Update thumbnails to the new enhanced setting - if (aData == "browser.newtabpage.enhanced") { - this.update(); - } - // Initialize the whole page if we haven't done that, yet. if (enabled) { this._init(); @@ -79,10 +74,7 @@ var gPage = { update(reason = "") { // Update immediately if we're visible. if (!document.hidden) { - // Ignore updates where reason=links-changed as those signal that the - // provider's set of links changed. We don't want to update visible pages - // in that case, it is ok to wait until the user opens the next tab. - if (reason != "links-changed" && gGrid.ready) { + if (gGrid.ready) { gGrid.refresh(); } @@ -119,10 +111,6 @@ var gPage = { document.getElementById("newtab-search-submit").value = document.body.getAttribute("dir") == "ltr" ? "\u25B6" : "\u25C0"; - if (Services.prefs.getBoolPref("browser.newtabpage.compact")) { - document.body.classList.add("compact"); - } - // Initialize search. gSearch.init(); @@ -174,16 +162,6 @@ var gPage = { */ _handleUnloadEvent: function Page_handleUnloadEvent() { gAllPages.unregister(this); - // compute page life-span and send telemetry probe: using milli-seconds will leave - // many low buckets empty. Instead we use half-second precision to make low end - // of histogram linear and not lose the change in user attention - let delta = Math.round((Date.now() - this._firstVisibleTime) / 500); - if (this._suggestedTilePresent) { - Services.telemetry.getHistogramById("NEWTAB_PAGE_LIFE_SPAN_SUGGESTED").add(delta); - } - else { - Services.telemetry.getHistogramById("NEWTAB_PAGE_LIFE_SPAN").add(delta); - } }, /** @@ -258,40 +236,5 @@ var gPage = { }, onPageVisibleAndLoaded() { - // Send the index of the last visible tile. - this.reportLastVisibleTileIndex(); - // Maybe tell the user they can undo an initial automigration - this.maybeShowAutoMigrationUndoNotification(); - }, - - reportLastVisibleTileIndex() { - let cwu = window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils); - - let rect = cwu.getBoundsWithoutFlushing(gGrid.node); - let nodes = cwu.nodesFromRect(rect.left, rect.top, 0, rect.width, - rect.height, 0, true, false); - - let i = -1; - let lastIndex = -1; - let sites = gGrid.sites; - - for (let node of nodes) { - if (node.classList && node.classList.contains("newtab-cell")) { - if (sites[++i]) { - lastIndex = i; - if (sites[i].link.targetedSite) { - // record that suggested tile is shown to use suggested-tiles-histogram - this._suggestedTilePresent = true; - } - } - } - } - - DirectoryLinksProvider.reportSitesAction(sites, "view", lastIndex); - }, - - maybeShowAutoMigrationUndoNotification() { - sendAsyncMessage("NewTab:MaybeShowAutoMigrationUndoNotification"); - }, + } }; |