frc-docs
frc-docs copied to clipboard
WPILib install page fails to detect OS in Firefox or Safari
On https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-2/wpilib-setup.html I get the following error in the console.
Uncaught (in promise) TypeError: navigator.userAgentData is undefined
<anonymous> https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-2/wpilib-setup.html:926
The offending source code line:
https://github.com/wpilibsuite/frc-docs/blob/f8306ce0759e9ce5eb504178a16ae2e49e3de5d3/source/_extensions/wpilib_release.py#L86
That feature is only supported in Chrome because other browsers don't expose that api.
https://caniuse.com/mdn-api_navigator_useragentdata
Using navigator.oscpu would work on Windows Firefox. On macos:
- Chrome works currently
- Firefox doesn't currently work but could work in a hacky way: oscpu always returns MacIntel, even on arm macs. But loading webgpu and querying the gpu name will differentiate the 2 architectures.
- Safari doesn't work.