Gecko user agent string reference

  • Revision slug: Gecko_user_agent_string_reference
  • Revision title: Gecko user agent string reference
  • Revision id: 8193
  • Created:
  • Creator: Dwitte
  • Is current revision? No
  • Comment 52 words added, 9 words removed

Revision Content

{{ gecko_minversion_header("2.0") }}

This document describes the user agent string used in Firefox 4 and applications based on Gecko 2.0. For a breakdown of changes to the string in Gecko 2.0, see Final User Agent string for Firefox 4 (blog post). For a list of User Agent strings suitable for testing purposes, including versions prior to Gecko 2.0 and probable strings for future major Gecko versions, see this text file.

General form

The UA string of Firefox itself is broken down into four components:

Mozilla/5.0 (platform; rv:geckoversion) Gecko/yyymmdd 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 describes the native platform the browser is running on (e.g. Windows, Mac, or Linux). See below for further details and examples.
  • rv:geckoversion indicates the release version of Gecko (such as "2.0.1"). For prerelease versions, it may look something like "2.0b5pre" or "2.0.2pre".
  • Gecko/yyyymmdd indicates that the browser is based on Gecko. yyyymmdd is always "20100101" in release builds and does not represent the actual build date of the browser. (The recommended way of sniffing for a particular release of Gecko or Firefox is the version number.) For development (prerelease) builds, the build id presently indicates the build date of the browser, but this will very likely be removed in future.
  • Firefox/appversion indicates the browser is Firefox, and provides the version (such as "4.0.1"). Note that this token will be different for other products based on Gecko — see below for details.

Note: the Gecko/build token will be replaced by "Gecko/geckoversion" in the next major release. Do not rely on the presence of the "yyyymmdd" string! The recommended way of sniffing for Gecko-based browsers is by the presence of "Gecko/", since some other browsers include a "like Gecko" token. In addition, the "rv:geckoversion" token may be removed in the future. If this token is not present, the Gecko version should be obtained from the "Gecko/geckoversion" string.

For other products based on Gecko, the string can take one of two forms, where the tokens have the same meaning except those noted below:

Mozilla/5.0 (platform; rv:geckoversion) Gecko/yyyymmdd appname/appversion
M
ozilla/5.0 (platform; rv:geckoversion) Gecko/yyyymmdd Firefox/firefoxversion appname/appversion

  • appname/appversion indicates the application name and version. For instance, this could be "Fennec/2.0.1", "Camino/2.1.1", or "SeaMonkey/2.1.1".
  • Firefox/firefoxversion is an optional compatibility token that some Gecko-based browsers may choose to incorporate, to achieve maximum compatibility with websites that expect Firefox.  firefoxversion will generally represent the equivalent Firefox release corresponding to the given Gecko version. Some Gecko-based browsers may not opt into using this token; for this reason, sniffers should be looking for Gecko — not Firefox! Whether this token appears is controlled by the "general.useragent.compatMode.firefox" boolean pref.

Windows

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

