[Project_owners] Re: Getting the gecok version

Philip Chee philip at aleytys.pc.my
Fri Sep 22 03:08:49 EDT 2006


On Thu, 21 Sep 2006 09:07:17 -0700, HJ van Rantwijk wrote:

> I need a reliable way to get the gecko version, in JS from chrome i.e.
> the rv:1.9 part from the HTTP User Agent, which I cannot use because
> that can be changed.

> Boris wrote: "I seem to recall toolkit having some sort of API for this,
> but there's no Gecko API that I know of."

> Do you know what Boris is referring to?

In toolkit apps you can do this:

var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
              .getService(Components.interfaces.nsIXULAppInfo);
var platformVer = appInfo.platformVersion;
var platformBuildID = appInfo.platformBuildID;

Phil

-- 
Philip Chee <philip at aleytys.pc.my>, <philip.chee at gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.


More information about the Project_owners mailing list