Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Operating System From Firefox Extension

Tags:

firefox

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?

like image 362
Hamza Yerlikaya Avatar asked Sep 13 '09 21:09

Hamza Yerlikaya


1 Answers


    // 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;  
like image 74
Hamza Yerlikaya Avatar answered Sep 19 '22 18:09

Hamza Yerlikaya