lists.torproject.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

tbb-commits

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
tbb-commits@lists.torproject.org

October 2024

  • 1 participants
  • 290 discussions
[Git][tpo/applications/mullvad-browser][mullvad-browser-128.3.0esr-14.0-1] 2 commits: Bug 1607032: Spoof screen orientation and angle to primary values. r=tjr, geckoview-reviewers, owlish
by morgan (@morgan) 02 Oct '24

02 Oct '24
morgan pushed to branch mullvad-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Mullvad Browser Commits: 0c49d19c by Fatih at 2024-10-02T19:27:24+00:00 Bug 1607032: Spoof screen orientation and angle to primary values. r=tjr,geckoview-reviewers,owlish Differential Revision: https://phabricator.services.mozilla.com/D220904 - - - - - 0fb83408 by Fatih at 2024-10-02T19:27:24+00:00 Bug 1918202: Spoof orientation based on screen size. r=tjr Differential Revision: https://phabricator.services.mozilla.com/D221863 - - - - - 6 changed files: - dom/base/ScreenOrientation.cpp - dom/base/nsGlobalWindowInner.cpp - dom/base/test/chrome/bug418986-1.js - hal/android/AndroidHal.cpp - toolkit/components/resistfingerprinting/nsRFPService.cpp - toolkit/components/resistfingerprinting/nsRFPService.h Changes: ===================================== dom/base/ScreenOrientation.cpp ===================================== @@ -626,7 +626,13 @@ void ScreenOrientation::CleanupFullscreenListener() { OrientationType ScreenOrientation::DeviceType(CallerType aCallerType) const { if (nsContentUtils::ShouldResistFingerprinting( aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { - return OrientationType::Landscape_primary; + Document* doc = GetResponsibleDocument(); + BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr; + if (!bc) { + return nsRFPService::GetDefaultOrientationType(); + } + CSSIntSize size = bc->GetTopInnerSizeForRFP(); + return nsRFPService::ViewportSizeToOrientationType(size.width, size.height); } return mType; } @@ -634,18 +640,19 @@ OrientationType ScreenOrientation::DeviceType(CallerType aCallerType) const { uint16_t ScreenOrientation::DeviceAngle(CallerType aCallerType) const { if (nsContentUtils::ShouldResistFingerprinting( aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { - return 0; + Document* doc = GetResponsibleDocument(); + BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr; + if (!bc) { + return 0; + } + CSSIntSize size = bc->GetTopInnerSizeForRFP(); + return nsRFPService::ViewportSizeToAngle(size.width, size.height); } return mAngle; } OrientationType ScreenOrientation::GetType(CallerType aCallerType, ErrorResult& aRv) const { - if (nsContentUtils::ShouldResistFingerprinting( - aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { - return OrientationType::Landscape_primary; - } - Document* doc = GetResponsibleDocument(); BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr; if (!bc) { @@ -653,16 +660,17 @@ OrientationType ScreenOrientation::GetType(CallerType aCallerType, return OrientationType::Portrait_primary; } - return bc->GetCurrentOrientationType(); -} - -uint16_t ScreenOrientation::GetAngle(CallerType aCallerType, - ErrorResult& aRv) const { + OrientationType orientation = bc->GetCurrentOrientationType(); if (nsContentUtils::ShouldResistFingerprinting( aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { - return 0; + CSSIntSize size = bc->GetTopInnerSizeForRFP(); + return nsRFPService::ViewportSizeToOrientationType(size.width, size.height); } + return orientation; +} +uint16_t ScreenOrientation::GetAngle(CallerType aCallerType, + ErrorResult& aRv) const { Document* doc = GetResponsibleDocument(); BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr; if (!bc) { @@ -670,7 +678,13 @@ uint16_t ScreenOrientation::GetAngle(CallerType aCallerType, return 0; } - return bc->GetCurrentOrientationAngle(); + uint16_t angle = static_cast<uint16_t>(bc->GetCurrentOrientationAngle()); + if (nsContentUtils::ShouldResistFingerprinting( + aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { + CSSIntSize size = bc->GetTopInnerSizeForRFP(); + return nsRFPService::ViewportSizeToAngle(size.width, size.height); + } + return angle; } ScreenOrientation::LockPermission ===================================== dom/base/nsGlobalWindowInner.cpp ===================================== @@ -7306,11 +7306,13 @@ void nsGlobalWindowInner::InitWasOffline() { mWasOffline = NS_IsOffline(); } int16_t nsGlobalWindowInner::Orientation(CallerType aCallerType) { // GetOrientationAngle() returns 0, 90, 180 or 270. // window.orientation returns -90, 0, 90 or 180. + uint16_t screenAngle = Screen()->GetOrientationAngle(); if (nsIGlobalObject::ShouldResistFingerprinting( aCallerType, RFPTarget::ScreenOrientation)) { - return 0; + CSSIntSize size = mBrowsingContext->GetTopInnerSizeForRFP(); + screenAngle = nsRFPService::ViewportSizeToAngle(size.width, size.height); } - int16_t angle = AssertedCast<int16_t>(Screen()->GetOrientationAngle()); + int16_t angle = AssertedCast<int16_t>(screenAngle); return angle <= 180 ? angle : angle - 360; } ===================================== dom/base/test/chrome/bug418986-1.js ===================================== @@ -32,9 +32,6 @@ var test = function (isContent) { ["screen.availTop", 0], ["screen.width", "outerWidth"], ["screen.height", "outerHeight"], - ["screen.orientation.type", "'landscape-primary'"], - ["screen.orientation.angle", 0], - ["screen.mozOrientation", "'landscape-primary'"], ["devicePixelRatio", 2], ]; ===================================== hal/android/AndroidHal.cpp ===================================== @@ -79,19 +79,20 @@ void GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInfo) { static bool IsSupportedScreenOrientation(hal::ScreenOrientation aOrientation) { // The Android backend only supports these orientations. - static constexpr ScreenOrientation kSupportedOrientations[] = { - ScreenOrientation::PortraitPrimary, - ScreenOrientation::PortraitSecondary, - ScreenOrientation::PortraitPrimary | ScreenOrientation::PortraitSecondary, - ScreenOrientation::LandscapePrimary, - ScreenOrientation::LandscapeSecondary, - ScreenOrientation::LandscapePrimary | - ScreenOrientation::LandscapeSecondary, - ScreenOrientation::PortraitPrimary | - ScreenOrientation::PortraitSecondary | - ScreenOrientation::LandscapePrimary | - ScreenOrientation::LandscapeSecondary, - ScreenOrientation::Default, + static constexpr hal::ScreenOrientation kSupportedOrientations[] = { + hal::ScreenOrientation::PortraitPrimary, + hal::ScreenOrientation::PortraitSecondary, + hal::ScreenOrientation::PortraitPrimary | + hal::ScreenOrientation::PortraitSecondary, + hal::ScreenOrientation::LandscapePrimary, + hal::ScreenOrientation::LandscapeSecondary, + hal::ScreenOrientation::LandscapePrimary | + hal::ScreenOrientation::LandscapeSecondary, + hal::ScreenOrientation::PortraitPrimary | + hal::ScreenOrientation::PortraitSecondary | + hal::ScreenOrientation::LandscapePrimary | + hal::ScreenOrientation::LandscapeSecondary, + hal::ScreenOrientation::Default, }; for (auto supportedOrientation : kSupportedOrientations) { if (aOrientation == supportedOrientation) { ===================================== toolkit/components/resistfingerprinting/nsRFPService.cpp ===================================== @@ -2284,3 +2284,34 @@ Maybe<RFPTarget> nsRFPService::GetOverriddenFingerprintingSettingsForURI( return result; } + +/* static */ +uint16_t nsRFPService::ViewportSizeToAngle(int32_t aWidth, int32_t aHeight) { +#ifdef MOZ_WIDGET_ANDROID + bool neutral = aHeight >= aWidth; +#else + bool neutral = aWidth >= aHeight; +#endif + if (neutral) { + return 0; + } + return 90; +} + +/* static */ +dom::OrientationType nsRFPService::ViewportSizeToOrientationType( + int32_t aWidth, int32_t aHeight) { + if (aWidth >= aHeight) { + return dom::OrientationType::Landscape_primary; + } + return dom::OrientationType::Portrait_primary; +} + +/* static */ +dom::OrientationType nsRFPService::GetDefaultOrientationType() { +#ifdef MOZ_WIDGET_ANDROID + return dom::OrientationType::Portrait_primary; +#else + return dom::OrientationType::Landscape_primary; +#endif +} ===================================== toolkit/components/resistfingerprinting/nsRFPService.h ===================================== @@ -14,6 +14,7 @@ #include "mozilla/ContentBlockingLog.h" #include "mozilla/gfx/Types.h" #include "mozilla/TypedEnumBits.h" +#include "mozilla/dom/ScreenOrientationBinding.h" #include "js/RealmOptions.h" #include "nsHashtablesFwd.h" #include "nsICookieJarSettings.h" @@ -368,6 +369,16 @@ class nsRFPService final : public nsIObserver, public nsIRFPService { static bool CheckSuspiciousFingerprintingActivity( nsTArray<ContentBlockingLog::LogEntry>& aLogs); + // Converts the viewport size to the angle. + static uint16_t ViewportSizeToAngle(int32_t aWidth, int32_t aHeight); + + // Converts the viewport size to the orientation type. + static dom::OrientationType ViewportSizeToOrientationType(int32_t aWidth, + int32_t aHeight); + + // Returns the default orientation type for the given platform. + static dom::OrientationType GetDefaultOrientationType(); + private: nsresult Init(); View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/92… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/92… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][base-browser-128.3.0esr-14.0-1] 2 commits: Bug 1607032: Spoof screen orientation and angle to primary values. r=tjr, geckoview-reviewers, owlish
by morgan (@morgan) 02 Oct '24

