diff --git a/chrome/content/zotero/xpcom/http.js b/chrome/content/zotero/xpcom/http.js index bf27d6aa09..fc02bd8082 100644 --- a/chrome/content/zotero/xpcom/http.js +++ b/chrome/content/zotero/xpcom/http.js @@ -492,8 +492,7 @@ 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, - loaded = false; + var firedLoadEvent = 0; /** * Loads the next page @@ -504,7 +503,6 @@ Zotero.HTTP = new function() { var url = urls[currentURL], hiddenBrowser = hiddenBrowsers[currentURL]; firedLoadEvent = 0; - loaded = false; currentURL++; try { Zotero.debug("Zotero.HTTP.processDocuments: Loading "+url); @@ -529,9 +527,9 @@ Zotero.HTTP = new function() { * @inner */ var onLoad = function(e) { - if(loaded) return; var hiddenBrowser = e.currentTarget, doc = hiddenBrowser.contentDocument; + if(hiddenBrowser.zotero_loaded) return; if(!doc) return; var url = doc.documentURI; if(url === "about:blank") return; @@ -543,7 +541,7 @@ Zotero.HTTP = new function() { Zotero.debug("Zotero.HTTP.processDocuments: "+url+" loaded"); hiddenBrowser.removeEventListener("pageshow", onLoad, true); - loaded = true; + hiddenBrowser.zotero_loaded = true; try { processor(doc);