commit a5648c8d80f396caf294d761cc4a9a76c0b33a9d Author: Arthur Edelstein arthuredelstein@gmail.com Date: Wed Apr 8 22:55:41 2015 -0700
fixup! Bug #5856: Do not expose physical screen info via window & window.screen. --- dom/base/nsGlobalWindow.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 9fc9c31..2f85d60 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -4867,9 +4867,9 @@ nsGlobalWindow::GetOuterSize(ErrorResult& aError) MOZ_ASSERT(IsOuterWindow());
if (!IsChrome()) { - CSSIntSize size; - aError = GetInnerSize(size); - return nsIntSize(size.width, size.height); + CSSIntSize size; + aError = GetInnerSize(size); + return nsIntSize(size.width, size.height); }
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin = GetTreeOwnerWindow(); @@ -5114,6 +5114,11 @@ nsGlobalWindow::GetDevicePixelRatio(ErrorResult& aError) { FORWARD_TO_OUTER_OR_THROW(GetDevicePixelRatio, (aError), aError, 0.0);
+ // For non-chrome callers, always return 1.0 to prevent fingerprinting. + if (!IsChrome()) { + return 1.0; + } + if (!mDocShell) { return 1.0; }
tbb-commits@lists.torproject.org