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.
This commit is contained in:
parent
fbef301fe0
commit
e1594ce3d6
1 changed files with 6 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue