tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit cd7482e4abb9eee6b1af21b422a8ed4f43edcf90
parent 62ce647fff1bead097d8f508383c4532974ec0ca
Author: Nina Pypchenko <npypchenko@mozilla.com>
Date:   Tue,  4 Nov 2025 20:47:39 +0000

Bug 1966241 - Remove Fakespot experiment code r=home-newtab-reviewers,toolkit-telemetry-reviewers,reemhamz

- Removed the last few traces of Fakespot-related code, including a couple of metrics we no longer need.

Differential Revision: https://phabricator.services.mozilla.com/D270976

Diffstat:
Mbrowser/components/newtab/metrics.yaml | 28----------------------------
Mbrowser/extensions/newtab/common/Actions.mjs | 1-
Mbrowser/extensions/newtab/content-src/components/DiscoveryStreamComponents/DSCard/DSCard.jsx | 280++++++++++++++++++++++++++++++++++++-------------------------------------------
Mbrowser/extensions/newtab/data/content/activity-stream.bundle.js | 147++++++++++++++++++++++++++++++++++---------------------------------------------
Mtoolkit/components/telemetry/Events.yaml | 2--
5 files changed, 191 insertions(+), 267 deletions(-)

diff --git a/browser/components/newtab/metrics.yaml b/browser/components/newtab/metrics.yaml @@ -3324,34 +3324,6 @@ activity_stream: extra_keys: *activity_stream_event_extra telemetry_mirror: Activity_stream_Event_PocketThumbsUp - event_fakespot_click: - type: event - description: > - This is recorded with every user interaction on Activity Stream - elements. - This event was generated to correspond to the Legacy Telemetry event - activity_stream.event#FAKESPOT_CLICK. - bugs: *activity_stream_event_bugs - data_reviews: *activity_stream_event_data_reviews - notification_emails: *activity_stream_event_emails - expires: never - extra_keys: *activity_stream_event_extra - telemetry_mirror: Activity_stream_Event_FakespotClick - - event_fakespot_category: - type: event - description: > - This is recorded with every user interaction on Activity Stream - elements. - This event was generated to correspond to the Legacy Telemetry event - activity_stream.event#FAKESPOT_CATEGORY. - bugs: *activity_stream_event_bugs - data_reviews: *activity_stream_event_data_reviews - notification_emails: *activity_stream_event_emails - expires: never - extra_keys: *activity_stream_event_extra - telemetry_mirror: Activity_stream_Event_FakespotCategory - event_pref_changed: type: event description: > diff --git a/browser/extensions/newtab/common/Actions.mjs b/browser/extensions/newtab/common/Actions.mjs @@ -115,7 +115,6 @@ for (const type of [ "NEW_TAB_STATE_REQUEST_STARTUPCACHE", "NEW_TAB_STATE_REQUEST_WITHOUT_STARTUPCACHE", "NEW_TAB_UNLOAD", - "OPEN_ABOUT_FAKESPOT", "OPEN_DOWNLOAD_FILE", "OPEN_LINK", "OPEN_NEW_WINDOW", diff --git a/browser/extensions/newtab/content-src/components/DiscoveryStreamComponents/DSCard/DSCard.jsx b/browser/extensions/newtab/content-src/components/DiscoveryStreamComponents/DSCard/DSCard.jsx @@ -331,39 +331,67 @@ export class _DSCard extends React.PureComponent { onLinkClick() { const matchesSelectedTopic = this.doesLinkTopicMatchSelectedTopic(); if (this.props.dispatch) { - if (this.props.isFakespot) { - this.props.dispatch( - ac.DiscoveryStreamUserEvent({ - event: "FAKESPOT_CLICK", - value: { - product_id: this.props.id, - category: this.props.category || "", - }, - }) - ); - } else { - this.props.dispatch( - ac.DiscoveryStreamUserEvent({ - event: "CLICK", - source: this.props.type.toUpperCase(), - action_position: this.props.pos, - value: { - event_source: "card", - card_type: this.props.flightId ? "spoc" : "organic", - recommendation_id: this.props.recommendation_id, - tile_id: this.props.id, + this.props.dispatch( + ac.DiscoveryStreamUserEvent({ + event: "CLICK", + source: this.props.type.toUpperCase(), + action_position: this.props.pos, + value: { + event_source: "card", + card_type: this.props.flightId ? "spoc" : "organic", + recommendation_id: this.props.recommendation_id, + tile_id: this.props.id, + ...(this.props.shim && this.props.shim.click + ? { shim: this.props.shim.click } + : {}), + fetchTimestamp: this.props.fetchTimestamp, + firstVisibleTimestamp: this.props.firstVisibleTimestamp, + corpus_item_id: this.props.corpus_item_id, + scheduled_corpus_item_id: this.props.scheduled_corpus_item_id, + recommended_at: this.props.recommended_at, + received_rank: this.props.received_rank, + topic: this.props.topic, + features: this.props.features, + matches_selected_topic: matchesSelectedTopic, + selected_topics: this.props.selectedTopics, + ...(this.props.format + ? { format: this.props.format } + : { + format: getActiveCardSize( + window.innerWidth, + this.props.sectionsClassNames, + this.props.section, + this.props.flightId + ), + }), + ...(this.props.section + ? { + section: this.props.section, + section_position: this.props.sectionPosition, + is_section_followed: this.props.sectionFollowed, + layout_name: this.props.sectionLayoutName, + } + : {}), + }, + }) + ); + + this.props.dispatch( + ac.ImpressionStats({ + source: this.props.type.toUpperCase(), + click: 0, + window_inner_width: this.props.windowObj.innerWidth, + window_inner_height: this.props.windowObj.innerHeight, + tiles: [ + { + id: this.props.id, + pos: this.props.pos, ...(this.props.shim && this.props.shim.click ? { shim: this.props.shim.click } : {}), - fetchTimestamp: this.props.fetchTimestamp, - firstVisibleTimestamp: this.props.firstVisibleTimestamp, - corpus_item_id: this.props.corpus_item_id, - scheduled_corpus_item_id: this.props.scheduled_corpus_item_id, - recommended_at: this.props.recommended_at, - received_rank: this.props.received_rank, + type: this.props.flightId ? "spoc" : "organic", + recommendation_id: this.props.recommendation_id, topic: this.props.topic, - features: this.props.features, - matches_selected_topic: matchesSelectedTopic, selected_topics: this.props.selectedTopics, ...(this.props.format ? { format: this.props.format } @@ -380,52 +408,12 @@ export class _DSCard extends React.PureComponent { section: this.props.section, section_position: this.props.sectionPosition, is_section_followed: this.props.sectionFollowed, - layout_name: this.props.sectionLayoutName, } : {}), }, - }) - ); - - this.props.dispatch( - ac.ImpressionStats({ - source: this.props.type.toUpperCase(), - click: 0, - window_inner_width: this.props.windowObj.innerWidth, - window_inner_height: this.props.windowObj.innerHeight, - tiles: [ - { - id: this.props.id, - pos: this.props.pos, - ...(this.props.shim && this.props.shim.click - ? { shim: this.props.shim.click } - : {}), - type: this.props.flightId ? "spoc" : "organic", - recommendation_id: this.props.recommendation_id, - topic: this.props.topic, - selected_topics: this.props.selectedTopics, - ...(this.props.format - ? { format: this.props.format } - : { - format: getActiveCardSize( - window.innerWidth, - this.props.sectionsClassNames, - this.props.section, - this.props.flightId - ), - }), - ...(this.props.section - ? { - section: this.props.section, - section_position: this.props.sectionPosition, - is_section_followed: this.props.sectionFollowed, - } - : {}), - }, - ], - }) - ); - } + ], + }) + ); } } @@ -769,7 +757,6 @@ export class _DSCard extends React.PureComponent { isRecentSave, DiscoveryStream, Prefs, - isFakespot, mayHaveSectionsCards, format, } = this.props; @@ -934,7 +921,6 @@ export class _DSCard extends React.PureComponent { }, ]} dispatch={this.props.dispatch} - isFakespot={isFakespot} source={this.props.type} firstVisibleTimestamp={this.props.firstVisibleTimestamp} /> @@ -942,90 +928,78 @@ export class _DSCard extends React.PureComponent { {ctaButtonVariant === "variant-b" && ( <div className="cta-header">Shop Now</div> )} - {isFakespot ? ( - <div className="meta"> - <div className="info-wrap"> - <h3 className="title clamp">{this.props.title}</h3> - </div> - </div> - ) : ( - <DefaultMeta - source={source} - title={this.props.title} - excerpt={excerpt} - newSponsoredLabel={newSponsoredLabel} - timeToRead={timeToRead} - context={this.props.context} - context_type={this.props.context_type} - sponsor={this.props.sponsor} - sponsored_by_override={this.props.sponsored_by_override} - ctaButtonVariant={ctaButtonVariant} + <DefaultMeta + source={source} + title={this.props.title} + excerpt={excerpt} + newSponsoredLabel={newSponsoredLabel} + timeToRead={timeToRead} + context={this.props.context} + context_type={this.props.context_type} + sponsor={this.props.sponsor} + sponsored_by_override={this.props.sponsored_by_override} + ctaButtonVariant={ctaButtonVariant} + dispatch={this.props.dispatch} + mayHaveThumbsUpDown={this.props.mayHaveThumbsUpDown} + mayHaveSectionsCards={this.props.mayHaveSectionsCards} + onThumbsUpClick={this.onThumbsUpClick} + onThumbsDownClick={this.onThumbsDownClick} + state={this.state} + showTopics={!refinedCardsLayout && this.props.showTopics} + isSectionsCard={this.props.mayHaveSectionsCards && this.props.topic} + format={format} + topic={this.props.topic} + icon_src={faviconSrc} + refinedCardsLayout={refinedCardsLayout} + tabIndex={this.props.tabIndex} + /> + </SafeAnchor> + <div className="card-stp-button-hover-background"> + <div className="card-stp-button-position-wrapper"> + <DSLinkMenu + id={this.props.id} + index={this.props.pos} dispatch={this.props.dispatch} - mayHaveThumbsUpDown={this.props.mayHaveThumbsUpDown} - mayHaveSectionsCards={this.props.mayHaveSectionsCards} - onThumbsUpClick={this.onThumbsUpClick} - onThumbsDownClick={this.onThumbsDownClick} - state={this.state} - showTopics={!refinedCardsLayout && this.props.showTopics} - isSectionsCard={ - this.props.mayHaveSectionsCards && this.props.topic + url={this.props.url} + title={this.props.title} + source={source} + type={this.props.type} + card_type={this.props.flightId ? "spoc" : "organic"} + pocket_id={this.props.pocket_id} + shim={this.props.shim} + bookmarkGuid={this.props.bookmarkGuid} + flightId={this.props.flightId} + showPrivacyInfo={!!this.props.flightId} + onMenuUpdate={this.onMenuUpdate} + onMenuShow={this.onMenuShow} + isRecentSave={isRecentSave} + recommendation_id={this.props.recommendation_id} + tile_id={this.props.id} + block_key={this.props.id} + corpus_item_id={this.props.corpus_item_id} + scheduled_corpus_item_id={this.props.scheduled_corpus_item_id} + recommended_at={this.props.recommended_at} + received_rank={this.props.received_rank} + section={this.props.section} + section_position={this.props.sectionPosition} + is_section_followed={this.props.sectionFollowed} + fetchTimestamp={this.props.fetchTimestamp} + firstVisibleTimestamp={this.props.firstVisibleTimestamp} + format={ + format + ? format + : getActiveCardSize( + window.innerWidth, + this.props.sectionsClassNames, + this.props.section, + this.props.flightId + ) } - format={format} + isSectionsCard={this.props.mayHaveSectionsCards} topic={this.props.topic} - icon_src={faviconSrc} - refinedCardsLayout={refinedCardsLayout} + selected_topics={this.props.selected_topics} tabIndex={this.props.tabIndex} /> - )} - </SafeAnchor> - <div className="card-stp-button-hover-background"> - <div className="card-stp-button-position-wrapper"> - {!isFakespot && ( - <DSLinkMenu - id={this.props.id} - index={this.props.pos} - dispatch={this.props.dispatch} - url={this.props.url} - title={this.props.title} - source={source} - type={this.props.type} - card_type={this.props.flightId ? "spoc" : "organic"} - pocket_id={this.props.pocket_id} - shim={this.props.shim} - bookmarkGuid={this.props.bookmarkGuid} - flightId={this.props.flightId} - showPrivacyInfo={!!this.props.flightId} - onMenuUpdate={this.onMenuUpdate} - onMenuShow={this.onMenuShow} - isRecentSave={isRecentSave} - recommendation_id={this.props.recommendation_id} - tile_id={this.props.id} - block_key={this.props.id} - corpus_item_id={this.props.corpus_item_id} - scheduled_corpus_item_id={this.props.scheduled_corpus_item_id} - recommended_at={this.props.recommended_at} - received_rank={this.props.received_rank} - section={this.props.section} - section_position={this.props.sectionPosition} - is_section_followed={this.props.sectionFollowed} - fetchTimestamp={this.props.fetchTimestamp} - firstVisibleTimestamp={this.props.firstVisibleTimestamp} - format={ - format - ? format - : getActiveCardSize( - window.innerWidth, - this.props.sectionsClassNames, - this.props.section, - this.props.flightId - ) - } - isSectionsCard={this.props.mayHaveSectionsCards} - topic={this.props.topic} - selected_topics={this.props.selected_topics} - tabIndex={this.props.tabIndex} - /> - )} </div> </div> </article> diff --git a/browser/extensions/newtab/data/content/activity-stream.bundle.js b/browser/extensions/newtab/data/content/activity-stream.bundle.js @@ -188,7 +188,6 @@ for (const type of [ "NEW_TAB_STATE_REQUEST_STARTUPCACHE", "NEW_TAB_STATE_REQUEST_WITHOUT_STARTUPCACHE", "NEW_TAB_UNLOAD", - "OPEN_ABOUT_FAKESPOT", "OPEN_DOWNLOAD_FILE", "OPEN_LINK", "OPEN_NEW_WINDOW", @@ -3708,78 +3707,68 @@ class _DSCard extends (external_React_default()).PureComponent { onLinkClick() { const matchesSelectedTopic = this.doesLinkTopicMatchSelectedTopic(); if (this.props.dispatch) { - if (this.props.isFakespot) { - this.props.dispatch(actionCreators.DiscoveryStreamUserEvent({ - event: "FAKESPOT_CLICK", - value: { - product_id: this.props.id, - category: this.props.category || "" - } - })); - } else { - this.props.dispatch(actionCreators.DiscoveryStreamUserEvent({ - event: "CLICK", - source: this.props.type.toUpperCase(), - action_position: this.props.pos, - value: { - event_source: "card", - card_type: this.props.flightId ? "spoc" : "organic", - recommendation_id: this.props.recommendation_id, - tile_id: this.props.id, - ...(this.props.shim && this.props.shim.click ? { - shim: this.props.shim.click - } : {}), - fetchTimestamp: this.props.fetchTimestamp, - firstVisibleTimestamp: this.props.firstVisibleTimestamp, - corpus_item_id: this.props.corpus_item_id, - scheduled_corpus_item_id: this.props.scheduled_corpus_item_id, - recommended_at: this.props.recommended_at, - received_rank: this.props.received_rank, - topic: this.props.topic, - features: this.props.features, - matches_selected_topic: matchesSelectedTopic, - selected_topics: this.props.selectedTopics, - ...(this.props.format ? { - format: this.props.format - } : { - format: getActiveCardSize(window.innerWidth, this.props.sectionsClassNames, this.props.section, this.props.flightId) - }), - ...(this.props.section ? { - section: this.props.section, - section_position: this.props.sectionPosition, - is_section_followed: this.props.sectionFollowed, - layout_name: this.props.sectionLayoutName - } : {}) - } - })); - this.props.dispatch(actionCreators.ImpressionStats({ - source: this.props.type.toUpperCase(), - click: 0, - window_inner_width: this.props.windowObj.innerWidth, - window_inner_height: this.props.windowObj.innerHeight, - tiles: [{ - id: this.props.id, - pos: this.props.pos, - ...(this.props.shim && this.props.shim.click ? { - shim: this.props.shim.click - } : {}), - type: this.props.flightId ? "spoc" : "organic", - recommendation_id: this.props.recommendation_id, - topic: this.props.topic, - selected_topics: this.props.selectedTopics, - ...(this.props.format ? { - format: this.props.format - } : { - format: getActiveCardSize(window.innerWidth, this.props.sectionsClassNames, this.props.section, this.props.flightId) - }), - ...(this.props.section ? { - section: this.props.section, - section_position: this.props.sectionPosition, - is_section_followed: this.props.sectionFollowed - } : {}) - }] - })); - } + this.props.dispatch(actionCreators.DiscoveryStreamUserEvent({ + event: "CLICK", + source: this.props.type.toUpperCase(), + action_position: this.props.pos, + value: { + event_source: "card", + card_type: this.props.flightId ? "spoc" : "organic", + recommendation_id: this.props.recommendation_id, + tile_id: this.props.id, + ...(this.props.shim && this.props.shim.click ? { + shim: this.props.shim.click + } : {}), + fetchTimestamp: this.props.fetchTimestamp, + firstVisibleTimestamp: this.props.firstVisibleTimestamp, + corpus_item_id: this.props.corpus_item_id, + scheduled_corpus_item_id: this.props.scheduled_corpus_item_id, + recommended_at: this.props.recommended_at, + received_rank: this.props.received_rank, + topic: this.props.topic, + features: this.props.features, + matches_selected_topic: matchesSelectedTopic, + selected_topics: this.props.selectedTopics, + ...(this.props.format ? { + format: this.props.format + } : { + format: getActiveCardSize(window.innerWidth, this.props.sectionsClassNames, this.props.section, this.props.flightId) + }), + ...(this.props.section ? { + section: this.props.section, + section_position: this.props.sectionPosition, + is_section_followed: this.props.sectionFollowed, + layout_name: this.props.sectionLayoutName + } : {}) + } + })); + this.props.dispatch(actionCreators.ImpressionStats({ + source: this.props.type.toUpperCase(), + click: 0, + window_inner_width: this.props.windowObj.innerWidth, + window_inner_height: this.props.windowObj.innerHeight, + tiles: [{ + id: this.props.id, + pos: this.props.pos, + ...(this.props.shim && this.props.shim.click ? { + shim: this.props.shim.click + } : {}), + type: this.props.flightId ? "spoc" : "organic", + recommendation_id: this.props.recommendation_id, + topic: this.props.topic, + selected_topics: this.props.selectedTopics, + ...(this.props.format ? { + format: this.props.format + } : { + format: getActiveCardSize(window.innerWidth, this.props.sectionsClassNames, this.props.section, this.props.flightId) + }), + ...(this.props.section ? { + section: this.props.section, + section_position: this.props.sectionPosition, + is_section_followed: this.props.sectionFollowed + } : {}) + }] + })); } } onThumbsUpClick(event) { @@ -4067,7 +4056,6 @@ class _DSCard extends (external_React_default()).PureComponent { isRecentSave, DiscoveryStream, Prefs, - isFakespot, mayHaveSectionsCards, format } = this.props; @@ -4199,18 +4187,11 @@ class _DSCard extends (external_React_default()).PureComponent { } : {}) }], dispatch: this.props.dispatch, - isFakespot: isFakespot, source: this.props.type, firstVisibleTimestamp: this.props.firstVisibleTimestamp }), ctaButtonVariant === "variant-b" && /*#__PURE__*/external_React_default().createElement("div", { className: "cta-header" - }, "Shop Now"), isFakespot ? /*#__PURE__*/external_React_default().createElement("div", { - className: "meta" - }, /*#__PURE__*/external_React_default().createElement("div", { - className: "info-wrap" - }, /*#__PURE__*/external_React_default().createElement("h3", { - className: "title clamp" - }, this.props.title))) : /*#__PURE__*/external_React_default().createElement(DefaultMeta, { + }, "Shop Now"), /*#__PURE__*/external_React_default().createElement(DefaultMeta, { source: source, title: this.props.title, excerpt: excerpt, @@ -4238,7 +4219,7 @@ class _DSCard extends (external_React_default()).PureComponent { className: "card-stp-button-hover-background" }, /*#__PURE__*/external_React_default().createElement("div", { className: "card-stp-button-position-wrapper" - }, !isFakespot && /*#__PURE__*/external_React_default().createElement(DSLinkMenu, { + }, /*#__PURE__*/external_React_default().createElement(DSLinkMenu, { id: this.props.id, index: this.props.pos, dispatch: this.props.dispatch, diff --git a/toolkit/components/telemetry/Events.yaml b/toolkit/components/telemetry/Events.yaml @@ -46,8 +46,6 @@ activity_stream: "DRAG", "DROP", "IMPRESSION", - "FAKESPOT_CATEGORY", - "FAKESPOT_CLICK", "MIGRATION_CANCEL", "MIGRATION_START", "OPEN_NEWTAB_PREFS",