02 Oct '24
morgan pushed to branch base-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser Commits: 9f066a06 by Fatih at 2024-10-02T19:25:48+00:00 Bug 1607032: Spoof screen orientation and angle to primary values. r=tjr,geckoview-reviewers,owlish Differential Revision: https://phabricator.services.mozilla.com/D220904 - - - - - 6112a1c3 by Fatih at 2024-10-02T19:25:48+00:00 Bug 1918202: Spoof orientation based on screen size. r=tjr Differential Revision: https://phabricator.services.mozilla.com/D221863 - - - - - 6 changed files: - dom/base/ScreenOrientation.cpp - dom/base/nsGlobalWindowInner.cpp - dom/base/test/chrome/bug418986-1.js - hal/android/AndroidHal.cpp - toolkit/components/resistfingerprinting/nsRFPService.cpp - toolkit/components/resistfingerprinting/nsRFPService.h Changes: ===================================== dom/base/ScreenOrientation.cpp ===================================== @@ -626,7 +626,13 @@ void ScreenOrientation::CleanupFullscreenListener() { OrientationType ScreenOrientation::DeviceType(CallerType aCallerType) const { if (nsContentUtils::ShouldResistFingerprinting( aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { - return OrientationType::Landscape_primary; + Document* doc = GetResponsibleDocument(); + BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr; + if (!bc) { + return nsRFPService::GetDefaultOrientationType(); + } + CSSIntSize size = bc->GetTopInnerSizeForRFP(); + return nsRFPService::ViewportSizeToOrientationType(size.width, size.height); } return mType; } @@ -634,18 +640,19 @@ OrientationType ScreenOrientation::DeviceType(CallerType aCallerType) const { uint16_t ScreenOrientation::DeviceAngle(CallerType aCallerType) const { if (nsContentUtils::ShouldResistFingerprinting( aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { - return 0; + Document* doc = GetResponsibleDocument(); + BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr; + if (!bc) { + return 0; + } + CSSIntSize size = bc->GetTopInnerSizeForRFP(); + return nsRFPService::ViewportSizeToAngle(size.width, size.height); } return mAngle; } OrientationType ScreenOrientation::GetType(CallerType aCallerType, ErrorResult& aRv) const { - if (nsContentUtils::ShouldResistFingerprinting( - aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { - return OrientationType::Landscape_primary; - } - Document* doc = GetResponsibleDocument(); BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr; if (!bc) { @@ -653,16 +660,17 @@ OrientationType ScreenOrientation::GetType(CallerType aCallerType, return OrientationType::Portrait_primary; } - return bc->GetCurrentOrientationType(); -} - -uint16_t ScreenOrientation::GetAngle(CallerType aCallerType, - ErrorResult& aRv) const { + OrientationType orientation = bc->GetCurrentOrientationType(); if (nsContentUtils::ShouldResistFingerprinting( aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { - return 0; + CSSIntSize size = bc->GetTopInnerSizeForRFP(); + return nsRFPService::ViewportSizeToOrientationType(size.width, size.height); } + return orientation; +} +uint16_t ScreenOrientation::GetAngle(CallerType aCallerType, + ErrorResult& aRv) const { Document* doc = GetResponsibleDocument(); BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr; if (!bc) { @@ -670,7 +678,13 @@ uint16_t ScreenOrientation::GetAngle(CallerType aCallerType, return 0; } - return bc->GetCurrentOrientationAngle(); + uint16_t angle = static_cast<uint16_t>(bc->GetCurrentOrientationAngle()); + if (nsContentUtils::ShouldResistFingerprinting( + aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { + CSSIntSize size = bc->GetTopInnerSizeForRFP(); + return nsRFPService::ViewportSizeToAngle(size.width, size.height); + } + return angle; } ScreenOrientation::LockPermission ===================================== dom/base/nsGlobalWindowInner.cpp ===================================== @@ -7306,11 +7306,13 @@ void nsGlobalWindowInner::InitWasOffline() { mWasOffline = NS_IsOffline(); } int16_t nsGlobalWindowInner::Orientation(CallerType aCallerType) { // GetOrientationAngle() returns 0, 90, 180 or 270. // window.orientation returns -90, 0, 90 or 180. + uint16_t screenAngle = Screen()->GetOrientationAngle(); if (nsIGlobalObject::ShouldResistFingerprinting( aCallerType, RFPTarget::ScreenOrientation)) { - return 0; + CSSIntSize size = mBrowsingContext->GetTopInnerSizeForRFP(); + screenAngle = nsRFPService::ViewportSizeToAngle(size.width, size.height); } - int16_t angle = AssertedCast<int16_t>(Screen()->GetOrientationAngle()); + int16_t angle = AssertedCast<int16_t>(screenAngle); return angle <= 180 ? angle : angle - 360; } ===================================== dom/base/test/chrome/bug418986-1.js ===================================== @@ -32,9 +32,6 @@ var test = function (isContent) { ["screen.availTop", 0], ["screen.width", "outerWidth"], ["screen.height", "outerHeight"], - ["screen.orientation.type", "'landscape-primary'"], - ["screen.orientation.angle", 0], - ["screen.mozOrientation", "'landscape-primary'"], ["devicePixelRatio", 2], ]; ===================================== hal/android/AndroidHal.cpp ===================================== @@ -79,19 +79,20 @@ void GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInfo) { static bool IsSupportedScreenOrientation(hal::ScreenOrientation aOrientation) { // The Android backend only supports these orientations. - static constexpr ScreenOrientation kSupportedOrientations[] = { - ScreenOrientation::PortraitPrimary, - ScreenOrientation::PortraitSecondary, - ScreenOrientation::PortraitPrimary | ScreenOrientation::PortraitSecondary, - ScreenOrientation::LandscapePrimary, - ScreenOrientation::LandscapeSecondary, - ScreenOrientation::LandscapePrimary | - ScreenOrientation::LandscapeSecondary, - ScreenOrientation::PortraitPrimary | - ScreenOrientation::PortraitSecondary | - ScreenOrientation::LandscapePrimary | - ScreenOrientation::LandscapeSecondary, - ScreenOrientation::Default, + static constexpr hal::ScreenOrientation kSupportedOrientations[] = { + hal::ScreenOrientation::PortraitPrimary, + hal::ScreenOrientation::PortraitSecondary, + hal::ScreenOrientation::PortraitPrimary | + hal::ScreenOrientation::PortraitSecondary, + hal::ScreenOrientation::LandscapePrimary, + hal::ScreenOrientation::LandscapeSecondary, + hal::ScreenOrientation::LandscapePrimary | + hal::ScreenOrientation::LandscapeSecondary, + hal::ScreenOrientation::PortraitPrimary | + hal::ScreenOrientation::PortraitSecondary | + hal::ScreenOrientation::LandscapePrimary | + hal::ScreenOrientation::LandscapeSecondary, + hal::ScreenOrientation::Default, }; for (auto supportedOrientation : kSupportedOrientations) { if (aOrientation == supportedOrientation) { ===================================== toolkit/components/resistfingerprinting/nsRFPService.cpp ===================================== @@ -2284,3 +2284,34 @@ Maybe<RFPTarget> nsRFPService::GetOverriddenFingerprintingSettingsForURI( return result; } + +/* static */ +uint16_t nsRFPService::ViewportSizeToAngle(int32_t aWidth, int32_t aHeight) { +#ifdef MOZ_WIDGET_ANDROID + bool neutral = aHeight >= aWidth; +#else + bool neutral = aWidth >= aHeight; +#endif + if (neutral) { + return 0; + } + return 90; +} + +/* static */ +dom::OrientationType nsRFPService::ViewportSizeToOrientationType( + int32_t aWidth, int32_t aHeight) { + if (aWidth >= aHeight) { + return dom::OrientationType::Landscape_primary; + } + return dom::OrientationType::Portrait_primary; +} + +/* static */ +dom::OrientationType nsRFPService::GetDefaultOrientationType() { +#ifdef MOZ_WIDGET_ANDROID + return dom::OrientationType::Portrait_primary; +#else + return dom::OrientationType::Landscape_primary; +#endif +} ===================================== toolkit/components/resistfingerprinting/nsRFPService.h ===================================== @@ -14,6 +14,7 @@ #include "mozilla/ContentBlockingLog.h" #include "mozilla/gfx/Types.h" #include "mozilla/TypedEnumBits.h" +#include "mozilla/dom/ScreenOrientationBinding.h" #include "js/RealmOptions.h" #include "nsHashtablesFwd.h" #include "nsICookieJarSettings.h" @@ -368,6 +369,16 @@ class nsRFPService final : public nsIObserver, public nsIRFPService { static bool CheckSuspiciousFingerprintingActivity( nsTArray<ContentBlockingLog::LogEntry>& aLogs); + // Converts the viewport size to the angle. + static uint16_t ViewportSizeToAngle(int32_t aWidth, int32_t aHeight); + + // Converts the viewport size to the orientation type. + static dom::OrientationType ViewportSizeToOrientationType(int32_t aWidth, + int32_t aHeight); + + // Returns the default orientation type for the given platform. + static dom::OrientationType GetDefaultOrientationType(); + private: nsresult Init(); View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/dbdddf… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/dbdddf… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-128.3.0esr-14.0-1] 2 commits: Bug 1607032: Spoof screen orientation and angle to primary values. r=tjr, geckoview-reviewers, owlish
by morgan (@morgan) 02 Oct '24

