|
|
@@ -66,6 +66,12 @@ const SingleFileCore = (() => {
|
|
|
this.processor.insertFaviconLink();
|
|
|
this.processor.resolveHrefs();
|
|
|
this.processor.insertSingleFileCommentNode();
|
|
|
+ if (this.options.removeHiddenElements) {
|
|
|
+ this.processor.removeHiddenElements();
|
|
|
+ }
|
|
|
+ if (this.options.removeUnusedCSSRules) {
|
|
|
+ this.processor.removeUnusedCSSRules();
|
|
|
+ }
|
|
|
await Promise.all([this.processor.inlineStylesheets(true), this.processor.linkStylesheets()], this.processor.attributeStyles(true));
|
|
|
this.pendingPromises = Promise.all([this.processor.inlineStylesheets(), this.processor.attributeStyles(), this.processor.pageResources()]);
|
|
|
if (this.onprogress) {
|
|
|
@@ -91,9 +97,6 @@ const SingleFileCore = (() => {
|
|
|
if (this.options.removeUnusedCSSRules) {
|
|
|
this.processor.removeUnusedCSSRules();
|
|
|
}
|
|
|
- if (this.options.removeHiddenElements) {
|
|
|
- this.processor.removeHiddenElements();
|
|
|
- }
|
|
|
if (this.onprogress) {
|
|
|
this.onprogress({ type: "page-ended", details: { pageURL: this.options.url } });
|
|
|
}
|