Bug 1654293 - Remove URL matching from Top Site attribution request. r=mikedeboer

Differential Revision: https://phabricator.services.mozilla.com/D84365
This commit is contained in:
Dão Gottwald 2020-07-21 15:16:05 +00:00
parent 04e1282606
commit 1e00a1d634
4 changed files with 2 additions and 14 deletions

View File

@ -376,7 +376,6 @@ export class TopSite extends React.PureComponent {
type: at.TOP_SITES_ATTRIBUTION,
data: {
searchProvider: this.props.link.hostname,
siteURL: this.props.link.url,
source: "newtab",
},
})

View File

@ -10327,7 +10327,6 @@ class TopSite extends react__WEBPACK_IMPORTED_MODULE_4___default.a.PureComponent
type: common_Actions_jsm__WEBPACK_IMPORTED_MODULE_0__["actionTypes"].TOP_SITES_ATTRIBUTION,
data: {
searchProvider: this.props.link.hostname,
siteURL: this.props.link.url,
source: "newtab"
}
}));

View File

@ -589,7 +589,6 @@ class UrlbarInput {
searchProvider: result.payload.url.match(
/^https?:\/\/(?:www.)?([^.]*)/
)[1],
siteURL: result.payload.url,
source: "urlbar",
});
}

View File

@ -21,7 +21,7 @@ ChromeUtils.defineModuleGetter(
);
var TopSiteAttribution = {
async makeRequest({ searchProvider, siteURL, source }) {
async makeRequest({ searchProvider, source }) {
function record(objectString, value = "") {
recordTelemetryEvent("search_override_exp", objectString, value, {
searchProvider,
@ -42,16 +42,7 @@ var TopSiteAttribution = {
request.headers.set("X-Region", Region.home);
request.headers.set("X-Source", source);
const response = await fetch(request);
if (response.ok) {
if (siteURL == response.responseText) {
record("attribution", "success");
} else {
record("attribution", "url_mismatch");
}
} else {
record("attribution", "failure");
}
record("attribution", response.ok ? "success" : "failure");
},
};