Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect Android's version number in Firefox for Android?

For a website we want to show a link in the play store if the user comes with an Android 4+ device. All browsers we tested sent the version number of Android in their user-agent string, except one: Firefox for Android. Firefox just sends this:

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

and even with some JavaScript I can't find any evidence for the version number:

<script language="JavaScript">
  document.write(navigator.appVersion + "\n<br/>OS CPU: " + navigator.oscpu);
</script>

returns:

5.0 (Android)
OS CPU: Linux arm7l

Did I miss some other methods?

like image 861
Jens Kohl Avatar asked Oct 21 '22 15:10

Jens Kohl


1 Answers

Unfortunately, you cannot. See Bug 625238 - Add device info to User-Agent and the related Bug 807495 - User Agent does not include handset Device Model.

In general, Mozilla has a policy of not adding User Agent (or HTTP header) information, and they currently have the opinion that developers do not need to know the running Android version.

like image 97
Daniel Trebbien Avatar answered Oct 24 '22 10:10

Daniel Trebbien