02 Oct '24
morgan pushed to branch tor-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser Commits: 89b45eb4 by Fatih at 2024-10-02T18:59:01+00:00 Bug 1607032: Spoof screen orientation and angle to primary values. r=tjr,geckoview-reviewers,owlish Differential Revision: https://phabricator.services.mozilla.com/D220904 - - - - - 084cb5b9 by Fatih at 2024-10-02T18:59:01+00:00 Bug 1918202: Spoof orientation based on screen size. r=tjr Differential Revision: https://phabricator.services.mozilla.com/D221863 - - - - - 6 changed files: - dom/base/ScreenOrientation.cpp - dom/base/nsGlobalWindowInner.cpp - dom/base/test/chrome/bug418986-1.js - hal/android/AndroidHal.cpp - toolkit/components/resistfingerprinting/nsRFPService.cpp - toolkit/components/resistfingerprinting/nsRFPService.h Changes: ===================================== dom/base/ScreenOrientation.cpp ===================================== @@ -626,7 +626,13 @@ void ScreenOrientation::CleanupFullscreenListener() { OrientationType ScreenOrientation::DeviceType(CallerType aCallerType) const { if (nsContentUtils::ShouldResistFingerprinting( aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { - return OrientationType::Landscape_primary; + Document* doc = GetResponsibleDocument(); + BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr; + if (!bc) { + return nsRFPService::GetDefaultOrientationType(); + } + CSSIntSize size = bc->GetTopInnerSizeForRFP(); + return nsRFPService::ViewportSizeToOrientationType(size.width, size.height); } return mType; } @@ -634,18 +640,19 @@ OrientationType ScreenOrientation::DeviceType(CallerType aCallerType) const { uint16_t ScreenOrientation::DeviceAngle(CallerType aCallerType) const { if (nsContentUtils::ShouldResistFingerprinting( aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { - return 0; + Document* doc = GetResponsibleDocument(); + BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr; + if (!bc) { + return 0; + } + CSSIntSize size = bc->GetTopInnerSizeForRFP(); + return nsRFPService::ViewportSizeToAngle(size.width, size.height); } return mAngle; } OrientationType ScreenOrientation::GetType(CallerType aCallerType, ErrorResult& aRv) const { - if (nsContentUtils::ShouldResistFingerprinting( - aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { - return OrientationType::Landscape_primary; - } - Document* doc = GetResponsibleDocument(); BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr; if (!bc) { @@ -653,16 +660,17 @@ OrientationType ScreenOrientation::GetType(CallerType aCallerType, return OrientationType::Portrait_primary; } - return bc->GetCurrentOrientationType(); -} - -uint16_t ScreenOrientation::GetAngle(CallerType aCallerType, - ErrorResult& aRv) const { + OrientationType orientation = bc->GetCurrentOrientationType(); if (nsContentUtils::ShouldResistFingerprinting( aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { - return 0; + CSSIntSize size = bc->GetTopInnerSizeForRFP(); + return nsRFPService::ViewportSizeToOrientationType(size.width, size.height); } + return orientation; +} +uint16_t ScreenOrientation::GetAngle(CallerType aCallerType, + ErrorResult& aRv) const { Document* doc = GetResponsibleDocument(); BrowsingContext* bc = doc ? doc->GetBrowsingContext() : nullptr; if (!bc) { @@ -670,7 +678,13 @@ uint16_t ScreenOrientation::GetAngle(CallerType aCallerType, return 0; } - return bc->GetCurrentOrientationAngle(); + uint16_t angle = static_cast<uint16_t>(bc->GetCurrentOrientationAngle()); + if (nsContentUtils::ShouldResistFingerprinting( + aCallerType, GetOwnerGlobal(), RFPTarget::ScreenOrientation)) { + CSSIntSize size = bc->GetTopInnerSizeForRFP(); + return nsRFPService::ViewportSizeToAngle(size.width, size.height); + } + return angle; } ScreenOrientation::LockPermission ===================================== dom/base/nsGlobalWindowInner.cpp ===================================== @@ -7306,11 +7306,13 @@ void nsGlobalWindowInner::InitWasOffline() { mWasOffline = NS_IsOffline(); } int16_t nsGlobalWindowInner::Orientation(CallerType aCallerType) { // GetOrientationAngle() returns 0, 90, 180 or 270. // window.orientation returns -90, 0, 90 or 180. + uint16_t screenAngle = Screen()->GetOrientationAngle(); if (nsIGlobalObject::ShouldResistFingerprinting( aCallerType, RFPTarget::ScreenOrientation)) { - return 0; + CSSIntSize size = mBrowsingContext->GetTopInnerSizeForRFP(); + screenAngle = nsRFPService::ViewportSizeToAngle(size.width, size.height); } - int16_t angle = AssertedCast<int16_t>(Screen()->GetOrientationAngle()); + int16_t angle = AssertedCast<int16_t>(screenAngle); return angle <= 180 ? angle : angle - 360; } ===================================== dom/base/test/chrome/bug418986-1.js ===================================== @@ -32,9 +32,6 @@ var test = function (isContent) { ["screen.availTop", 0], ["screen.width", "outerWidth"], ["screen.height", "outerHeight"], - ["screen.orientation.type", "'landscape-primary'"], - ["screen.orientation.angle", 0], - ["screen.mozOrientation", "'landscape-primary'"], ["devicePixelRatio", 2], ]; ===================================== hal/android/AndroidHal.cpp ===================================== @@ -79,19 +79,20 @@ void GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInfo) { static bool IsSupportedScreenOrientation(hal::ScreenOrientation aOrientation) { // The Android backend only supports these orientations. - static constexpr ScreenOrientation kSupportedOrientations[] = { - ScreenOrientation::PortraitPrimary, - ScreenOrientation::PortraitSecondary, - ScreenOrientation::PortraitPrimary | ScreenOrientation::PortraitSecondary, - ScreenOrientation::LandscapePrimary, - ScreenOrientation::LandscapeSecondary, - ScreenOrientation::LandscapePrimary | - ScreenOrientation::LandscapeSecondary, - ScreenOrientation::PortraitPrimary | - ScreenOrientation::PortraitSecondary | - ScreenOrientation::LandscapePrimary | - ScreenOrientation::LandscapeSecondary, - ScreenOrientation::Default, + static constexpr hal::ScreenOrientation kSupportedOrientations[] = { + hal::ScreenOrientation::PortraitPrimary, + hal::ScreenOrientation::PortraitSecondary, + hal::ScreenOrientation::PortraitPrimary | + hal::ScreenOrientation::PortraitSecondary, + hal::ScreenOrientation::LandscapePrimary, + hal::ScreenOrientation::LandscapeSecondary, + hal::ScreenOrientation::LandscapePrimary | + hal::ScreenOrientation::LandscapeSecondary, + hal::ScreenOrientation::PortraitPrimary | + hal::ScreenOrientation::PortraitSecondary | + hal::ScreenOrientation::LandscapePrimary | + hal::ScreenOrientation::LandscapeSecondary, + hal::ScreenOrientation::Default, }; for (auto supportedOrientation : kSupportedOrientations) { if (aOrientation == supportedOrientation) { ===================================== toolkit/components/resistfingerprinting/nsRFPService.cpp ===================================== @@ -2284,3 +2284,34 @@ Maybe<RFPTarget> nsRFPService::GetOverriddenFingerprintingSettingsForURI( return result; } + +/* static */ +uint16_t nsRFPService::ViewportSizeToAngle(int32_t aWidth, int32_t aHeight) { +#ifdef MOZ_WIDGET_ANDROID + bool neutral = aHeight >= aWidth; +#else + bool neutral = aWidth >= aHeight; +#endif + if (neutral) { + return 0; + } + return 90; +} + +/* static */ +dom::OrientationType nsRFPService::ViewportSizeToOrientationType( + int32_t aWidth, int32_t aHeight) { + if (aWidth >= aHeight) { + return dom::OrientationType::Landscape_primary; + } + return dom::OrientationType::Portrait_primary; +} + +/* static */ +dom::OrientationType nsRFPService::GetDefaultOrientationType() { +#ifdef MOZ_WIDGET_ANDROID + return dom::OrientationType::Portrait_primary; +#else + return dom::OrientationType::Landscape_primary; +#endif +} ===================================== toolkit/components/resistfingerprinting/nsRFPService.h ===================================== @@ -14,6 +14,7 @@ #include "mozilla/ContentBlockingLog.h" #include "mozilla/gfx/Types.h" #include "mozilla/TypedEnumBits.h" +#include "mozilla/dom/ScreenOrientationBinding.h" #include "js/RealmOptions.h" #include "nsHashtablesFwd.h" #include "nsICookieJarSettings.h" @@ -368,6 +369,16 @@ class nsRFPService final : public nsIObserver, public nsIRFPService { static bool CheckSuspiciousFingerprintingActivity( nsTArray<ContentBlockingLog::LogEntry>& aLogs); + // Converts the viewport size to the angle. + static uint16_t ViewportSizeToAngle(int32_t aWidth, int32_t aHeight); + + // Converts the viewport size to the orientation type. + static dom::OrientationType ViewportSizeToOrientationType(int32_t aWidth, + int32_t aHeight); + + // Returns the default orientation type for the given platform. + static dom::OrientationType GetDefaultOrientationType(); + private: nsresult Init(); View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/c4c73e… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/c4c73e… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-128.3.0esr-14.0-1] Bug 1918009 - Fix the RFP-spoofed User-Agent header. r=tjr
by morgan (@morgan) 02 Oct '24

