trypear/pear-landing-page

[0][Easy]LandingPage] Download button + determine OS automatically

Closed this issue · 5 comments

We should have a download button directly on the navbar. This download button would be able to directly activate downloading depending on the user's OS.

  • Need function to determine user's OS automatically.
  • Need to test this functionality on multiple browsers to make sure works (chrome, safari, firefox, arc, opera, brave)

Can I take this?

@Fryingpannn @ICEPrey, what should the download behavior be for operating systems other than Windows and macOS?

Additionally, if macOS is detected, should we also identify the chip type, or should we display a popup where users can select the relevant chip?

@akash3444 For macOS, we should indeed determine the chip type.

For linux, it should link to a blogs page, which will contain linux info for download (#280)

Got it! @Fryingpannn what should the download behavior be when the OS is detected as Android, iOS, or something else?

@Fryingpannn
I ran into some trouble figuring out how to detect the chip type on a user's macOS system. Oddly enough, the user-agent string always says Intel even for Macs with Apple Silicon chips.

A better way to get the system architecture is by using navigator.userAgentData.getHighEntropyValues(['architecture']). This method gives you the system’s architecture, where arm means it's an Apple Silicon chip, and x86 or x86_64 refers to an Intel chip (according to some AI tools—though I couldn’t confirm this since I don’t have an Intel-based Mac to test it on). This is also not supported in browsers such as Firefox, Safari, etc.