0

I am using a library which has a bug for safari 5.1+ until 5.9 on iOS (mobile) but it work fine after 6.0 (6.0 included) on iOS.

The library in question does allow to remove the element that generates the bug:

Turbolinks.ProgressBar.disable();

How can I say to javascript to apply the function removeProgressBar only to safari <6.0 (strict inferiority) on iOS :

function removeProgressBar {
  Turbolinks.ProgressBar.disable();
}

Important:

  • Safari 6.0 and safari 6.0+must not be affected on iOS nor on desktop (OS X) (I don't want to remove progress bar in this case)

  • safari 5.1.x on desktop (OS X) must not be affected (I don't want to remove progress bar in this case)

  • not sure if it matters but I am using bootstrap 3

Mathieu
  • 3,841
  • 9
  • 45
  • 89

1 Answers1

2

Read this post: Browser detection in JavaScript?. It has some useful information on detecting browser and version. Be careful though, because this can never be 100% reliable.

Community
  • 1
  • 1
Dastur
  • 620
  • 6
  • 22
  • thanks but it seems the question and answser enable to detect a browser but NOT its version and not whether it's on iOS or desktop. which are 2 specific needs of my question. – Mathieu Jul 22 '16 at 17:36
  • I don't think what your trying to do is possible, your better off trying to use sonething else that provides more support. – Dastur Jul 22 '16 at 17:39
  • actually it's too structural for my app, prefer to keep it. in fact your link's accepted answre by kennebec would enable me to find browser and version . I then have to find a way to detect if user is on iOS or desktop:) – Mathieu Jul 22 '16 at 17:40
  • Glad to help, hope all goes well :) – Dastur Jul 22 '16 at 17:41