commit 77c4df94e78bf73c33b75c9afea2def173e2b675
parent 7f7c96f16bc5e6f045bcd1bb3cfdf7974f30903e
Author: Tom Ritter <tom@mozilla.com>
Date: Mon, 29 Dec 2025 20:28:58 +0000
Bug 2005864: Add a metric reporting the web-exposed timezone name r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D276711
Diffstat:
3 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/toolkit/components/resistfingerprinting/UserCharacteristicsPageService.sys.mjs b/toolkit/components/resistfingerprinting/UserCharacteristicsPageService.sys.mjs
@@ -665,6 +665,7 @@ export class UserCharacteristicsPageService {
"audioFrames",
"audioRate",
"audioChannels",
+ "timezoneWeb",
],
};
diff --git a/toolkit/components/resistfingerprinting/content/usercharacteristics.js b/toolkit/components/resistfingerprinting/content/usercharacteristics.js
@@ -996,6 +996,19 @@ async function populateAudioDeviceProperties() {
};
}
+async function populateTimezoneWeb() {
+ try {
+ const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
+ return {
+ timezoneWeb: timezone || "",
+ };
+ } catch (e) {
+ return {
+ timezoneWeb: "",
+ };
+ }
+}
+
// A helper function to generate an array of asynchronous functions to populate
// canvases using both software and hardware rendering.
function getCanvasSources() {
@@ -1063,6 +1076,7 @@ async function startPopulating() {
populateCSSQueries,
populateNavigatorProperties,
populateAudioDeviceProperties,
+ populateTimezoneWeb,
];
// Catches errors in promise-creating functions. E.g. if populateVoiceList
// throws an error before returning any of its `key: (Promise<any> | any)`
diff --git a/toolkit/components/resistfingerprinting/metrics.yaml b/toolkit/components/resistfingerprinting/metrics.yaml
@@ -403,6 +403,24 @@ characteristics:
data_sensitivity:
- interaction
+ timezone_web:
+ type: string
+ description: >
+ The timezone string reported via the web using Intl API (e.g. America/New_York)
+ lifetime: application
+ send_in_pings:
+ - user-characteristics
+ notification_emails:
+ - tom@mozilla.com
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=2005864
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=2005864
+ expires: never
+ data_sensitivity:
+ - interaction
+
system_locale:
type: string
description: >