www

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

commit 6b66dbfafaee067bd0e78ee6b804924d8fa04fad
parent 7754d530da3e30f67662b16cebe6528a30ce85b5
Author: Simon Kornblith <simon@simonster.com>
Date:   Wed,  7 Nov 2012 23:52:30 -0500

Another tweak to processDocuments

Diffstat:
Mchrome/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 @@ -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);