Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Current OS Version

4 views
Skip to first unread message

Jan Odvarko

unread,
Dec 22, 2009, 7:39:49 AM12/22/09
to
Is there an interface I could use to get the current OS version (for
logging purposes).

Honza

Gijs Kruitbosch

unread,
Dec 22, 2009, 8:03:19 AM12/22/09
to

navigator.oscpu (nsIDOMNavigator if you want explicit xpcom stuff, or
nsIHttpHandler.oscpu, but I'm not sure that's necessarily easier for you to get to)

See
http://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/src/nsHttpHandler.cpp#650
for what it does / what you should be dealing with.

The navigator implementation accesses this via
http://mxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindow.cpp#9438
in case you care.

~ Gijs

Mook

unread,
Dec 23, 2009, 3:05:46 AM12/23/09
to

In addition to what Gijs suggested,
Components.classes["@mozilla.org/system-info;1"]
.getService(Components.interfaces.nsIPropertyBag)
.getProperty("version");

Used in such wonderful places as
http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/src/nsBlocklistService.js#118

I don't know of documentation, though, just nsSystemInfo.cpp :(

--
Mook

Jan Odvarko

unread,
Dec 23, 2009, 8:26:20 AM12/23/09
to
Thanks!

Works for me.
Honza

0 new messages