Gecko user agent string reference

  • Revision slug: Gecko_user_agent_string_reference
  • Revision title: Gecko user agent string reference
  • Revision id: 8180
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment cleanup; 14 words added, 83 words removed

Revision Content

{{ gecko_minversion_inline("2.0") }}

This document describes the user agent string used in Firefox 4. See Gecko User Agent Strings for historical user agent string information.

General form

The UA string is broken down into four components:

Mozilla/5.0 (platform; rv:geckoversion) Gecko/build Firefox/appversion

Mozilla/5.0 is the general token that says the browser is Mozilla compatible, and is common to almost every browser today. (platform; rv:geckoversion) describes the native platform the browser is running on (e.g. Windows, Mac, or Linux), and the release version of Gecko (such as "2.0.1"). Gecko/build indicates that the browser is based on Gecko, and provides the build id (in yyyymmdd form) indicating the release date of the browser. Firefox/appversion indicates the browser is Firefox, and provides the version (such as "4.0.1"). (Note that this component will be different for various Gecko-based browsers -- for instance Fennec, or Seamonkey -- which behave very similarly to Firefox. In most cases, sniffing for the "Gecko/" string is more appropriate.)

For Firefox Mobile, otherwise known as Fennec, the UA string also contains Fennec/fennecversion appended at the end. (For the upcoming Fennec 2.0 release, fennecversion will be "2.0.1".) This means the browser identifies itself both as Firefox and Fennec, for compatibility with existing sites.

Windows

Windows useragents have the following variations, where x.y is the Windows NT or Windows CE version (for instance, Windows NT 6.1).

