Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect apple computers using user-agent?

Tags:

user-agent

How to detect apple computers using user-agent ? Safari may be run in windows too

like image 843
Bdfy Avatar asked Jun 09 '12 11:06

Bdfy


People also ask

What is user agent detection?

The User-Agent (UA) is a string contained in the HTTP headers and is intended for browser detection: to identify the device/platform of the visiting user, and can be used to determine appropriate content to return.

What is AppleWebKit 537.36 Khtml like Gecko used for?

AppleWebKit/537.36 indicates what browser rendering engine is used. A rendering engine is what transforms HTML into an interactive webpage on the user's screen. The WebKit browser engine was developed by Apple and is primarily used by Safari, Chromium, and all other WebKit-based browsers. (KHTML, like Gecko).

Why do websites think my iPad is a Mac?

This is perhaps not surprising as both macOS and iPadOS Safari share a common codebase. By contrast, if your browser is configured to request the “Mobile” version of a webpage, it identifies identifies itself as Apple iPad Safari 13.2. So yes, in many cases, websites will think you are “some sort of mac”!


1 Answers

Look for Macintosh in User-Agent, trying this with my Mac browsers:

  • Your User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2
  • Your User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20100101 Firefox/12.0
  • Your User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.27 Safari/536.11

While safari for Windows has "Windows" instead of Macintosh:

  • Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4
like image 84
Jure C. Avatar answered Oct 07 '22 16:10

Jure C.