|
|
@@ -90,6 +90,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
async initialize() {
|
|
|
this.onprogress(new ProgressEvent(RESOURCES_INITIALIZING, { pageURL: this.options.url }));
|
|
|
this.processor.removeInfoToolbar();
|
|
|
+ this.processor.replaceEmptyStyles();
|
|
|
if (!this.options.jsEnabled || (this.options.saveRawPage && this.options.removeScripts)) {
|
|
|
this.processor.insertNoscriptContents();
|
|
|
}
|
|
|
@@ -488,6 +489,18 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ replaceEmptyStyles() {
|
|
|
+ if (this.options.emptyStylesRulesText) {
|
|
|
+ let indexStyle = 0;
|
|
|
+ this.doc.querySelectorAll("style").forEach(styleElement => {
|
|
|
+ if (!styleElement.textContent) {
|
|
|
+ styleElement.textContent = this.options.emptyStylesRulesText[indexStyle];
|
|
|
+ indexStyle++;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
async pageResources() {
|
|
|
const resourcePromises = [
|
|
|
DomProcessorHelper.processAttribute(this.doc.querySelectorAll("link[href][rel*=\"icon\"]"), "href", this.baseURI),
|