From cf29a030f2a7551aef7dae90cc3e1ff448b3dded Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 1 Jul 2012 13:00:41 -0400 Subject: [PATCH 1/3] Use innerText if no textContent (for IE) --- chrome/content/zotero/xpcom/utilities_translate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/utilities_translate.js b/chrome/content/zotero/xpcom/utilities_translate.js index 923a7d49f5..8be8830a89 100644 --- a/chrome/content/zotero/xpcom/utilities_translate.js +++ b/chrome/content/zotero/xpcom/utilities_translate.js @@ -158,7 +158,7 @@ Zotero.Utilities.Translate.prototype.getItemArray = function(doc, inHere, urlRe, var links = inHere[j].getElementsByTagName("a"); for(var i=0; i Date: Sun, 1 Jul 2012 15:43:08 -0400 Subject: [PATCH 2/3] Fix xml/dom mode --- chrome/content/zotero/xpcom/translation/translate.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index e43f2d79ad..b629d66bc8 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1333,7 +1333,8 @@ Zotero.Translate.Base.prototype = { // https://bugzilla.mozilla.org/show_bug.cgi?id=609143 - can't pass E4X to sandbox in Fx4 src += "Zotero.getXML = function() {"+ "var xml = Zotero._getXML();"+ - "if(typeof xml == 'string') return new XML(xml);"+ + "if(typeof xml == 'string') { return new XML(xml);}"+ + "return xml;"+ "};"; } } @@ -2229,11 +2230,12 @@ Zotero.Translate.IO.String.prototype = { "_getXML":function() { if(this._mode == "xml/dom") { try { - return Zotero.Translate.IO.parseDOMXML(this.string); + var xml = Zotero.Translate.IO.parseDOMXML(this.string); } catch(e) { this._xmlInvalid = true; throw e; } + return (Zotero.isFx5 ? Zotero.Translate.SandboxManager.Fx5DOMWrapper(xml) : xml); } else { return this.string.replace(/<\?xml[^>]+\?>/, ""); } From f369af268d62e7246fbce60830fa31c4b7cbb249 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 1 Jul 2012 15:43:47 -0400 Subject: [PATCH 3/3] Fix xml/dom mode, part 2 --- .../content/zotero/xpcom/translation/translate_firefox.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js index 181f28d4e6..442789d2b9 100644 --- a/chrome/content/zotero/xpcom/translation/translate_firefox.js +++ b/chrome/content/zotero/xpcom/translation/translate_firefox.js @@ -467,7 +467,13 @@ Zotero.Translate.IO.Read.prototype = { "_getXML":function() { if(this._mode == "xml/dom") { - return Zotero.Translate.IO.parseDOMXML(this._rawStream, this._charset, this.file.fileSize); + try { + var xml = Zotero.Translate.IO.parseDOMXML(this._rawStream, this._charset, this.file.fileSize); + } catch(e) { + this._xmlInvalid = true; + throw e; + } + return (Zotero.isFx5 ? Zotero.Translate.SandboxManager.Fx5DOMWrapper(xml) : xml); } else { return this._readToString().replace(/<\?xml[^>]+\?>/, ""); }