Get A User’s Google Gears Version
This is a JavaScript function I wrote for an upcoming statistics tracking website of mine that allows you to get the Google Gears version of a visitors browser. I decided to pull it from my site due to the Google Gears version not really being of interest to anyone - but someone may well find it useful.
function gearsversion(){
if (window.google && google.gears){
var gearsinfo = google.gears.factory.getBuildInfo();
var gearsversion = gearsinfo.split(";");
return gearsversion[0];
}
}
I did it a dumb ass way. See the factory API docs to get the version properly. (Thanks Chris)


Reader Comments
2 responses so far
1Chris Prince November 19th, 2008 at 9:24 am
2Alan November 19th, 2008 at 6:56 pm
Leave a commentIt is better to use factory.version.
Using getBuildInfo() is not a good technique. As it says in the Gears documentation: “This string is purely informational. Application developers should not rely on the format of data returned. The contents and layout may change over time.”
Okay - thanks. Good job I didn’t implement it ;)