02 Oct '24
morgan pushed to branch mullvad-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Mullvad Browser Commits: 92d9fad9 by Pier Angelo Vendrame at 2024-10-02T18:50:03+00:00 Bug 1918009 - Fix the RFP-spoofed User-Agent header. r=tjr The spoofed value of the HTTP user-agent header is not consistent with the value of navigator.userAgent on Windows, and this can lead to compatibility issues. Differential Revision: https://phabricator.services.mozilla.com/D223745 - - - - - 3 changed files: - browser/components/resistfingerprinting/test/browser/browser_navigator.js - browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js - toolkit/components/resistfingerprinting/nsRFPService.h Changes: ===================================== browser/components/resistfingerprinting/test/browser/browser_navigator.js ===================================== @@ -115,11 +115,11 @@ const SPOOFED_UA_NAVIGATOR_OS = { other: "X11; Linux x86_64", }; const SPOOFED_UA_HTTPHEADER_OS = { - linux: "Windows NT 10.0", - win: "Windows NT 10.0", - macosx: "Windows NT 10.0", + linux: "Windows NT 10.0; Win64; x64", + win: "Windows NT 10.0; Win64; x64", + macosx: "Windows NT 10.0; Win64; x64", android: "Android 10; Mobile", - other: "Windows NT 10.0", + other: "Windows NT 10.0; Win64; x64", }; const SPOOFED_HW_CONCURRENCY = 2; ===================================== browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js ===================================== @@ -130,11 +130,11 @@ const SPOOFED_UA_NAVIGATOR_OS = { other: "X11; Linux x86_64", }; const SPOOFED_UA_HTTPHEADER_OS = { - linux: "Windows NT 10.0", - win: "Windows NT 10.0", - macosx: "Windows NT 10.0", + linux: "Windows NT 10.0; Win64; x64", + win: "Windows NT 10.0; Win64; x64", + macosx: "Windows NT 10.0; Win64; x64", android: "Android 10; Mobile", - other: "Windows NT 10.0", + other: "Windows NT 10.0; Win64; x64", }; const SPOOFED_HW_CONCURRENCY = 2; ===================================== toolkit/components/resistfingerprinting/nsRFPService.h ===================================== @@ -63,7 +63,7 @@ #if defined(MOZ_WIDGET_ANDROID) # define SPOOFED_HTTP_UA_OS "Android 10; Mobile" #else -# define SPOOFED_HTTP_UA_OS "Windows NT 10.0" +# define SPOOFED_HTTP_UA_OS "Windows NT 10.0; Win64; x64" #endif struct JSContext; View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/92d… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/92d… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][base-browser-128.3.0esr-14.0-1] Bug 1918009 - Fix the RFP-spoofed User-Agent header. r=tjr
by morgan (@morgan) 02 Oct '24

