From 6b66dbfafaee067bd0e78ee6b804924d8fa04fad Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 7 Nov 2012 23:52:30 -0500 Subject: [PATCH] Another tweak to processDocuments --- chrome/content/zotero/xpcom/http.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/http.js b/chrome/content/zotero/xpcom/http.js index 28fc5b559..328386ece 100644 --- a/chrome/content/zotero/xpcom/http.js +++ b/chrome/content/zotero/xpcom/http.js @@ -492,7 +492,8 @@ Zotero.HTTP = new function() { // (Approximately) how many seconds to wait if the document is left in the loading state and // pageshow is called before we call pageshow with an incomplete document const LOADING_STATE_TIMEOUT = 120; - var firedLoadEvent = 0; + var firedLoadEvent = 0, + loaded = false; /** * Loads the next page @@ -503,6 +504,7 @@ Zotero.HTTP = new function() { var url = urls[currentURL], hiddenBrowser = hiddenBrowsers[currentURL]; firedLoadEvent = 0; + loaded = false; currentURL++; try { Zotero.debug("Zotero.HTTP.processDocuments: Loading "+url); @@ -527,6 +529,7 @@ Zotero.HTTP = new function() { * @inner */ var onLoad = function(e) { + if(loaded) return; var hiddenBrowser = e.currentTarget, doc = hiddenBrowser.contentDocument; if(!doc) return; @@ -540,6 +543,7 @@ Zotero.HTTP = new function() { Zotero.debug("Zotero.HTTP.processDocuments: "+url+" loaded"); hiddenBrowser.removeEventListener("pageshow", onLoad, true); + loaded = true; try { processor(doc);