Closed
Bug 1472618
Opened 6 years ago
Closed 6 years ago
navigator.platform returns "Win64" in Firefox on Win64 OS but "Win32" in Chrome and Edge
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla63
People
(Reporter: cpeterson, Assigned: cpeterson)
References
()
Details
(5 keywords)
Attachments
(1 file)
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)
Comment 1•6 years ago
|
||
(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•6 years 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)
Comment 3•6 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #2) Very clear. Thank you, Chris!
Assignee | ||
Comment 4•6 years 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
Assignee | ||
Comment 5•6 years 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•6 years 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
Assignee | ||
Comment 7•6 years ago
|
||
Green Try run on Windows: https://treeherder.mozilla.org/#/jobs?repo=try&revision=c5030a4535c1c9efb6cf797c26a9997a41c482d7
Comment hidden (mozreview-request) |
Assignee | ||
Updated•6 years ago
|
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•6 years 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•6 years 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•6 years ago
|
||
Thanks!
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•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/16581950a2b9
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Comment 13•6 years ago
|
||
Posted the site compatibility note: https://www.fxsitecompat.com/en-CA/docs/2018/navigator-platform-now-returns-win32-even-on-64-bit-firefox/
Keywords: site-compat
Updated•6 years ago
|
Keywords: dev-doc-needed
Comment 14•6 years ago
|
||
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•6 years 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.
Description
•