From 29130625c7036afc23baeae04c03d40649e265d4 Mon Sep 17 00:00:00 2001 From: Fatih Date: Wed, 18 Sep 2024 01:00:24 +0000 Subject: [PATCH] Bug 1919090: Flatten media capabilities. r=tjr Differential Revision: https://phabricator.services.mozilla.com/D222342 --- .../UserCharacteristicsPageService.sys.mjs | 5 +- .../content/usercharacteristics.js | 11 +++- .../resistfingerprinting/metrics.yaml | 65 +++++++++++++++++-- 3 files changed, 74 insertions(+), 7 deletions(-) diff --git a/toolkit/components/resistfingerprinting/UserCharacteristicsPageService.sys.mjs b/toolkit/components/resistfingerprinting/UserCharacteristicsPageService.sys.mjs index bf2ba2636d69..ff10ba90fb5f 100644 --- a/toolkit/components/resistfingerprinting/UserCharacteristicsPageService.sys.mjs +++ b/toolkit/components/resistfingerprinting/UserCharacteristicsPageService.sys.mjs @@ -323,7 +323,10 @@ export class UserCharacteristicsPageService { "canvasdata12Fingerprintjs1software", "canvasdata13Fingerprintjs2software", "voices", - "mediaCapabilities", + "mediaCapabilitiesUnsupported", + "mediaCapabilitiesNotSmooth", + "mediaCapabilitiesNotEfficient", + "mediaCapabilitiesH264", "audioFingerprint", "jsErrors", "pointerType", diff --git a/toolkit/components/resistfingerprinting/content/usercharacteristics.js b/toolkit/components/resistfingerprinting/content/usercharacteristics.js index 5ca870c4bbef..24a8555149af 100644 --- a/toolkit/components/resistfingerprinting/content/usercharacteristics.js +++ b/toolkit/components/resistfingerprinting/content/usercharacteristics.js @@ -814,11 +814,18 @@ async function populateMediaCapabilities() { } } - return JSON.stringify(capabilities); + return capabilities; } + const capabilities = await getCapabilities(); + return { - mediaCapabilities: getCapabilities(), + mediaCapabilitiesUnsupported: JSON.stringify(capabilities.unsupported), + mediaCapabilitiesNotSmooth: JSON.stringify(capabilities.notSmooth), + mediaCapabilitiesNotEfficient: JSON.stringify( + capabilities.notPowerEfficient + ), + mediaCapabilitiesH264: JSON.stringify(capabilities.h264), }; } diff --git a/toolkit/components/resistfingerprinting/metrics.yaml b/toolkit/components/resistfingerprinting/metrics.yaml index fab103d02c16..4ec081758b14 100644 --- a/toolkit/components/resistfingerprinting/metrics.yaml +++ b/toolkit/components/resistfingerprinting/metrics.yaml @@ -2121,19 +2121,76 @@ characteristics: data_sensitivity: - interaction - media_capabilities: + media_capabilities_unsupported: type: text description: > - Which, if any, media types are not supported, and whether they can be run smoothly and power-efficiently. + Which, if any, media types are not supported. lifetime: application send_in_pings: - user-characteristics notification_emails: - tom@mozilla.com bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1899181 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1919090 data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1899181#c3 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1919090#c1 + expires: never + data_sensitivity: + # Text metrics are _required_ to be web_activity or highly_sensitive, so even though this + # is more like 'technical' (per the Data Review), I'm marking highly sensitive. + - highly_sensitive + + media_capabilities_not_smooth: + type: text + description: > + Which, if any, media types are not smooth. + lifetime: application + send_in_pings: + - user-characteristics + notification_emails: + - tom@mozilla.com + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1919090 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1919090#c1 + expires: never + data_sensitivity: + # Text metrics are _required_ to be web_activity or highly_sensitive, so even though this + # is more like 'technical' (per the Data Review), I'm marking highly sensitive. + - highly_sensitive + + media_capabilities_not_efficient: + type: text + description: > + Which, if any, media types are not power efficient. + lifetime: application + send_in_pings: + - user-characteristics + notification_emails: + - tom@mozilla.com + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1919090 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1919090#c1 + expires: never + data_sensitivity: + # Text metrics are _required_ to be web_activity or highly_sensitive, so even though this + # is more like 'technical' (per the Data Review), I'm marking highly sensitive. + - highly_sensitive + + media_capabilities_h264: + type: text + description: > + Levels of support for H264 codec. + lifetime: application + send_in_pings: + - user-characteristics + notification_emails: + - tom@mozilla.com + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1919090 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1919090#c1 expires: never data_sensitivity: # Text metrics are _required_ to be web_activity or highly_sensitive, so even though this