diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index d4f6e6066..554d7daa9 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -220,6 +220,9 @@ Zotero.Attachments = new function(){ var browser = Zotero.Browser.createHiddenBrowser(); var imported = false; var onpageshow = function() { + // ignore spurious about:blank loads + if(browser.contentDocument.location.href == "about:blank") return; + // pageshow can be triggered multiple times on some pages, // so make sure we only import once // (https://www.zotero.org/trac/ticket/795) @@ -1164,6 +1167,9 @@ Zotero.Attachments = new function(){ var browser = Zotero.Browser.createHiddenBrowser(); var callback = function(charset, args) { + // ignore spurious about:blank loads + if(browser.contentDocument.location.href == "about:blank") return; + var charsetID = Zotero.CharacterSets.getID(charset); if (charsetID) { var disabled = Zotero.Notifier.disable(); diff --git a/chrome/content/zotero/xpcom/file.js b/chrome/content/zotero/xpcom/file.js index ccd4c5a89..170a8aa43 100644 --- a/chrome/content/zotero/xpcom/file.js +++ b/chrome/content/zotero/xpcom/file.js @@ -240,6 +240,9 @@ Zotero.File = new function(){ .getURLSpecFromFile(file); this.addCharsetListener(browser, function (charset, args) { + // ignore spurious about:blank loads + if(browser.contentDocument.location.href == "about:blank") return; + callback(charset, args); Zotero.Browser.deleteHiddenBrowser(browser); }, args);