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