Compatibility/UADetectionLibraries: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(→‎User Agent Detection Libraries: Add link to use-cases)
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
= User Agent Detection Libraries =
= User Agent Detection Libraries =


This is a list of [[UserAgent|User Agent]] detection libraries to be tested for [[Compatibility/Mobile|compatibility with]] Firefox OS and Firefox for Android. This may also include general purpose JS libraries that include some kind of UA detection.
This is a list of [[UserAgent|User Agent]] detection libraries to be tested for [[Compatibility/Mobile|compatibility with]] Firefox products. This may also include general purpose JS libraries that include some kind of UA detection.
 
See use cases for [[UA/UseCases|user agent (UA) detection]] for more context.


The end goal is to '''contact these sites''' or (even better, in the case of open source libraries) '''provide patches''' so our mobile browsers are correctly identified as mobile (and not served desktop content or blocked outright).
The end goal is to '''contact these sites''' or (even better, in the case of open source libraries) '''provide patches''' so our mobile browsers are correctly identified as mobile (and not served desktop content or blocked outright).
{{outdated}}
NOTE: This page won't be actively updated anymore. You can watch the [https://bugzilla.mozilla.org/show_bug.cgi?id=915706 meta bug], or track progress at https://github.com/miketaylr/arewedetectableyet/.




Line 15: Line 21:


Firefox OS tablets:
Firefox OS tablets:
* <code>Mozilla/5.0 (Tablet; rv:26.0) Gecko/18.0 Firefox/26.0</code>
* <code>Mozilla/5.0 (Tablet; rv:29.0) Gecko/29.0 Firefox/29.0</code>


Some known Firefox OS UA strings with device ids (found in bugzil.la/873385):
Some known Firefox OS UA strings with device ids (found in bugzil.la/873385):
Line 23: Line 29:
* <code>Mozilla/5.0 (Mobile; ALCATELOneTouch4012X; rv:18.1) Gecko/18.1 Firefox/18.1</code>
* <code>Mozilla/5.0 (Mobile; ALCATELOneTouch4012X; rv:18.1) Gecko/18.1 Firefox/18.1</code>


See also https://developer.mozilla.org/en-US/docs/Gecko_user_agent_string_reference#Firefox_OS_version_number.
See also https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/User-Agent/Firefox


