Bug 1963608 - Add a etpCategory to the AntiTracking info of the reportBrokenSite. r=twisniewski,anti-tracking-reviewers,android-reviewers,webcompat-reviewers,emz,npoon
Differential Revision: https://phabricator.services.mozilla.com/D247569
This commit is contained in:
committed by
tihuang@mozilla.com
parent
8438ee01cb
commit
0a7f12580c
@@ -38,6 +38,7 @@ add_task(async function testSendButton() {
|
||||
hasMixedActiveContentBlocked: true,
|
||||
hasMixedDisplayContentBlocked: true,
|
||||
btpHasPurgedSite: false,
|
||||
etpCategory: "strict",
|
||||
},
|
||||
frameworks: {
|
||||
fastclick: true,
|
||||
@@ -66,6 +67,7 @@ add_task(async function testSendingMoreInfo() {
|
||||
hasMixedActiveContentBlocked: true,
|
||||
hasMixedDisplayContentBlocked: true,
|
||||
btpHasPurgedSite: false,
|
||||
etpCategory: "strict",
|
||||
},
|
||||
frameworks: { fastclick: true, mobify: true, marfeel: true },
|
||||
consoleLog: [
|
||||
|
||||
@@ -831,6 +831,7 @@ async function setupStrictETP() {
|
||||
"urlclassifier.trackingTable",
|
||||
"content-track-digest256,mochitest2-track-simple",
|
||||
],
|
||||
["browser.contentblocking.category", "strict"],
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -216,6 +216,7 @@ async function getExpectedWebCompatInfo(tab, snapshot, fullAppData = false) {
|
||||
hasMixedActiveContentBlocked: false,
|
||||
hasMixedDisplayContentBlocked: false,
|
||||
btpHasPurgedSite: false,
|
||||
etpCategory: "standard",
|
||||
},
|
||||
frameworks: {
|
||||
fastclick: false,
|
||||
|
||||
@@ -51,6 +51,7 @@ async function reformatExpectedWebCompatInfo(tab, overrides) {
|
||||
atOverrides?.isPrivateBrowsing ?? antitracking.isPrivateBrowsing;
|
||||
const btpHasPurgedSite =
|
||||
atOverrides?.btpHasPurgedSite ?? antitracking.btpHasPurgedSite;
|
||||
const etpCategory = atOverrides?.etpCategory ?? antitracking.etpCategory;
|
||||
|
||||
const extra_labels = [];
|
||||
const frameworks = overrides.frameworks ?? {
|
||||
@@ -118,6 +119,7 @@ async function reformatExpectedWebCompatInfo(tab, overrides) {
|
||||
hasTrackingContentBlocked,
|
||||
btpHasPurgedSite,
|
||||
isPB: isPrivateBrowsing,
|
||||
etpCategory,
|
||||
languages,
|
||||
locales: snapshot.intl.localeService.available,
|
||||
memoryMB: browserInfo.system.memory,
|
||||
|
||||
@@ -13109,6 +13109,22 @@ broken_site_report.tab_info.antitracking:
|
||||
- webcompat-reporting-tool-telemetry@mozilla.com
|
||||
send_in_pings:
|
||||
- broken-site-report
|
||||
etp_category:
|
||||
type: string
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- interaction
|
||||
description: >
|
||||
The current ETP category, either `standard`, `strict`, or `custom`.
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1963608
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852340#c16
|
||||
notification_emails:
|
||||
- twisniewski@mozilla.com
|
||||
- webcompat-reporting-tool-telemetry@mozilla.com
|
||||
send_in_pings:
|
||||
- broken-site-report
|
||||
broken_site_report.tab_info.frameworks:
|
||||
fastclick:
|
||||
type: boolean
|
||||
|
||||
@@ -36,6 +36,7 @@ data class WebCompatInfoDto(
|
||||
*
|
||||
* @property blockList The blocklist string.
|
||||
* @property btpHasPurgedSite Whether the current tab has recently been purged by Bounce Tracking Protection.
|
||||
* @property etpCategory The current ETP category.
|
||||
* @property hasMixedActiveContentBlocked Whether the current tab has mixed active content blocked.
|
||||
* @property hasMixedDisplayContentBlocked Whether the current tab has mixed display content blocked.
|
||||
* @property hasTrackingContentBlocked Whether the current tab has tracking content blocked.
|
||||
@@ -45,6 +46,7 @@ data class WebCompatInfoDto(
|
||||
data class WebCompatAntiTrackingDto(
|
||||
val blockList: String,
|
||||
val btpHasPurgedSite: Boolean,
|
||||
val etpCategory: String,
|
||||
val hasMixedActiveContentBlocked: Boolean,
|
||||
val hasMixedDisplayContentBlocked: Boolean,
|
||||
val hasTrackingContentBlocked: Boolean,
|
||||
|
||||
@@ -122,6 +122,7 @@ class WebCompatReporterSubmissionMiddleware(
|
||||
private fun setTabAntiTrackingMetrics(antiTracking: WebCompatInfoDto.WebCompatAntiTrackingDto) {
|
||||
BrokenSiteReportTabInfoAntitracking.blockList.set(antiTracking.blockList)
|
||||
BrokenSiteReportTabInfoAntitracking.btpHasPurgedSite.set(antiTracking.btpHasPurgedSite)
|
||||
BrokenSiteReportTabInfoAntitracking.etpCategory.set(antiTracking.etpCategory)
|
||||
BrokenSiteReportTabInfoAntitracking.hasMixedActiveContentBlocked.set(
|
||||
antiTracking.hasMixedActiveContentBlocked,
|
||||
)
|
||||
|
||||
@@ -84,6 +84,7 @@ class DefaultWebCompatReporterRetrievalServiceTest {
|
||||
antitracking = WebCompatInfoDto.WebCompatAntiTrackingDto(
|
||||
blockList = "basic",
|
||||
btpHasPurgedSite = false,
|
||||
etpCategory = "standard",
|
||||
hasMixedActiveContentBlocked = false,
|
||||
hasMixedDisplayContentBlocked = false,
|
||||
hasTrackingContentBlocked = false,
|
||||
@@ -180,6 +181,7 @@ class DefaultWebCompatReporterRetrievalServiceTest {
|
||||
antitracking = WebCompatInfoDto.WebCompatAntiTrackingDto(
|
||||
blockList = "basic",
|
||||
btpHasPurgedSite = false,
|
||||
etpCategory = "standard",
|
||||
hasMixedActiveContentBlocked = false,
|
||||
hasMixedDisplayContentBlocked = false,
|
||||
hasTrackingContentBlocked = false,
|
||||
|
||||
@@ -68,6 +68,10 @@ class WebCompatReporterSubmissionMiddlewareTest {
|
||||
false,
|
||||
BrokenSiteReportTabInfoAntitracking.btpHasPurgedSite.testGetValue(),
|
||||
)
|
||||
assertEquals(
|
||||
"standard",
|
||||
BrokenSiteReportTabInfoAntitracking.etpCategory.testGetValue(),
|
||||
)
|
||||
assertEquals(
|
||||
false,
|
||||
BrokenSiteReportTabInfoAntitracking.hasMixedActiveContentBlocked.testGetValue(),
|
||||
@@ -219,6 +223,7 @@ class WebCompatReporterSubmissionMiddlewareTest {
|
||||
Pings.brokenSiteReport.testBeforeNextSubmit {
|
||||
assertNull(BrokenSiteReportTabInfoAntitracking.blockList.testGetValue())
|
||||
assertNull(BrokenSiteReportTabInfoAntitracking.btpHasPurgedSite.testGetValue())
|
||||
assertNull(BrokenSiteReportTabInfoAntitracking.etpCategory.testGetValue())
|
||||
assertNull(BrokenSiteReportTabInfoAntitracking.hasMixedActiveContentBlocked.testGetValue())
|
||||
assertNull(BrokenSiteReportTabInfoAntitracking.hasMixedDisplayContentBlocked.testGetValue())
|
||||
assertNull(BrokenSiteReportTabInfoAntitracking.hasTrackingContentBlocked.testGetValue())
|
||||
@@ -351,6 +356,7 @@ class WebCompatReporterSubmissionMiddlewareTest {
|
||||
Pings.brokenSiteReport.testBeforeNextSubmit {
|
||||
assertNull(BrokenSiteReportTabInfoAntitracking.blockList.testGetValue())
|
||||
assertNull(BrokenSiteReportTabInfoAntitracking.btpHasPurgedSite.testGetValue())
|
||||
assertNull(BrokenSiteReportTabInfoAntitracking.etpCategory.testGetValue())
|
||||
assertNull(BrokenSiteReportTabInfoAntitracking.hasMixedActiveContentBlocked.testGetValue())
|
||||
assertNull(BrokenSiteReportTabInfoAntitracking.hasMixedDisplayContentBlocked.testGetValue())
|
||||
assertNull(BrokenSiteReportTabInfoAntitracking.hasTrackingContentBlocked.testGetValue())
|
||||
@@ -441,6 +447,7 @@ class WebCompatReporterSubmissionMiddlewareTest {
|
||||
antitracking = WebCompatInfoDto.WebCompatAntiTrackingDto(
|
||||
blockList = "basic",
|
||||
btpHasPurgedSite = false,
|
||||
etpCategory = "standard",
|
||||
hasMixedActiveContentBlocked = false,
|
||||
hasMixedDisplayContentBlocked = false,
|
||||
hasTrackingContentBlocked = false,
|
||||
|
||||
@@ -11,6 +11,7 @@ object WebCompatTestData {
|
||||
"antitracking": {
|
||||
"blockList": "basic",
|
||||
"btpHasPurgedSite": false,
|
||||
"etpCategory": "standard",
|
||||
"hasMixedActiveContentBlocked": false,
|
||||
"hasMixedDisplayContentBlocked": false,
|
||||
"hasTrackingContentBlocked": false,
|
||||
@@ -96,6 +97,7 @@ object WebCompatTestData {
|
||||
"antitracking": {
|
||||
"blockList": "basic",
|
||||
"btpHasPurgedSite": false,
|
||||
"etpCategory": "standard",
|
||||
"hasMixedActiveContentBlocked": false,
|
||||
"hasMixedDisplayContentBlocked": false,
|
||||
"hasTrackingContentBlocked": false,
|
||||
|
||||
@@ -311,6 +311,7 @@ export class ReportBrokenSiteChild extends JSWindowActorChild {
|
||||
hasMixedDisplayContentBlocked,
|
||||
hasTrackingContentBlocked,
|
||||
btpHasPurgedSite,
|
||||
etpCategory,
|
||||
} = antitracking;
|
||||
|
||||
message.blockList = blockList;
|
||||
@@ -359,6 +360,7 @@ export class ReportBrokenSiteChild extends JSWindowActorChild {
|
||||
hasTrackingContentBlocked,
|
||||
btpHasPurgedSite,
|
||||
isPB: isPrivateBrowsing,
|
||||
etpCategory,
|
||||
languages,
|
||||
locales,
|
||||
memoryMB,
|
||||
|
||||
@@ -17,6 +17,16 @@ export class ReportBrokenSiteParent extends JSWindowActorParent {
|
||||
return trackingTable.includes("content") ? "strict" : "basic";
|
||||
}
|
||||
|
||||
#getETPCategory() {
|
||||
// Note that the pref will be set to "custom" if the user disables ETP on
|
||||
// mobile.
|
||||
const etpState = Services.prefs.getStringPref(
|
||||
"browser.contentblocking.category",
|
||||
"standard"
|
||||
);
|
||||
return etpState;
|
||||
}
|
||||
|
||||
#getAntitrackingInfo(browsingContext) {
|
||||
// Ask BounceTrackingProtection whether it has recently purged state for the
|
||||
// site in the current top level context.
|
||||
@@ -54,6 +64,7 @@ export class ReportBrokenSiteParent extends JSWindowActorParent {
|
||||
Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_DISPLAY_CONTENT
|
||||
),
|
||||
btpHasPurgedSite,
|
||||
etpCategory: this.#getETPCategory(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -202,6 +202,23 @@ broken_site_report.tab_info.antitracking:
|
||||
send_in_pings:
|
||||
- broken-site-report
|
||||
|
||||
etp_category:
|
||||
type: string
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- interaction
|
||||
description: >
|
||||
The current ETP category, either `standard`, `strict`, or `custom`.
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1963608
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852340#c16
|
||||
notification_emails:
|
||||
- twisniewski@mozilla.com
|
||||
- webcompat-reporting-tool-telemetry@mozilla.com
|
||||
send_in_pings:
|
||||
- broken-site-report
|
||||
|
||||
broken_site_report.tab_info.frameworks:
|
||||
fastclick:
|
||||
type: boolean
|
||||
|
||||
Reference in New Issue
Block a user