Make navigator.oscpu and navigator.platform a compile-time value on Linux
Categories
(Core :: DOM: Core & HTML, task, P3)
Tracking
()
People
(Reporter: cpeterson, Assigned: cpeterson)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
When reviewing a patch for bug 1711628, hsivonen suggested making navigator.platform a compile-time value on Linux: https://phabricator.services.mozilla.com/D115333?id=439618#inline-640251
Bug 1559747 already made navigator.oscpu and navigator.platform return the CPU architecture the build was compiled for, not the architecture it is running on, i.e. return "Linux i686" instead of "Linux i686 on x86_64". So
oscpu is initialized here on Linux:
And navigator.platform delegates to navigator.oscpu on Linux here:
// XXX Communicator uses compiled-in build-time string defines
// to indicate the platform it was compiled *for*, not what it is
// currently running *on* which is what this does.
nsAutoCString plat;
rv = service->GetOscpu(plat);
CopyASCIItoUTF16(plat, aPlatform);
| Assignee | ||
Comment 1•1 year ago
|
||
This pref was added in Firefox 123 (by bug 1861847) to:
- Reduce fingerprintable entropy exposed to web content.
- Reduce risk of webcompat problems from unexpected CPU architectures (such as ARM64 Linux YouTube bug 1869521).
Now that this pref has baked in the Release channel for seven months without known regressions, we can remove the pref and simplify some UA string code.
Updated•1 year ago
|
| Assignee | ||
Comment 2•1 year ago
|
||
Now that navigator.platform has been frozen on the Android and Linux/etc, SPOOFED_PLATFORM can be removed because the old spoofed values match the new frozen values for all platforms: Windows, macOS, Android, and Linux/etc.
Even though navigator.platform's default and spoofed values are always the same, this change keeps RFPTarget::NavigatorPlatform enum value so we know whether to honor the "general.platform.override" pref: the pref should override the default platform, but the spoofed platform should override the pref.
Depends on D220360
| Assignee | ||
Updated•1 year ago
|
Comment 4•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/a54f7da4b4b4
https://hg.mozilla.org/mozilla-central/rev/463c46e86f2a
Description
•