Don't initialize Zotero just to figure out if Standalone is running
This commit is contained in:
parent
c40ba095ea
commit
5710fbc530
|
@ -298,6 +298,19 @@ ZoteroService.prototype = {
|
||||||
Components.interfaces.nsIProtocolHandler])
|
Components.interfaces.nsIProtocolHandler])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _isStandalone = null;
|
||||||
|
/**
|
||||||
|
* Determine whether Zotero Standalone is running
|
||||||
|
*/
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
return _isStandalone;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The class representing the Zotero command line handler
|
* The class representing the Zotero command line handler
|
||||||
*/
|
*/
|
||||||
|
@ -334,7 +347,7 @@ ZoteroCommandLineHandler.prototype = {
|
||||||
|
|
||||||
// special handler for "zotero" URIs at the command line to prevent them from opening a new
|
// special handler for "zotero" URIs at the command line to prevent them from opening a new
|
||||||
// window
|
// window
|
||||||
if(this.Zotero.isStandalone) {
|
if(isStandalone()) {
|
||||||
var param = cmdLine.handleFlagWithParam("url", false);
|
var param = cmdLine.handleFlagWithParam("url", false);
|
||||||
if(param) {
|
if(param) {
|
||||||
var uri = cmdLine.resolveURI(param);
|
var uri = cmdLine.resolveURI(param);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user