navigator.platform returns "Win64" in Firefox on Win64 OS but "Win32" in Chrome and Edge

RESOLVED FIXED in Firefox 63

Status

()

P3
normal
RESOLVED FIXED
9 months ago
3 months ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

(5 keywords)

62 Branch
mozilla63
x86_64
Windows
compat, dev-doc-complete, parity-chrome, parity-edge, site-compat
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox-esr52 wontfix, firefox-esr60 wontfix, firefox61 wontfix, firefox62 wontfix, firefox63 fixed)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

9 months ago
Bug 483118 made navigator.platform return "Win64" for 64-bit Firefox because 64-bit IE (presumably IE8 because the bug was filed in 2009) returned "Win64". But today in 2018, 64-bit Chrome and Edge return "Win32" even though their User-Agent strings say "Win64; x64". 64-bit IE11 still returns "Win64" but 32-bit IE11 is the default version on Windows 10.

Since Chrome and Edge return "Win32", Firefox probably should, too. That said, I don't know of any actual webcompat issues caused by this difference.

javascript:alert(navigator.platform)
(In reply to Chris Peterson [:cpeterson] from comment #0)
> Since Chrome and Edge return "Win32", Firefox probably should, too. That
> said, I don't know of any actual webcompat issues caused by this difference.

Chris, you set this bug as blocking bug 1383495.
But you are talking about the return value for normal mode, not just for resist fingerprinting. Is that correct?
Flags: needinfo?(cpeterson)
(Assignee)

Comment 2

9 months ago
(In reply to Ethan Tseng [:ethan] from comment #1)
> Chris, you set this bug as blocking bug 1383495.
> But you are talking about the return value for normal mode, not just for
> resist fingerprinting. Is that correct?

This bug is not about fingerprinting because the real platform (Win64) is still revealed in navigator.oscpu and navigator.userAgent. Bug 1383495 hard coded navigator.platform to return "Win64" in resist fingering mode (SPOOFED_PLATFORM). I made this bug block that one because, if we fix this bug, we should revert bug 1383495 so resist fingerprinting mode matches normal mode.
Flags: needinfo?(cpeterson)
(In reply to Chris Peterson [:cpeterson] from comment #2)
Very clear. Thank you, Chris!
(Assignee)

Comment 4

9 months ago
For comparison:

FIREFOX 61
navigator.userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"
navigator.platform = "Win64"

CHROME 68
navigator.userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.42 Safari/537.36"
navigator.platform = "Win32"

EDGE 17
navigator.userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134"
navigator.platform = "Win32"

IE11 (64-bit)
navigator.userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; Trident/7.0; Touch; rv:11.0) like Gecko"
navigator.platform = "Win64"
Assignee: nobody → cpeterson
status-firefox62: affected → wontfix
(Assignee)

Comment 5

9 months ago
Searching for uses of navigator.platform on GitHub, I quickly found some buggy code that would break in Win64 Firefox. This function will return undefined because it assumes navigator.platform must be "Win32" or "Windows" on Windows. This isn't even old code: it was written in May 2018 when Win64 Firefox was used by 70% of Firefox users.

https://github.com/569835014/plugins/blob/e39da6162ce8d2e99b874c303cb2bb90a839a759/libraries/util/tool/detection/device.js#L4
(Assignee)

Comment 6

9 months ago
And some code proposed in this Gecko Profiler issue mistakenly assumes that navigator.platform is always "Win32" on Windows. :)

https://github.com/devtools-html/Gecko-Profiler-Addon/issues/42
Comment hidden (mozreview-request)
(Assignee)

Updated

9 months ago
status-firefox62: wontfix → affected
Summary: navigator.platform returns "Win64" in Firefox but "Win32" in Chrome and Edge → navigator.platform returns "Win64" in Firefox but "Win32" in Chrome and Edge on Win64 OS

Comment 9

8 months ago
mozreview-review
Comment on attachment 8989331 [details]
Bug 1472618 - Make navigator.platform return "Win32", even on Win64 OS.

https://reviewboard.mozilla.org/r/254400/#review262812

Let's try.
Attachment #8989331 - Flags: review?(peterv) → review+

Comment 10

8 months ago
Pushed by cpeterson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/16581950a2b9
Make navigator.platform return "Win32", even on Win64 OS. r=peterv
(Assignee)

Comment 11

8 months ago
Thanks!
status-firefox62: affected → wontfix
Summary: navigator.platform returns "Win64" in Firefox but "Win32" in Chrome and Edge on Win64 OS → navigator.platform returns "Win64" in Firefox on Win64 OS but "Win32" in Chrome and Edge

Comment 12

8 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/16581950a2b9
Status: NEW → RESOLVED
Last Resolved: 8 months ago
status-firefox63: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Keywords: dev-doc-needed
Docs updated:

https://developer.mozilla.org/en-US/docs/Web/API/NavigatorID/platform

And mentioned on Firefox 63 for developers.
Keywords: dev-doc-needed → dev-doc-complete

Comment 15

5 months ago
This seems like an obvious regression. Chrome and Edge should change to return the correct value, instead. In fact, Edge allegedly only returns Win32 because Chrome does.
You need to log in before you can comment on or make changes to this bug.