bestiejs / platform.js

A platform detection library.
https://mths.be/platform
MIT License
3.22k stars 407 forks source link

Can we detect Apple M1/ARM machines? #202

Open Jehan opened 1 year ago

Jehan commented 1 year ago

We use platform.js on a website to show the right "download button" for our application (GIMP). For instance, Windows people would get the Windows installer button, macOS people would get a DMG download and Linux people would get a Flatpak link.

It's of course only a default and there are links to show and get downloads for other platforms, but it has been very nice so far to be able to guess the expected binary to show (instead of 10 buttons to choose from) at first.

Lately we are getting a DMG package for Apple M1 (arm 64-bit Apple machines). We are trying to find out how to detect this. Does the current version of platform.js provide an info which is reliable enough to guess which architecture variant of macOS one is using?