Windows NT on x86 Mozilla/5.0 (Windows NT x.y; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1
Windows NT, Win64 on x64
Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1
Windows NT, Win64 on IA64
Mozilla/5.0 (Windows NT x.y; Win64; IA64; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1
Windows NT, WoW64
Mozilla/5.0 (Windows NT x.y; WOW64; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1
Windows CE
Mozilla/5.0 (WindowsCE x.y; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1

Macintosh

Here, x.y is the version of Mac OS X (for instance, Mac OS X 10.6).

Mac OS X on Intel x86 or x86_64 Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1
Mac OS X on PowerPC Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1

Linux

Linux is a more diverse platform. A few common examples are given below.

Linux desktop, x86 Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1
Linux desktop, x86_64 Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1
Android Linux mobile Mozilla/5.0 (Android; Linux armv7l; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1 Fennec/2.0.1
Nokia N900 Linux mobile Mozilla/5.0 (X11; Linux armv7l; rv:2.0.1) Gecko/yyyymmdd Firefox/4.0.1 Fennec/2.0.1

See Also


Comments to mozilla.dev.platform or dwitte@mozilla.com

Revision Source

<p>{{ gecko_minversion_inline("2.0") }}</p>
<p>This document describes the user agent string used in Firefox 4. See <a href="/en/Gecko_User_Agent_Strings" title="en/Gecko User Agent Strings">Gecko User Agent Strings</a> for historical user agent string information.</p>
<h2><span id="proposal">General form<br>
</span></h2>
<p>The UA string is broken down into four components:</p>
<p style="margin-left: 40px;"><span style="font-size: medium;"><strong>Mozilla/5.0 (<em>platform</em>; rv:<em>geckoversion</em>) Gecko/<em>build</em> Firefox/<em>appversion</em></strong></span></p>
<p><em><strong>Mozilla/5.0</strong></em> is the general token that says the browser is Mozilla compatible, and is common to almost every browser today. <strong><em>(platform; </em>rv:<em>geckoversion)</em></strong> describes the native platform the browser is running on (e.g. Windows, Mac, or Linux), and the release version of Gecko (such as <em>"2.0.1"</em>). <strong><em>Gecko/build</em></strong> indicates that the browser is based on Gecko, and provides the build id (in <em>yyyymmdd</em> form) indicating the release date of the browser. <em><strong>Firefox/appversion</strong></em> indicates the browser is Firefox, and provides the version (such as "<em>4.0.1"</em>). (Note that this component will be different for various Gecko-based browsers -- for instance Fennec, or Seamonkey -- which behave very similarly to Firefox. In most cases, sniffing for the "<em>Gecko/</em>" string is more appropriate.)</p>
<p>For Firefox Mobile, otherwise known as Fennec, the UA string also contains <em><strong>Fennec/fennecversion</strong></em> appended at the end. (For the upcoming Fennec 2.0 release, <em>fennecversion</em> will be "<em>2.0.1</em>".) This means the browser identifies itself both as Firefox and Fennec, for compatibility with existing sites.</p>
<h3>Windows</h3>
<p>Windows useragents have the following variations, where <em>x.y</em> is the Windows NT or Windows CE version (for instance, Windows NT 6.1).</p>
<table border="0" cellpadding="1" cellspacing="1" style="width: 100%;"> <tbody> <tr style="height: 40px;"> <td><strong>Windows NT on x86</strong></td> <td>Mozilla/5.0 (Windows NT <em>x</em>.<em>y</em>; rv:2.0.1) Gecko/<em>yyyymmdd</em> Firefox/4.0.1</td> </tr> <tr style="height: 40px;"> <td><strong>Windows NT, Win64 on x64<br> </strong></td> <td>Mozilla/5.0 (Windows NT <em>x</em>.<em>y</em>; Win64; x64; rv:2.0.1) Gecko/<em>yyyymmdd</em> Firefox/4.0.1</td> </tr> <tr style="height: 40px;"> <td><strong>Windows NT, Win64 on IA64<br> </strong></td> <td>Mozilla/5.0 (Windows NT <em>x</em>.<em>y</em>; Win64; IA64; rv:2.0.1) Gecko/<em>yyyymmdd</em> Firefox/4.0.1</td> </tr> <tr style="height: 40px;"> <td><strong>Windows NT, WoW64<br> </strong></td> <td>Mozilla/5.0 (Windows NT <em>x</em>.<em>y</em>; WOW64; rv:2.0.1) Gecko/<em>yyyymmdd</em> Firefox/4.0.1</td> </tr> <tr style="height: 40px;"> <td><strong>Windows CE<br> </strong></td> <td>Mozilla/5.0 (WindowsCE <em>x</em>.<em>y</em>; rv:2.0.1) Gecko/<em>yyyymmdd</em> Firefox/4.0.1</td> </tr> </tbody>
</table>
<h3>Macintosh</h3>
<p>Here, <em>x.y</em> is the version of Mac OS X (for instance, Mac OS X 10.6).</p>
<table border="0" cellpadding="1" cellspacing="1" style="width: 966px; height: 35px;"> <tbody> <tr style="height: 40px;"> <td><strong>Mac OS X on Intel x86 or x86_64</strong></td> <td>Mozilla/5.0 (Macintosh; Intel Mac OS X <em>x.y</em>; rv:2.0.1) Gecko/<em>yyyymmdd</em> Firefox/4.0.1</td> </tr> <tr style="height: 40px;"> <td><strong>Mac OS X on PowerPC</strong></td> <td>Mozilla/5.0 (Macintosh; Intel Mac OS X <em>x.y</em>; rv:2.0.1) Gecko/<em>yyyymmdd</em> Firefox/4.0.1</td> </tr> </tbody>
</table>
<h3>Linux</h3>
<p>Linux is a more diverse platform. A few common examples are given below.</p>
<table border="0" cellpadding="1" cellspacing="1" style="width: 966px; height: 35px;"> <tbody> <tr style="height: 40px;"> <td><strong>Linux desktop, x86</strong></td> <td>Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/<em>yyyymmdd</em> Firefox/4.0.1</td> </tr> <tr style="height: 40px;"> <td><strong>Linux desktop, x86_64</strong></td> <td>Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/<em>yyyymmdd</em> Firefox/4.0.1</td> </tr> <tr style="height: 40px;"> <td><strong>Android Linux mobile</strong></td> <td>Mozilla/5.0 (Android; Linux armv7l; rv:2.0.1) Gecko/<em>yyyymmdd</em> Firefox/4.0.1 Fennec/2.0.1</td> </tr> <tr style="height: 40px;"> <td><strong>Nokia N900 Linux mobile</strong></td> <td>Mozilla/5.0 (X11; Linux armv7l; rv:2.0.1) Gecko/<em>yyyymmdd</em> Firefox/4.0.1 Fennec/2.0.1</td> </tr> </tbody>
</table>
<h3>See Also</h3>
<ul> <li><a class=" external" href="http://blog.mozilla.com/dwitte/2010/08/24/user-agent-string-changes-coming-in-firefox-4/" title="http://blog.mozilla.com/dwitte/2010/08/24/user-agent-string-changes-coming-in-firefox-4/">Changes in the UA string for Firefox 4</a></li> <li>Recommendations on <a href="/en/Browser_Detection_and_Cross_Browser_Support" title="en/Browser_Detection_and_Cross_Browser_Support">sniffing the UA string for cross-browser support</a>.</li>
</ul>
<hr>
<p>Comments to <a class="link-news" href="news://news.mozilla.org/netscape.public.mozilla.netlib">mozilla.dev.platform</a> or <a class="link-mailto" href="mailto:dbaron@dbaron.org">dwitte@mozilla.com</a></p>
Revert to this revision