From 897b3993b435cf56e9b21e4d385ca96e1e856d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Fri, 14 Oct 2016 11:10:36 +0300 Subject: [PATCH] Fix feed item translation in standalone Broken due to non-existing progress window in standalone Zotero_Browser --- chrome/content/zotero/browser.js | 3 +++ chrome/content/zotero/xpcom/data/feedItem.js | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index 600086d19d..9aec383b7f 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -98,7 +98,10 @@ var Zotero_Browser = new function() { * Initialize some variables and prepare event listeners for when chrome is done loading */ function init() { + // No gBrowser - running in standalone if (!window.hasOwnProperty("gBrowser")) { + // We can still have a progress window in this though + reload(); return; } diff --git a/chrome/content/zotero/xpcom/data/feedItem.js b/chrome/content/zotero/xpcom/data/feedItem.js index be5ed9cb92..fe725374a4 100644 --- a/chrome/content/zotero/xpcom/data/feedItem.js +++ b/chrome/content/zotero/xpcom/data/feedItem.js @@ -219,8 +219,9 @@ Zotero.FeedItem.prototype.translate = Zotero.Promise.coroutine(function* (librar let translate = new Zotero.Translate.Web(); if (libraryID) { - // Show progress notifications when scraping to a library - var win = Services.wm.getMostRecentWindow("navigator:browser"); + // Show progress notifications when scraping to a library. Shown under the most recent + // window (Zotero Pane). Browser window not available in standalone. + var win = Services.wm.getMostRecentWindow(null); translate.clearHandlers("done"); translate.clearHandlers("itemDone"); translate.setHandler("done", win.Zotero_Browser.progress.Translation.doneHandler);