[Project_owners] Getting the gecok version
mnenhy at tprac.de
Fri Sep 22 09:32:50 EDT 2006
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.
Well, you can override the UA by setting "general.useragent.override", so:
- reading that in a temporary variable
- clearing its value (via nsIPrefService.clearUserPref)
- extracting rv: from navigator.userAgent
- restoring the "general.useragent.override" value
should work quite reliably. At least it did suffice for Mnenhy so far...
More information about the Project_owners