User agent sniffing
Widely available
The navigator.userAgent
read-only property returns the user agent string for the current browser. Selectively showing content based on the user agent string is unreliable. Consider using feature detection instead.
To learn more, see
Navigator: userAgent property,
WorkerNavigator: userAgent property at MDN.
Compatibility
- Chrome 4 Released on 2010-01-25
- Chrome Android 18 Released on 2012-06-27
- Edge 12 Released on 2015-07-29
- Firefox 3.5 Released on 2009-06-30
- Firefox for Android 4 Released on 2011-03-29
- Safari 4 Released on 2009-06-08
- Safari on iOS 5 Released on 2011-10-12
Specifications
- HTML Standard (#the-navigator-object), from HTML Workstream (WHATWG).