0

*EDIT ^^ THIS QUESTION IS DIFFERENT ...

Im using this code below to detect if users are on Firefox, but I want to take it one level farther and only target mac users on Firefox, any advice?

var FF = !(window.mozInnerScreenX == null);
    if(FF) {
        // is firefox 
    } else { 
        // not firefox 
    }
nick
  • 1,226
  • 3
  • 21
  • 38

2 Answers2

1

You can use the navigator.appversion call and check for the OS strings.

An example looks like this.

navigator.appversion
"5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36"
B-Rad
  • 383
  • 1
  • 14
1

You can do them separately:

var FF = !(window.mozInnerScreenX == null);

if(FF) {
    if(navigator.platform.indexOf('Mac')>=0)
    {
        // is a mac and on firefox
    }

I do not have a Mac so I can not test this, but I hope it helps.

rp.beltran
  • 2,764
  • 3
  • 21
  • 29