commit a3cbc068df86e03a6420bc863be2793e35078fa3
Author: Chris Peterson <cpeterson(a)mozilla.com>
Date: Mon Jul 2 11:02:23 2018 -0700
Bug 1472618 - Make navigator.platform return "Win32", even on Win64 OS. r=peterv
navigator.platform returns "Win64" in 64-bit Firefox and IE, but "Win32" in 64-bit Chrome and Edge. "Win32" appears to be the de facto platform value for Windows. This change doesn't hide the OS architecture from web content because navigator.userAgent still mentions "Win64; x64" in 64-bit Firefox, Chrome, Edge, and IE.
MozReview-Commit-ID: CplYnGDQgTe
--HG--
extra : rebase_source : c00a1a7462ea91d44700dd0581c88c1c4cad2346
extra : source : 1976c327f251702be255a9d0769121c6bc5303a1
This fixes our bug 28740.
---
.../components/resistfingerprinting/test/browser/browser_navigator.js | 2 +-
dom/base/Navigator.cpp | 4 +---
toolkit/components/resistfingerprinting/nsRFPService.h | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/browser/components/resistfingerprinting/test/browser/browser_navigator.js b/browser/components/resistfingerprinting/test/browser/browser_navigator.js
index e0aaf6fb27fe..3736fcd33ce5 100644
--- a/browser/components/resistfingerprinting/test/browser/browser_navigator.js
+++ b/browser/components/resistfingerprinting/test/browser/browser_navigator.js
@@ -24,7 +24,7 @@ const SPOOFED_APPVERSION = {
};
const SPOOFED_PLATFORM = {
linux: "Linux x86_64",
- win: "Win64",
+ win: "Win32",
macosx: "MacIntel",
android: "Linux armv7l",
other: "Linux x86_64",
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index 33563ad65ccb..55d1f7a0474b 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1653,9 +1653,7 @@ Navigator::GetPlatform(nsAString& aPlatform, bool aUsePrefOverriddenValue)
// Sorry for the #if platform ugliness, but Communicator is likewise
// hardcoded and we are seeking backward compatibility here (bug 47080).
-#if defined(_WIN64)
- aPlatform.AssignLiteral("Win64");
-#elif defined(WIN32)
+#if defined(WIN32)
aPlatform.AssignLiteral("Win32");
#elif defined(XP_MACOSX) && defined(__ppc__)
aPlatform.AssignLiteral("MacPPC");
diff --git a/toolkit/components/resistfingerprinting/nsRFPService.h b/toolkit/components/resistfingerprinting/nsRFPService.h
index da79da8de948..4ed0c1d4cfaf 100644
--- a/toolkit/components/resistfingerprinting/nsRFPService.h
+++ b/toolkit/components/resistfingerprinting/nsRFPService.h
@@ -25,7 +25,7 @@
#define SPOOFED_UA_OS "Windows NT 6.1; Win64; x64"
#define SPOOFED_APPVERSION "5.0 (Windows)"
#define SPOOFED_OSCPU "Windows NT 6.1; Win64; x64"
-#define SPOOFED_PLATFORM "Win64"
+#define SPOOFED_PLATFORM "Win32"
#elif defined(XP_MACOSX)
#define SPOOFED_UA_OS "Macintosh; Intel Mac OS X 10.13"
#define SPOOFED_APPVERSION "5.0 (Macintosh)"