commit e1594ce3d6b822d1c4b6c339d6c841b85e54d743 parent fbef301fe07b0bd5289c84268e7085d708b195b6 Author: Simon Kornblith <simon@simonster.com> Date: Tue, 28 Feb 2012 16:29:12 -0500 Don't fire callback to processDocuments() if document.readyState is still "loading" This fixes the AMS bug, but it may break other things. We'll see when the unit tests run tonight. Diffstat:
| M | chrome/content/zotero/xpcom/http.js | | | 11 | ++++++----- |
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/xpcom/http.js b/chrome/content/zotero/xpcom/http.js @@ -527,12 +527,13 @@ Zotero.HTTP = new function() { * @inner */ var onLoad = function() { - if(hiddenBrowser.contentDocument.location.href == "about:blank") return; - Zotero.debug(hiddenBrowser.contentDocument.location.href+" has been loaded"); - if(hiddenBrowser.contentDocument.location.href != prevUrl) { // Just in case it fires too many times - prevUrl = hiddenBrowser.contentDocument.location.href; + var doc = hiddenBrowser.contentDocument, + url = doc.location.href.toString(); + if(url == "about:blank" || doc.readyState === "loading") return; + if(url !== prevUrl) { // Just in case it fires too many times + prevUrl = url; try { - processor(hiddenBrowser.contentDocument); + processor(doc); } catch(e) { removeListeners(); if(exception) {