02 Oct '24
morgan pushed to branch base-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser Commits: dbdddf48 by Pier Angelo Vendrame at 2024-10-02T18:49:35+00:00 Bug 1918009 - Fix the RFP-spoofed User-Agent header. r=tjr The spoofed value of the HTTP user-agent header is not consistent with the value of navigator.userAgent on Windows, and this can lead to compatibility issues. Differential Revision: https://phabricator.services.mozilla.com/D223745 - - - - - 3 changed files: - browser/components/resistfingerprinting/test/browser/browser_navigator.js - browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js - toolkit/components/resistfingerprinting/nsRFPService.h Changes: ===================================== browser/components/resistfingerprinting/test/browser/browser_navigator.js ===================================== @@ -115,11 +115,11 @@ const SPOOFED_UA_NAVIGATOR_OS = { other: "X11; Linux x86_64", }; const SPOOFED_UA_HTTPHEADER_OS = { - linux: "Windows NT 10.0", - win: "Windows NT 10.0", - macosx: "Windows NT 10.0", + linux: "Windows NT 10.0; Win64; x64", + win: "Windows NT 10.0; Win64; x64", + macosx: "Windows NT 10.0; Win64; x64", android: "Android 10; Mobile", - other: "Windows NT 10.0", + other: "Windows NT 10.0; Win64; x64", }; const SPOOFED_HW_CONCURRENCY = 2; ===================================== browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js ===================================== @@ -130,11 +130,11 @@ const SPOOFED_UA_NAVIGATOR_OS = { other: "X11; Linux x86_64", }; const SPOOFED_UA_HTTPHEADER_OS = { - linux: "Windows NT 10.0", - win: "Windows NT 10.0", - macosx: "Windows NT 10.0", + linux: "Windows NT 10.0; Win64; x64", + win: "Windows NT 10.0; Win64; x64", + macosx: "Windows NT 10.0; Win64; x64", android: "Android 10; Mobile", - other: "Windows NT 10.0", + other: "Windows NT 10.0; Win64; x64", }; const SPOOFED_HW_CONCURRENCY = 2; ===================================== toolkit/components/resistfingerprinting/nsRFPService.h ===================================== @@ -63,7 +63,7 @@ #if defined(MOZ_WIDGET_ANDROID) # define SPOOFED_HTTP_UA_OS "Android 10; Mobile" #else -# define SPOOFED_HTTP_UA_OS "Windows NT 10.0" +# define SPOOFED_HTTP_UA_OS "Windows NT 10.0; Win64; x64" #endif struct JSContext; View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/dbdddf4… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/dbdddf4… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-128.3.0esr-14.0-1] Bug 1918009 - Fix the RFP-spoofed User-Agent header. r=tjr
by morgan (@morgan) 02 Oct '24

