Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Browser.version always returns the same for Android 2-4 #2199

RiZKiT opened this Issue · 4 comments

3 participants


There is no way to detect the different Android browser versions. Well, that's a result of the user agent string, but what is a solution?

  1. Fake the browser version and return the Android version instead?
  2. Have something like Browser.Platform.version?

It should be possible yes, this is my UA string:

Mozilla/5.0 Linux U Android 2.3.4 en-us SonyEricssonMT15i Build/4.0.2.A.0.42 AppleWebKit/533.1 KHTML, like Gecko Version/4.0 Mobile Safari/533.1


Yes, and a friend send me his user agent string from his Galaxy Nexus, both result in Browser.version == 4.

Mozilla/5.0 (Linux; U; Android 4.0.2; de-de; Galaxy Nexus/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30

My problem is, I want to know if i have an Android > 2 browser, because these support position:fixed. For now I check the navigator.userAgent for "Android 2". Maybe i have to deal with it until there is a bulletproof solution to check for position:fixed ... in Modernizr.


You should be able to feature test the 'position: fixed', like

function () {
  var container = document.body;
  if (document.createElement &&
      container && container.appendChild && container.removeChild) {
      var el = document.createElement("div");
      if (!el.getBoundingClientRect) {
          return null;
      el.innerHTML = "x"; = "position:fixed;top:100px;";
      var originalHeight =, originalScrollTop = container.scrollTop; = "3000px";
      container.scrollTop = 500;
      var elementTop = el.getBoundingClientRect().top; = originalHeight;
      var isSupported = elementTop === 100;
      container.scrollTop = originalScrollTop;
      return isSupported;
  return null;



We've already marked this as wontfix, and I can't condone UA sniffing. So closing.

@fakedarren fakedarren closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.