From a9799b70bc1b36dd30c26934ba6b214813999241 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 20 Jan 2018 16:37:40 -0500 Subject: [PATCH] code review for aafb85c6c62a: use `contentType`, `instanceof document` is unreliable on Firefox --- src/js/contentscript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/contentscript.js b/src/js/contentscript.js index e45ad5a..1ff7d17 100644 --- a/src/js/contentscript.js +++ b/src/js/contentscript.js @@ -473,7 +473,7 @@ var collapser = (function() { }; var morphNoscript = function(from) { - if ( document instanceof XMLDocument ) { + if ( /^application\/(?:xhtml\+)?xml/.test(document.contentType) ) { var to = document.createElement('span'); while ( from.firstChild !== null ) { to.appendChild(from.firstChild);