02 Oct '24
morgan pushed to branch tor-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser Commits: c4c73ea4 by Pier Angelo Vendrame at 2024-10-02T18:31:19+00:00 Bug 1918009 - Fix the RFP-spoofed User-Agent header. r=tjr The spoofed value of the HTTP user-agent header is not consistent with the value of navigator.userAgent on Windows, and this can lead to compatibility issues. Differential Revision: https://phabricator.services.mozilla.com/D223745 - - - - - 3 changed files: - browser/components/resistfingerprinting/test/browser/browser_navigator.js - browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js - toolkit/components/resistfingerprinting/nsRFPService.h Changes: ===================================== browser/components/resistfingerprinting/test/browser/browser_navigator.js ===================================== @@ -115,11 +115,11 @@ const SPOOFED_UA_NAVIGATOR_OS = { other: "X11; Linux x86_64", }; const SPOOFED_UA_HTTPHEADER_OS = { - linux: "Windows NT 10.0", - win: "Windows NT 10.0", - macosx: "Windows NT 10.0", + linux: "Windows NT 10.0; Win64; x64", + win: "Windows NT 10.0; Win64; x64", + macosx: "Windows NT 10.0; Win64; x64", android: "Android 10; Mobile", - other: "Windows NT 10.0", + other: "Windows NT 10.0; Win64; x64", }; const SPOOFED_HW_CONCURRENCY = 2; ===================================== browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js ===================================== @@ -130,11 +130,11 @@ const SPOOFED_UA_NAVIGATOR_OS = { other: "X11; Linux x86_64", }; const SPOOFED_UA_HTTPHEADER_OS = { - linux: "Windows NT 10.0", - win: "Windows NT 10.0", - macosx: "Windows NT 10.0", + linux: "Windows NT 10.0; Win64; x64", + win: "Windows NT 10.0; Win64; x64", + macosx: "Windows NT 10.0; Win64; x64", android: "Android 10; Mobile", - other: "Windows NT 10.0", + other: "Windows NT 10.0; Win64; x64", }; const SPOOFED_HW_CONCURRENCY = 2; ===================================== toolkit/components/resistfingerprinting/nsRFPService.h ===================================== @@ -63,7 +63,7 @@ #if defined(MOZ_WIDGET_ANDROID) # define SPOOFED_HTTP_UA_OS "Android 10; Mobile" #else -# define SPOOFED_HTTP_UA_OS "Windows NT 10.0" +# define SPOOFED_HTTP_UA_OS "Windows NT 10.0; Win64; x64" #endif struct JSContext; View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/c4c73ea… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/c4c73ea… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-128.3.0esr-14.0-1] fixup! Firefox preference overrides.
by morgan (@morgan) 02 Oct '24

