|
@@ -108,13 +108,15 @@ this.docHelper = this.docHelper || (() => {
|
|
|
|
|
|
|
|
function getStylesheetContents(doc) {
|
|
function getStylesheetContents(doc) {
|
|
|
if (doc) {
|
|
if (doc) {
|
|
|
- const 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 */
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const contents = [];
|
|
|
|
|
+ doc.querySelectorAll("style").forEach(styleElement => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ contents.push(Array.from(styleElement.sheet.cssRules).map(rule => rule.cssText).join("\n"));
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ /* ignored */
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return contents;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|