Open Bug 1711835 Opened 3 years ago Updated 1 year ago

Make navigator.oscpu and navigator.platform a compile-time value on Linux

Categories

(Core :: DOM: Core & HTML, task, P3)

All
Linux
task

Tracking

()

People

(Reporter: cpeterson, Unassigned)

References

(Blocks 1 open bug)

Details

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:

https://searchfox.org/mozilla-central/rev/98a9257ca2847fad9a19631ac76199474516b31e/netwerk/protocol/http/nsHttpHandler.cpp#998-1019

And navigator.platform delegates to navigator.oscpu on Linux here:

https://searchfox.org/mozilla-central/rev/98a9257ca2847fad9a19631ac76199474516b31e/dom/base/Navigator.cpp#1867-1872

  // 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);
You need to log in before you can comment on or make changes to this bug.