Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I check if the browser is running on a MAC? [closed]

As the title describes.

I need to see if the machine accessing my page is a MAC or something else

like image 800
TIMEX Avatar asked Feb 04 '26 18:02

TIMEX


1 Answers

You could check the userAgent like this:

return navigator.userAgent.indexOf(\"Mac OS X\") != -1

But, this isn't a reliable method as it can be spoofed...but since there is no javascript absolute for this, not a terrible option. Feature detection is a better alternative if you want to see what the browser will/won't support...depends if you're after metrics of actually enabling/disabling features.

like image 179
Nick Craver Avatar answered Feb 06 '26 07:02

Nick Craver



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!