@@ -109,8 +109,12 @@ this.docHelper = this.docHelper || (() => {
function getStylesheetContents(doc) {
if (doc) {
const textData = [];
- doc.querySelectorAll("style").forEach(styleElement => textData.push(Array.from(styleElement.sheet.cssRules).map(rule => rule.cssText).join("\n")));
- return textData;
+ try {
+ doc.querySelectorAll("style").forEach(styleElement => textData.push(Array.from(styleElement.sheet.cssRules).map(rule => rule.cssText).join("\n")));
+ return textData;
+ } catch (error) {
+ /* ignored */
+ }
}