From 828a2917c41189268d9c88617b825fa5371bb7c6 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 22 Jul 2013 20:23:48 -0400 Subject: [PATCH] Add Zotero.platformVersion and Zotero.platformMajorVersion platformVersion is a string that needs to be checked with nsIVersionComparator. platformMajorVersion is an integer that can be checked with > and < when the major Gecko version is enough. --- chrome/content/zotero/xpcom/zotero.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 4497229dd..ec1b36257 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -223,9 +223,10 @@ Components.utils.import("resource://gre/modules/Services.jsm"); this.mainThread = Components.classes["@mozilla.org/thread-manager;1"].getService().mainThread; - var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]. - getService(Components.interfaces.nsIXULAppInfo), - platformVersion = appInfo.platformVersion; + var appInfo = Components.classes["@mozilla.org/xre/app-info;1"] + .getService(Components.interfaces.nsIXULAppInfo); + this.platformVersion = appInfo.platformVersion; + this.platformMajorVersion = parseInt(appInfo.platformVersion.match(/^[0-9]+/)[0]); this.isFx = true; this.isFx3 = false; this.isFx35 = false;