02 Oct '24
morgan pushed to branch mullvad-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Mullvad Browser Commits: 37ace560 by Morgan at 2024-10-02T17:36:53+00:00 fixup! Firefox preference overrides. Bug 43164: Prevent search-bar from being auto-hidden when not used for awhile - - - - - 1 changed file: - browser/app/profile/001-base-profile.js Changes: ===================================== browser/app/profile/001-base-profile.js ===================================== @@ -9,6 +9,11 @@ pref("intl.locale.requested", ""); pref("browser.startup.homepage", "about:blank"); pref("browser.newtabpage.enabled", false); +// tor-browser#43164: Prevent search-bar from being auto-hidden when not used for awhile +// This preference is locked so that the browser itself can never set an actual +// value that would trigger the migration. +pref("browser.search.widget.lastUsed", "", locked); + // Disable initial homepage notifications pref("browser.search.update", false); pref("startup.homepage_welcome_url", ""); View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/37a… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/37a… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][base-browser-128.3.0esr-14.0-1] fixup! Firefox preference overrides.
by morgan (@morgan) 02 Oct '24

02 Oct '24
morgan pushed to branch base-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser Commits: e25795c4 by Morgan at 2024-10-02T17:34:44+00:00 fixup! Firefox preference overrides. Bug 43164: Prevent search-bar from being auto-hidden when not used for awhile - - - - - 1 changed file: - browser/app/profile/001-base-profile.js Changes: ===================================== browser/app/profile/001-base-profile.js ===================================== @@ -9,6 +9,11 @@ pref("intl.locale.requested", ""); pref("browser.startup.homepage", "about:blank"); pref("browser.newtabpage.enabled", false); +// tor-browser#43164: Prevent search-bar from being auto-hidden when not used for awhile +// This preference is locked so that the browser itself can never set an actual +// value that would trigger the migration. +pref("browser.search.widget.lastUsed", "", locked); + // Disable initial homepage notifications pref("browser.search.update", false); pref("startup.homepage_welcome_url", ""); View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/e25795c… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/e25795c… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-128.3.0esr-14.0-1] fixup! Firefox preference overrides.
by morgan (@morgan) 02 Oct '24

02 Oct '24
morgan pushed to branch tor-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser Commits: 019449c4 by Morgan at 2024-10-02T17:32:43+00:00 fixup! Firefox preference overrides. Bug 43164: Prevent search-bar from being auto-hidden when not used for awhile - - - - - 1 changed file: - browser/app/profile/001-base-profile.js Changes: ===================================== browser/app/profile/001-base-profile.js ===================================== @@ -9,6 +9,11 @@ pref("intl.locale.requested", ""); pref("browser.startup.homepage", "about:blank"); pref("browser.newtabpage.enabled", false); +// tor-browser#43164: Prevent search-bar from being auto-hidden when not used for awhile +// This preference is locked so that the browser itself can never set an actual +// value that would trigger the migration. +pref("browser.search.widget.lastUsed", "", locked); + // Disable initial homepage notifications pref("browser.search.update", false); pref("startup.homepage_welcome_url", ""); View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/019449c… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/019449c… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser-build] Pushed new tag tbb-13.5a11-build1
by morgan (@morgan) 02 Oct '24

02 Oct '24
morgan pushed new tag tbb-13.5a11-build1 at The Tor Project / Applications / tor-browser-build -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/tree/tbb… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.