== Libraries to be tested ==
== Libraries to be tested ==
Line 38: Line 44:
== Tested, issues reported in Bugzilla ==
== Tested, issues reported in Bugzilla ==
'''Meta Bug: [https://bugzilla.mozilla.org/show_bug.cgi?id=915706 915706]'''
'''Meta Bug: [https://bugzilla.mozilla.org/show_bug.cgi?id=915706 915706]'''
*fixed
php
* WPTouch (WordPress) [https://bugzilla.mozilla.org/show_bug.cgi?id=909420 Bug 909420]


== Libraries known to be compatibile ==
== Libraries known to be compatibile ==
=== Go ===
=== Go ===
* UserAgent https://github.com/mssola/user_agent
* UserAgent https://github.com/mssola/user_agent
* Woothee Go https://github.com/woothee/woothee-go


=== Java ===
=== Java ===
* UADetector https://github.com/before/uadetector
* UADetector https://github.com/before/uadetector
* User Agent Utils [https://bugzilla.mozilla.org/show_bug.cgi?id=915727 915727] *
* User Agent Utils [https://bugzilla.mozilla.org/show_bug.cgi?id=915727 915727] *
* Woothee Java https://github.com/woothee/woothee-java
* YAUAA https://github.com/nielsbasjes/yauaa
=== Scala ===
* UA-Parser https://github.com/ua-parser/uap-scala


=== JavaScript ===
=== JavaScript ===
Line 67: Line 74:
* ua-parser-js https://github.com/faisalman/ua-parser-js
* ua-parser-js https://github.com/faisalman/ua-parser-js
* useragent https://github.com/3rd-Eden/useragent
* useragent https://github.com/3rd-Eden/useragent
* Woothee [https://bugzilla.mozilla.org/show_bug.cgi?id=914313 Bug 914313] *
* Woothee JS https://github.com/woothee/woothee-js
* YUI - http://yuilibrary.com/yui/docs/yui/yui-ua.html
* YUI - http://yuilibrary.com/yui/docs/yui/yui-ua.html
* UA.js [https://bugzilla.mozilla.org/show_bug.cgi?id=913189 Bug 913189] *
* UA.js [https://bugzilla.mozilla.org/show_bug.cgi?id=913189 Bug 913189] *
Line 76: Line 83:
** Some ports of this are compatible, in contact with maintainer via email.
** Some ports of this are compatible, in contact with maintainer via email.
* detectmobilebrowsers.com [https://bugzilla.mozilla.org/show_bug.cgi?id=914241 Bug 914241*]
* detectmobilebrowsers.com [https://bugzilla.mozilla.org/show_bug.cgi?id=914241 Bug 914241*]
* Woothee https://github.com/woothee/woothee


=== Perl ===
=== Perl ===
* HTTP::BrowserDetect https://github.com/oalders/http-browserdetect
* HTTP::BrowserDetect https://github.com/oalders/http-browserdetect
* Woothee Perl https://github.com/woothee/woothee-perl


=== PHP ===
=== PHP ===
Line 87: Line 96:
* PHP User Agent https://github.com/ornicar/php-user-agent
* PHP User Agent https://github.com/ornicar/php-user-agent
* PHP User Agent Parser https://github.com/donatj/PhpUserAgent
* PHP User Agent Parser https://github.com/donatj/PhpUserAgent
* Woothee PHP https://github.com/woothee/woothee-php
* WordPress Mobile Detect http://wordpress.org/plugins/wp-mobile-detect/
* WordPress Mobile Detect http://wordpress.org/plugins/wp-mobile-detect/
* WPTouch (WordPress) [https://bugzilla.mozilla.org/show_bug.cgi?id=909420 Bug 909420]


=== Python ===
=== Python ===
Line 95: Line 106:
* minidetector https://github.com/saschwarz/minidetector/network
* minidetector https://github.com/saschwarz/minidetector/network
* Python User Agents https://github.com/selwin/python-user-agents
* Python User Agents https://github.com/selwin/python-user-agents
* Woothee Python https://github.com/woothee/woothee-python


=== Ruby ===
=== Ruby ===
Line 103: Line 115:
* UserAgent https://github.com/josh/useragent (makes no mobile/non-mobile distinction)
* UserAgent https://github.com/josh/useragent (makes no mobile/non-mobile distinction)
* User Agent Parser https://github.com/toolmantim/user_agent_parser
* User Agent Parser https://github.com/toolmantim/user_agent_parser
* Woothee Ruby https://github.com/woothee/woothee-ruby


=== Server Detection Frameworks ===
=== Server Detection Frameworks ===
Line 113: Line 126:
* WURFL (1.4) http://tools.scientiamobile.com/?user-agent-string=Mozilla%2F5.0+%28Mobile%3B+rv%3A18.0%29+Gecko%2F18.0+Firefox%2F18.0
* WURFL (1.4) http://tools.scientiamobile.com/?user-agent-string=Mozilla%2F5.0+%28Mobile%3B+rv%3A18.0%29+Gecko%2F18.0+Firefox%2F18.0


[[Category:Web Compatibility]]
[[Category:Web Compatibility|UA Detection]]

Latest revision as of 11:05, 14 April 2026

User Agent Detection Libraries

This is a list of User Agent detection libraries to be tested for compatibility with Firefox products. This may also include general purpose JS libraries that include some kind of UA detection.

See use cases for user agent (UA) detection for more context.

The end goal is to contact these sites or (even better, in the case of open source libraries) provide patches so our mobile browsers are correctly identified as mobile (and not served desktop content or blocked outright).

Ambox outdated.png THIS PAGE MAY BE OUTDATED
This article is in parts, or in its entirety, outdated. Hence, the information presented on this page may be incorrect, and should be treated with due caution until this flag has been lifted. Help by editing the article, or discuss its contents on the talk page.

NOTE: This page won't be actively updated anymore. You can watch the meta bug, or track progress at https://github.com/miketaylr/arewedetectableyet/.


UA strings to test with:

Firefox Mobile for Android:

  • Mozilla/5.0 (Android; Mobile; rv:24.0) Gecko/24.0 Firefox/24.0

Firefox OS phones:

  • Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0

Firefox OS tablets:

  • Mozilla/5.0 (Tablet; rv:29.0) Gecko/29.0 Firefox/29.0

Some known Firefox OS UA strings with device ids (found in bugzil.la/873385):

  • Mozilla/5.0 (Mobile; ZTEOPEN; rv:18.1) Gecko/18.1 Firefox/18.1
  • Mozilla/5.0 (Mobile; HUAWEIY300-F1; rv:18.1) Gecko/18.1 Firefox/18.1
  • Mozilla/5.0 (Mobile; LG-D300; rv:18.1) Gecko/18.1 Firefox/18.1
  • Mozilla/5.0 (Mobile; ALCATELOneTouch4012X; rv:18.1) Gecko/18.1 Firefox/18.1

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

Libraries to be tested

JavaScript

Server Modules

Tested, issues reported in Bugzilla

Meta Bug: 915706

Libraries known to be compatibile

Go

Java

Scala

JavaScript

Multiple Languages

Perl

PHP

Python

Ruby

Server Detection Frameworks