www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 4c9f389aa8f4f41a51d60a60dd9b7a91b9422c4c
parent a6564e92d7dfc1c26f0facfaf419321689341085
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sat, 29 Jul 2017 17:13:46 -0400

Fix external zotero:// links

Diffstat:
Mcomponents/zotero-service.js | 22+++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/components/zotero-service.js b/components/zotero-service.js @@ -540,15 +540,19 @@ ZoteroCommandLineHandler.prototype = { if (param) { var uri = cmdLine.resolveURI(param); if(uri.schemeIs("zotero")) { - // Check for existing window and focus it - var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - var win = wm.getMostRecentWindow("navigator:browser"); - if(win) { - win.focus(); - Components.classes["@mozilla.org/network/protocol;1?name=zotero"] - .getService().newChannel(uri); - } + addInitCallback(function (Zotero) { + Zotero.uiReadyPromise + .then(function () { + // Check for existing window and focus it + var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] + .getService(Components.interfaces.nsIWindowMediator); + var win = wm.getMostRecentWindow("navigator:browser"); + if (win) { + win.focus(); + win.ZoteroPane.loadURI(uri.spec) + } + }); + }); } // See below else if (uri.schemeIs("file")) {