views:

229

answers:

1

I am developing a firefox extension, i need to detect which operating system firefox is running on but i can't seem to find and info on how to do it?

+3  A: 

    // Returns "WINNT" on Windows Vista, XP, 2000, and NT systems;  
    // "Linux" on GNU/Linux; and "Darwin" on Mac OS X.  
    var osString = Components.classes["@mozilla.org/xre/app-info;1"]  
                   .getService(Components.interfaces.nsIXULRuntime).OS;  
Hamza Yerlikaya
For the reference: https://developer.mozilla.org/en/nsIXULRuntime
Nickolay