Skip to content

Commit

Permalink
Update Firefox user agent string (#34050)
Browse files Browse the repository at this point in the history
* Update Firefox user agent string

* Update files/en-us/web/http/headers/user-agent/firefox/index.md

* Update files/en-us/web/http/headers/user-agent/firefox/index.md

* Update files/en-us/web/http/headers/user-agent/firefox/index.md

---------

Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
Co-authored-by: Estelle Weyl <estelle@weyl.org>
  • Loading branch information
3 people authored Jun 11, 2024
1 parent c74f336 commit 3e4bf66
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions files/en-us/web/http/headers/user-agent/firefox/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ For other products based on Gecko, the string can take one of two forms, where t
- `appname/appversion` indicates the application name and version. For instance, this could be "`Camino/2.1.1`", or "`SeaMonkey/2.7.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!

Prior to Firefox 4 and Gecko 2.0, it was possible for extensions and plug-ins to add user agent parts, but that has not been possible since [Firefox bug 581008](https://bugzil.la/581008).

## Mobile and Tablet indicators

The `platform` part of the UA string indicates if Firefox is running on a phone-sized or tablet device. When Firefox runs on a device that has the phone form factor, there is a `Mobile;` token in the `platform` part of the UA string. When Firefox runs on a tablet device, there is a `Tablet;` token in the `platform` part of the UA string instead. For example:
Expand All @@ -54,6 +52,20 @@ The preferred way to target content to a device form factor is to use CSS Media

Windows user agents have the following variations, where _x.y_ is the Windows NT version (for instance, Windows NT 6.1).

| Windows version | Gecko user agent string |
| -------------------------------- | --------------------------------------------------------------------------------- |
| Windows NT on x86 or aarch64 CPU | Mozilla/5.0 (Windows NT _x_._y_; rv:10.0) Gecko/20100101 Firefox/10.0 |
| Windows NT on x64 CPU | Mozilla/5.0 (Windows NT _x_._y_; Win64; x64; rv:10.0) Gecko/20100101 Firefox/10.0 |

## MacOS

Here, _x.y_ is the version of macOS (for instance, macOS 10.15). Starting in Firefox 87, Firefox caps the reported macOS version number to 10.15, so macOS 11.0 Big Sur and later will be reported as "10.15" in the User-Agent string. ARM-based Macs will be reported as "Intel" in the User-Agent string.

| Mac OS X version | Gecko user agent string |
| ----------------------------------- | ---------------------------------------------------------------------------------- |
| Mac OS X on x86, x86_64, or aarch64 | Mozilla/5.0 (Macintosh; Intel Mac OS X _x.y_; rv:10.0) Gecko/20100101 Firefox/10.0 |
| Mac OS X on PowerPC | Mozilla/5.0 (Macintosh; PPC Mac OS X _x.y_; rv:10.0) Gecko/20100101 Firefox/10.0 |

## Linux

Linux is a more diverse platform. Your distribution of Linux might include an extension that changes your user-agent. A few common examples are given below.
Expand All @@ -63,16 +75,9 @@ Linux is a more diverse platform. Your distribution of Linux might include an ex
| Linux desktop on i686 CPU | Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0 |
| Linux desktop on x86_64 CPU | Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/10.0 |

## Android (version 40 and below)
## Firefox for Android

| Form factor | Gecko user agent string |
| ----------- | -------------------------------------------------------------- |
| Phone | Mozilla/5.0 (Android; Mobile; rv:40.0) Gecko/40.0 Firefox/40.0 |
| Tablet | Mozilla/5.0 (Android; Tablet; rv:40.0) Gecko/40.0 Firefox/40.0 |

## Android (version 41 and above)

Beginning in version 41, Firefox for Android will contain the Android version as part of the _platform_ token. For increased interoperability, if the browser is running on a version below 4 it will report 4.4. Android versions 4 and above will report the version accurately. Note that the same Gecko—with the same capabilities—is shipped to all versions of Android.
Firefox for Android contains the Android version as part of the _platform_ token. For increased interoperability, if the browser is running on a version below 4 it will report 4.4. Android versions 4 and above report the version accurately. Note that the same Gecko—with the same capabilities—is shipped to all versions of Android.

| Form factor | Gecko user agent string |
| ----------- | ------------------------------------------------------------------ |
Expand All @@ -97,15 +102,19 @@ Starting in Version 6, users can opt into using a GeckoView-based Focus for Andr
| 1.0 (WebView Tablet) | Mozilla/5.0 (Linux; Android 7.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/1.0 Chrome/59.0.3029.83 Safari/537.36 |
| 6.0 (GeckoView) | Mozilla/5.0 (Android 7.0; Mobile; rv:62.0) Gecko/62.0 Firefox/62.0 |

## Klar for Android
The Klar user agent is the same as [Focus](/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox#focus_for_ios).

## Firefox for iOS

Firefox for iOS uses the default Mobile Safari UA string, with an additional **FxiOS/\<version>** token on iPod and iPhone, similar to how [Chrome for iOS identifies itself](https://developer.chrome.com/docs/multidevice/user-agent/#chrome_for_ios_user_agent).

Since version 4.1, Klar for Android uses the same UA string as [Focus for Android](#focus_for_android). Before version 4.1, it sent a _Klar/\<version>_ _product/version_ token.
| Form factor | Firefox for iOS user agent string |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| iPod | Mozilla/5.0 (iPod touch; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) **FxiOS/1.0** Mobile/12F69 Safari/600.1.4 |
| iPhone | Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) **FxiOS/1.0** Mobile/12F69 Safari/600.1.4 |
| iPad | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15 |

| Klar Version (Rendering Engine) | User Agent string |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| 1.0 (WebView) | Mozilla/5.0 (Linux; Android 7.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Klar/1.0 Chrome/58.0.3029.83 Mobile Safari/537.36 |
| 4.1+ (WebView) | Mozilla/5.0 (Linux; Android 7.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Focus/4.1 Chrome/62.0.3029.83 Mobile Safari/537.36 |
| 6.0+ (GeckoView) | Mozilla/5.0 (Android 7.0; Mobile; rv:62.0) Gecko/62.0 Firefox/62.0 |
On iPad, the user agent string appears identically as Safari. For various issues related to the non-inclusion of `FxiOS` on iOS, see [mozilla-mobile/firefox-ios#6620](https://github.com/mozilla-mobile/firefox-ios/issues/6620).

## Focus for iOS

Expand Down Expand Up @@ -185,4 +194,4 @@ Firefox OS has a four-digit version number: `X.X.X.Y`. The first two digits are
## See also

- Recommendations on [sniffing the UA string for cross-browser support](/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent)
- [window.navigator.userAgent](/en-US/docs/Web/API/Window/navigator)
- [`navigator.userAgent`](/en-US/docs/Web/API/Window/navigator)

0 comments on commit 3e4bf66

Please sign in to comment.