Prefer use of Services.appinfo

This commit is contained in:
Sylvester Keil 2018-07-05 17:35:16 +02:00 committed by Adomas Venčkauskas
parent b2a1977d5a
commit 06cb9aff98
2 changed files with 3 additions and 7 deletions

View file

@ -190,10 +190,8 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
this.clientName = ZOTERO_CONFIG.CLIENT_NAME;
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.platformVersion = Services.appinfo.platformVersion;
this.platformMajorVersion = parseInt(this.platformVersion.match(/^[0-9]+/)[0]);
this.isFx = true;
this.isClient = true;
this.isStandalone = Services.appinfo.ID == ZOTERO_CONFIG['GUID'];

View file

@ -456,9 +456,7 @@ var _isStandalone = null;
*/
function isStandalone() {
if(_isStandalone === null) {
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].
getService(Components.interfaces.nsIXULAppInfo);
_isStandalone = appInfo.ID === 'zotero@chnm.gmu.edu';
_isStandalone = Services.appinfo.ID === 'zotero@chnm.gmu.edu';
}
return _isStandalone;
}