User agent: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(dfn, AKA UA, replace incomplete dev guidance with a link to MDN instead for broader (and more up to date) guidance, mv FxOS to History, link to MDN user-agent for HTTP)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''User Agent''' string is a string which is visible in the HTTP headers of an HTTP client and in the navigator.userAgent object JavaScript for JS enabled client.
The '''<dfn>user agent</dfn>''' string (AKA <abbr>UA</abbr> string) is a string which is visible in the HTTP headers of an HTTP client and in the navigator.userAgent object JavaScript for JS enabled client.
 
For developer guidance about how to use the user agent string, see:
* https://developer.mozilla.org/en-US/docs/Glossary/User_agent


== HTTP ==
== HTTP ==
 
See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
For example on Firefox OS devices.
 
User-Agent: Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0


== Browsers with JavaScript ==
== Browsers with JavaScript ==
  var ua = navigator.userAgent;
  var ua = navigator.userAgent;


== Around this topic ==
== History ==
* on Firefox OS devices:
User-Agent: Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0


== See Also ==
* [https://developer.mozilla.org/en-US/docs/Glossary/User_agent MDN: User agent]
* [[Firefox/User Agent]]
* [[UA/override|User Agent Override]]
* [[UA/override|User Agent Override]]
* [[Compatibility/UADetectionLibraries|User Agent Detection Libraries]]
* [[Compatibility/UADetectionLibraries|User Agent Detection Libraries]]

Latest revision as of 21:16, 10 July 2024

The user agent string (AKA UA string) is a string which is visible in the HTTP headers of an HTTP client and in the navigator.userAgent object JavaScript for JS enabled client.

For developer guidance about how to use the user agent string, see:

HTTP

See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent

Browsers with JavaScript

var ua = navigator.userAgent;

History

  • on Firefox OS devices:
User-Agent: Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0

See Also