Mar 11, 2012, 5:28 AM
272 Posts

Re: Detecting if you use Safari or not

  • Category: Other
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 5
This behaviour is caused because both browsers are using the webkit engine and the getUserAgent() method only checks the HTTP Header sent by the browser if there is a specific string inside.
You have to check for Safari *only* by checking if it is not Chrome too:
context.getUserAgent().isSafari() && !( context.getUserAgent().isChrome() )