From 1d3df92ccc24924e7997ada196b05b66ad730c9f Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Thu, 4 Dec 2014 14:08:29 -0600 Subject: [PATCH] Fix for removing unwanted body and head tags --- winstore-jscompat.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/winstore-jscompat.js b/winstore-jscompat.js index 51711e5..6d8d35b 100644 --- a/winstore-jscompat.js +++ b/winstore-jscompat.js @@ -106,8 +106,14 @@ } } cleanseAttributes(cleaner.documentElement); + + var docElement = cleaner.documentElement.childNodes[1]; - return Array.prototype.slice.call(document.adoptNode(cleaner.documentElement).childNodes); + if (docElement == null) { + docElement = cleaner.documentElement; + } + + return Array.prototype.slice.call(document.adoptNode(docElement).childNodes); } function cleansePropertySetter(property, setter) { @@ -140,4 +146,4 @@ } -}()); \ No newline at end of file +}());