From c52017b2aa8457f1699e5bdef58393801ee258ef Mon Sep 17 00:00:00 2001 From: Seamus Barrett Date: Tue, 7 Feb 2017 18:29:35 +0000 Subject: [PATCH] Issue#48. Do not check for parsererrorNS on FF --- xml2json.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xml2json.js b/xml2json.js index 481e6d7..a10f03a 100644 --- a/xml2json.js +++ b/xml2json.js @@ -490,6 +490,8 @@ this.parseXmlString = function(xmlDocStr) { var isIEParser = window.ActiveXObject || "ActiveXObject" in window; + var f = navigator.userAgent.search("Firefox"); + var isFirefox = (f > -1); if (xmlDocStr === undefined) { return null; } @@ -498,7 +500,7 @@ var parser=new window.DOMParser(); var parsererrorNS = null; // IE9+ now is here - if(!isIEParser) { + if(!isIEParser && !isFirefox) { try { parsererrorNS = parser.parseFromString("INVALID", "text/xml").getElementsByTagName("parsererror")[0].namespaceURI; }