Windows version Gecko user agent string
Windows NT on x86 Mozilla/5.0 (Windows NT x.y; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Windows NT, Win64 on x64 Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Windows NT, WOW64 Mozilla/5.0 (Windows NT x.y; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Windows CE Mozilla/5.0 (WindowsCE x.y; rv:2.0.1) Gecko/20100101 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 version Gecko user agent string
Mac OS X on Intel x86 or x86_64 Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Mac OS X on PowerPC Mozilla/5.0 (Macintosh; PPC Mac OS X x.y; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

Linux

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

Linux version Gecko user agent string
Linux desktop, i686 Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Linux desktop, x86_64 Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Linux desktop, i686 running on x86_64 Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Android Linux mobile, on the Fennec browser Mozilla/5.0 (Android; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1
Nokia N900 Linux mobile, on the Fennec browser Mozilla/5.0 (Maemo; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1

Other Gecko-based browsers

These are some sample UA strings from other Gecko-based browsers on various platforms. Note that many of these have not yet been released on Gecko 2.0!

Browser Gecko user agent string
Fennec mobile on Android Mozilla/5.0 (Android; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1
Fennec mobile on Maemo/Meego (e.g. Nokia N900) Mozilla/5.0 (Maemo; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1
Fennec on an ARM-based desktop Mozilla/5.0 (X11; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1
Fennec on an i686 desktop Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1
Camino on Mac Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Camino/2.2.1
SeaMonkey on Windows Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 SeaMonkey/2.1.1
SeaMonkey on Mac Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 SeaMonkey/2.1.1
SeaMonkey on Linux Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 SeaMonkey/2.1.1

See Also


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

Revision Source

<p>{{ gecko_minversion_header("2.0") }}</p>
<p>This document describes the user agent string used in Firefox 4 and applications based on Gecko 2.0. For a breakdown of changes to the string in Gecko 2.0, see <a class=" external" href="http://hacks.mozilla.org/2010/09/final-user-agent-string-for-firefox-4/" title="Final User Agent string for Firefox 4">Final User Agent string for Firefox 4</a> (blog post). For a list of User Agent strings suitable for testing purposes, including versions prior to Gecko 2.0 and probable strings for future major Gecko versions, see <a class=" external" href="http://people.mozilla.com/~dwitte/ua.txt" title="User Agent strings">this text file.</a></p>
<h2><span id="proposal">General form</span></h2>
<p>The UA string of Firefox itself 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>yyymmdd</em> Firefox/<em>appversion</em></strong></span></p>
<ul> <li><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.</li> <li><strong><em>platform</em></strong> describes the native platform the browser is running on (e.g. Windows, Mac, or Linux). See below for further details and examples.</li> <li><strong>rv:<em>geckoversion</em></strong> indicates the release version of Gecko (such as <em>"2.0.1"</em>). For prerelease versions, it may look something like "<em>2.0b5pre</em>" or "<em>2.0.2pre</em>".</li> <li><strong><em>Gecko/yyyymmdd</em></strong> indicates that the browser is based on Gecko. <strong><em>yyyymmdd</em></strong> is always "<em>20100101</em>" in release builds and does <strong>not</strong> represent the actual build date of the browser. (The recommended way of sniffing for a particular release of Gecko or Firefox is the version number.) For development (prerelease) builds, the build id presently indicates the build date of the browser, but this will very likely be removed in future.</li> <li> <p><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 token will be different for other products based on Gecko — see below for details.</p> </li>
</ul>
<p><strong>Note:</strong> the <strong><em>Gecko/build</em></strong> token will be replaced by "<em>Gecko/</em><strong><em>geckoversion</em></strong>" in the next major release. Do <strong>not</strong> rely on the presence of the "<em>yyyymmdd</em>" string! The recommended way of sniffing for Gecko-based browsers is by the presence of "<em>Gecko/</em>", since some other browsers include a "<em>like Gecko</em>" token. In addition, the "<strong>rv:<em>geckoversion</em></strong>" token may be removed in the future. If this token is not present, the Gecko version should be obtained from the "<em>Gecko/</em><strong><em>geckoversion</em></strong>" string.</p>
<p>For other products based on Gecko, the string can take one of two forms, where the tokens have the same meaning except those noted below:</p>
<p style="margin-left: 40px;"><span style="font-size: medium;"><strong>Mozilla/5.0 (<em>platform</em>; rv:<em>geckoversion</em>) Gecko/<em>yyyymmdd </em></strong></span><span style="font-size: medium;"><strong><em>appname</em>/<em>appversion<br>
</em></strong><strong>M</strong></span><span style="font-size: medium;"><strong>ozilla/5.0 (<em>platform</em>; rv:<em>geckoversion</em>) Gecko/<em>yyyymmdd</em></strong></span><span style="font-size: medium;"><strong> Firefox/<em>firefoxversion</em></strong></span><span style="font-size: medium;"><strong> <em>appname</em>/<em>appversion</em></strong></span></p>
<ul> <li><strong><em>appname/appversion</em></strong> indicates the application name and version. For instance, this could be "<em>Fennec/2.0.1</em>", "<em>Camino/2.1.1</em>", or "<em>SeaMonkey/2.1.1</em>".</li> <li> <p><em><strong>Firefox/firefoxversion</strong></em> is an optional compatibility token that some Gecko-based browsers may choose to incorporate, to achieve maximum compatibility with websites that expect Firefox.  <em><strong>firefoxversion</strong></em> will generally represent the equivalent Firefox release corresponding to the given Gecko version. Some Gecko-based browsers may not opt into using this token; for this reason, sniffers should be looking for Gecko — not Firefox! Whether this token appears is controlled by the <em>"general.useragent.compatMode.firefox"</em> boolean pref.</p> </li>
</ul>
<h2>Windows</h2>
<p>Windows user agents 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 class="standard-table"> <thead> <tr> <th scope="col">Windows version</th> <th scope="col">Gecko user agent string</th> </tr> </thead> <tbody> <tr> <td>Windows NT on x86</td> <td>Mozilla/5.0 (Windows NT <em>x</em>.<em>y</em>; rv:2.0.1) Gecko/20100101 Firefox/4.0.1</td> </tr> <tr> <td>Windows NT, Win64 on x64</td> <td>Mozilla/5.0 (Windows NT <em>x</em>.<em>y</em>; Win64; x64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1</td> </tr> <tr> <td>Windows NT, WOW64</td> <td>Mozilla/5.0 (Windows NT <em>x</em>.<em>y</em>; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1</td> </tr> <tr> <td>Windows CE</td> <td>Mozilla/5.0 (WindowsCE <em>x</em>.<em>y</em>; rv:2.0.1) Gecko/20100101 Firefox/4.0.1</td> </tr> </tbody>
</table>
<h2>Macintosh</h2>
<p>Here, <em>x.y</em> is the version of Mac OS X (for instance, Mac OS X 10.6).</p>
<table class="standard-table"> <thead> <tr> <th scope="col">Mac OS X version</th> <th scope="col">Gecko user agent string</th> </tr> </thead> <tbody> <tr> <td>Mac OS X on Intel x86 or x86_64</td> <td>Mozilla/5.0 (Macintosh; Intel Mac OS X <em>x.y</em>; rv:2.0.1) Gecko/20100101 Firefox/4.0.1</td> </tr> <tr> <td>Mac OS X on PowerPC</td> <td>Mozilla/5.0 (Macintosh; PPC Mac OS X <em>x.y</em>; rv:2.0.1) Gecko/20100101 Firefox/4.0.1</td> </tr> </tbody>
</table>
<h2>Linux</h2>
<p>Linux is a more diverse platform. A few common examples are given below.</p>
<table class="standard-table"> <thead> <tr> <th scope="col">Linux version</th> <th scope="col">Gecko user agent string</th> </tr> </thead> <tbody> <tr> <td>Linux desktop, i686</td> <td>Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1</td> </tr> <tr> <td>Linux desktop, x86_64</td> <td>Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1</td> </tr> <tr> <td>Linux desktop, i686 running on x86_64</td> <td>Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1</td> </tr> <tr> <td>Android Linux mobile, on the Fennec browser</td> <td>Mozilla/5.0 (Android; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1</td> </tr> <tr> <td>Nokia N900 Linux mobile, on the Fennec browser</td> <td>Mozilla/5.0 (Maemo; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1</td> </tr> </tbody>
</table>
<h2>Other Gecko-based browsers</h2>
<p>These are some sample UA strings from other Gecko-based browsers on various platforms. Note that many of these have not yet been released on Gecko 2.0!</p>
<table class="standard-table"> <thead> <tr> <th scope="col">Browser</th> <th scope="col">Gecko user agent string</th> </tr> </thead> <tbody> <tr> <td>Fennec mobile on Android</td> <td>Mozilla/5.0 (Android; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1</td> </tr> <tr> <td>Fennec mobile on Maemo/Meego (e.g. Nokia N900)</td> <td>Mozilla/5.0 (Maemo; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1</td> </tr> <tr> <td>Fennec on an ARM-based desktop</td> <td>Mozilla/5.0 (X11; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1</td> </tr> <tr> <td>Fennec on an i686 desktop</td> <td>Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1</td> </tr> <tr> <td>Camino on Mac</td> <td>Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Camino/2.2.1</td> </tr> <tr> <td>SeaMonkey on Windows</td> <td>Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 SeaMonkey/2.1.1</td> </tr> <tr> <td>SeaMonkey on Mac</td> <td>Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 SeaMonkey/2.1.1</td> </tr> <tr> <td>SeaMonkey on Linux</td> <td>Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 SeaMonkey/2.1.1</td> </tr> </tbody>
</table>
<h2>See Also</h2>
<ul> <li><a class=" external" href="http://hacks.mozilla.org/2010/09/final-user-agent-string-for-firefox-4/" title="Final User Agent string for Firefox 4">Final User Agent string for Firefox 4</a> (blog post)</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