Operating system detection
←Older revision Revision as of 20:51, 19 March 2008 Line 16: Line 16: ==Operating system detection== ==Operating system detection== - // Returns WINNT on Windows XP, 2000, NT and returns Linux on GNU/Linux+ // Returns "WINNT" on Windows Vista, XP, 2000, and NT systems + // and returns "Linux" on GNU/Linux var osString = Components.classes["@mozilla.org/xre/app-info;1"] var osString = Components.classes["@mozilla.org/xre/app-info;1"] .getService(Components.interfaces.nsIXULRuntime).OS; .getService(Components.interfaces.nsIXULRuntime).OS;