зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1572825 - Add telemetry for tracker "Learn More" links. r=johannh
Differential Revision: https://phabricator.services.mozilla.com/D41977 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
f568195330
Коммит
34b2328e68
|
@ -58,10 +58,9 @@ document.addEventListener("DOMContentLoaded", e => {
|
|||
legend.style.gridTemplateAreas =
|
||||
"'social cookie tracker fingerprinter cryptominer'";
|
||||
|
||||
document.sendTelemetryEvent = (action, object) => {
|
||||
document.sendTelemetryEvent = (action, object, value = "") => {
|
||||
// eslint-disable-next-line no-undef
|
||||
// eslint-disable-next-line no-undef
|
||||
RPMRecordTelemetryEvent("security.ui.protections", action, object, "", {
|
||||
RPMRecordTelemetryEvent("security.ui.protections", action, object, value, {
|
||||
category: cbCategory,
|
||||
});
|
||||
};
|
||||
|
@ -199,6 +198,9 @@ document.addEventListener("DOMContentLoaded", e => {
|
|||
learnMoreLink.href = RPMGetFormatURLPref(
|
||||
`browser.contentblocking.report.${type}.url`
|
||||
);
|
||||
learnMoreLink.addEventListener("click", () => {
|
||||
document.sendTelemetryEvent("click", "trackers_about_link", type);
|
||||
});
|
||||
}
|
||||
|
||||
// Hide the trackers tab if the user is in standard and
|
||||
|
|
|
@ -16,6 +16,11 @@ add_task(async function setup() {
|
|||
["browser.contentblocking.report.monitor.url", ""],
|
||||
["browser.contentblocking.report.monitor.sign_in_url", ""],
|
||||
["browser.contentblocking.report.lockwise.url", ""],
|
||||
["browser.contentblocking.report.social.url", ""],
|
||||
["browser.contentblocking.report.cookie.url", ""],
|
||||
["browser.contentblocking.report.tracker.url", ""],
|
||||
["browser.contentblocking.report.fingerprinter.url", ""],
|
||||
["browser.contentblocking.report.cryptominer.url", ""],
|
||||
],
|
||||
});
|
||||
|
||||
|
@ -282,6 +287,119 @@ add_task(async function checkTelemetryClickEvents() {
|
|||
);
|
||||
is(events.length, 1, `recorded telemetry for mtr_signup_button`);
|
||||
|
||||
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
|
||||
const socialLearnMoreLink = await ContentTaskUtils.waitForCondition(() => {
|
||||
return content.document.getElementById("social-link");
|
||||
}, "Learn more link for social tab exists");
|
||||
|
||||
socialLearnMoreLink.click();
|
||||
});
|
||||
|
||||
events = await waitForTelemetryEventCount(10);
|
||||
|
||||
events = events.filter(
|
||||
e =>
|
||||
e[1] == "security.ui.protections" &&
|
||||
e[2] == "click" &&
|
||||
e[3] == "trackers_about_link" &&
|
||||
e[4] == "social"
|
||||
);
|
||||
is(events.length, 1, `recorded telemetry for social trackers_about_link`);
|
||||
|
||||
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
|
||||
const cookieLearnMoreLink = await ContentTaskUtils.waitForCondition(() => {
|
||||
return content.document.getElementById("cookie-link");
|
||||
}, "Learn more link for cookie tab exists");
|
||||
|
||||
cookieLearnMoreLink.click();
|
||||
});
|
||||
|
||||
events = await waitForTelemetryEventCount(11);
|
||||
|
||||
events = events.filter(
|
||||
e =>
|
||||
e[1] == "security.ui.protections" &&
|
||||
e[2] == "click" &&
|
||||
e[3] == "trackers_about_link" &&
|
||||
e[4] == "cookie"
|
||||
);
|
||||
is(events.length, 1, `recorded telemetry for cookie trackers_about_link`);
|
||||
|
||||
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
|
||||
const trackerLearnMoreLink = await ContentTaskUtils.waitForCondition(() => {
|
||||
return content.document.getElementById("tracker-link");
|
||||
}, "Learn more link for tracker tab exists");
|
||||
|
||||
trackerLearnMoreLink.click();
|
||||
});
|
||||
|
||||
events = await waitForTelemetryEventCount(12);
|
||||
|
||||
events = events.filter(
|
||||
e =>
|
||||
e[1] == "security.ui.protections" &&
|
||||
e[2] == "click" &&
|
||||
e[3] == "trackers_about_link" &&
|
||||
e[4] == "tracker"
|
||||
);
|
||||
is(
|
||||
events.length,
|
||||
1,
|
||||
`recorded telemetry for content tracker trackers_about_link`
|
||||
);
|
||||
|
||||
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
|
||||
const fingerprinterLearnMoreLink = await ContentTaskUtils.waitForCondition(
|
||||
() => {
|
||||
return content.document.getElementById("fingerprinter-link");
|
||||
},
|
||||
"Learn more link for fingerprinter tab exists"
|
||||
);
|
||||
|
||||
fingerprinterLearnMoreLink.click();
|
||||
});
|
||||
|
||||
events = await waitForTelemetryEventCount(13);
|
||||
|
||||
events = events.filter(
|
||||
e =>
|
||||
e[1] == "security.ui.protections" &&
|
||||
e[2] == "click" &&
|
||||
e[3] == "trackers_about_link" &&
|
||||
e[4] == "fingerprinter"
|
||||
);
|
||||
is(
|
||||
events.length,
|
||||
1,
|
||||
`recorded telemetry for fingerprinter trackers_about_link`
|
||||
);
|
||||
|
||||
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
|
||||
const cryptominerLearnMoreLink = await ContentTaskUtils.waitForCondition(
|
||||
() => {
|
||||
return content.document.getElementById("cryptominer-link");
|
||||
},
|
||||
"Learn more link for cryptominer tab exists"
|
||||
);
|
||||
|
||||
cryptominerLearnMoreLink.click();
|
||||
});
|
||||
|
||||
events = await waitForTelemetryEventCount(14);
|
||||
|
||||
events = events.filter(
|
||||
e =>
|
||||
e[1] == "security.ui.protections" &&
|
||||
e[2] == "click" &&
|
||||
e[3] == "trackers_about_link" &&
|
||||
e[4] == "cryptominer"
|
||||
);
|
||||
is(
|
||||
events.length,
|
||||
1,
|
||||
`recorded telemetry for cryptominer trackers_about_link`
|
||||
);
|
||||
|
||||
await BrowserTestUtils.removeTab(tab);
|
||||
// We open three extra tabs with the click events.
|
||||
// 1. Monitor's "Viewed Saved Logins" link (goes to about:logins)
|
||||
|
|
|
@ -1534,6 +1534,7 @@ security.ui.protections:
|
|||
click:
|
||||
bug_numbers:
|
||||
- 1557050
|
||||
- 1572825
|
||||
description: >
|
||||
User interaction by click events on the protection report.
|
||||
objects: [
|
||||
|
@ -1545,6 +1546,7 @@ security.ui.protections:
|
|||
"mtr_report_link",
|
||||
"mtr_about_link",
|
||||
"mtr_signup_button",
|
||||
"trackers_about_link",
|
||||
]
|
||||
expiry_version: "75"
|
||||
record_in_processes: ["content"]
|
||||
|
|
Загрузка…
Ссылка в новой задаче