tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 3c3f7ac9ec21d9c0a0c941ae709f000bacefae3e
parent 77c4df94e78bf73c33b75c9afea2def173e2b675
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 offset r=timhuang

Differential Revision: https://phabricator.services.mozilla.com/D276712

Diffstat:
Mtoolkit/components/resistfingerprinting/UserCharacteristicsPageService.sys.mjs | 1+
Mtoolkit/components/resistfingerprinting/content/usercharacteristics.js | 3+++
Mtoolkit/components/resistfingerprinting/metrics.yaml | 19+++++++++++++++++++
Mtoolkit/components/resistfingerprinting/nsUserCharacteristics.cpp | 2+-
4 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/toolkit/components/resistfingerprinting/UserCharacteristicsPageService.sys.mjs b/toolkit/components/resistfingerprinting/UserCharacteristicsPageService.sys.mjs @@ -666,6 +666,7 @@ export class UserCharacteristicsPageService { "audioRate", "audioChannels", "timezoneWeb", + "timezoneOffsetWeb", ], }; diff --git a/toolkit/components/resistfingerprinting/content/usercharacteristics.js b/toolkit/components/resistfingerprinting/content/usercharacteristics.js @@ -999,12 +999,15 @@ async function populateAudioDeviceProperties() { async function populateTimezoneWeb() { try { const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; + const offset = new Date().getTimezoneOffset(); return { timezoneWeb: timezone || "", + timezoneOffsetWeb: offset, }; } catch (e) { return { timezoneWeb: "", + timezoneOffsetWeb: 0, }; } } diff --git a/toolkit/components/resistfingerprinting/metrics.yaml b/toolkit/components/resistfingerprinting/metrics.yaml @@ -421,6 +421,25 @@ characteristics: data_sensitivity: - interaction + timezone_offset_web: + type: quantity + unit: minutes + description: > + The timezone offset in minutes exposed to web content via getTimezoneOffset() + 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: > diff --git a/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp b/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp @@ -801,7 +801,7 @@ const RefPtr<PopulatePromise>& TimoutPromise( // metric is set, this variable should be incremented. It'll be a lot. It's // okay. We're going to need it to know (including during development) what is // the source of the data we are looking at. -const int kSubmissionSchema = 28; +const int kSubmissionSchema = 29; const auto* const kUUIDPref = "toolkit.telemetry.user_characteristics_ping.uuid";