morgan pushed to branch tor-browser-153.1.0esr-16.0-1 at The Tor Project / Applications / Tor Browser Commits: 03e9a8f0 by Pier Angelo Vendrame at 2026-08-24T13:43:42+00:00 Bug 2059471: Do not spoof screen orientation when it is locked. r=tjr Differential Revision: https://phabricator.services.mozilla.com/D315317 - - - - - 1 changed file: - dom/base/ScreenOrientation.cpp Changes: ===================================== dom/base/ScreenOrientation.cpp ===================================== @@ -709,8 +709,11 @@ OrientationType ScreenOrientation::DeviceType(CallerType aCallerType) const { if (!bc) { return nsRFPService::GetDefaultOrientationType(); } - CSSIntSize size = bc->TopInnerSizeSpoofedForRFP(); - return nsRFPService::ViewportSizeToOrientationType(size.width, size.height); + if (bc->GetOrientationLock() == hal::ScreenOrientation::None) { + CSSIntSize size = bc->TopInnerSizeSpoofedForRFP(); + return nsRFPService::ViewportSizeToOrientationType(size.width, + size.height); + } } return mType; } @@ -723,8 +726,10 @@ uint16_t ScreenOrientation::DeviceAngle(CallerType aCallerType) const { if (!bc) { return 0; } - CSSIntSize size = bc->TopInnerSizeSpoofedForRFP(); - return nsRFPService::ViewportSizeToAngle(size.width, size.height); + if (bc->GetOrientationLock() == hal::ScreenOrientation::None) { + CSSIntSize size = bc->TopInnerSizeSpoofedForRFP(); + return nsRFPService::ViewportSizeToAngle(size.width, size.height); + } } return mAngle; } @@ -740,7 +745,8 @@ OrientationType ScreenOrientation::GetType(CallerType aCallerType, OrientationType orientation = bc->GetCurrentOrientationType(); if (nsContentUtils::ShouldResistFingerprinting( - aCallerType, GetRelevantGlobal(), RFPTarget::ScreenOrientation)) { + aCallerType, GetRelevantGlobal(), RFPTarget::ScreenOrientation) && + bc->GetOrientationLock() == hal::ScreenOrientation::None) { CSSIntSize size = bc->TopInnerSizeSpoofedForRFP(); return nsRFPService::ViewportSizeToOrientationType(size.width, size.height); } @@ -758,7 +764,8 @@ uint16_t ScreenOrientation::GetAngle(CallerType aCallerType, uint16_t angle = static_cast<uint16_t>(bc->GetCurrentOrientationAngle()); if (nsContentUtils::ShouldResistFingerprinting( - aCallerType, GetRelevantGlobal(), RFPTarget::ScreenOrientation)) { + aCallerType, GetRelevantGlobal(), RFPTarget::ScreenOrientation) && + bc->GetOrientationLock() == hal::ScreenOrientation::None) { CSSIntSize size = bc->TopInnerSizeSpoofedForRFP(); return nsRFPService::ViewportSizeToAngle(size.width, size.height); } View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/03e9a8f0... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/03e9a8f0... You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
participants (1)
-
morgan (@morgan)