|
@@ -92,9 +92,6 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
this.onprogress(new ProgressEvent(RESOURCES_INITIALIZING, { pageURL: this.options.url }));
|
|
this.onprogress(new ProgressEvent(RESOURCES_INITIALIZING, { pageURL: this.options.url }));
|
|
|
this.processor.removeUIElements();
|
|
this.processor.removeUIElements();
|
|
|
this.processor.replaceStyleContents();
|
|
this.processor.replaceStyleContents();
|
|
|
- if (!this.options.jsEnabled || (this.options.saveRawPage && this.options.removeScripts)) {
|
|
|
|
|
- this.processor.insertNoscriptContents();
|
|
|
|
|
- }
|
|
|
|
|
if (this.options.removeFrames) {
|
|
if (this.options.removeFrames) {
|
|
|
this.processor.removeFrames();
|
|
this.processor.removeFrames();
|
|
|
}
|
|
}
|
|
@@ -305,23 +302,6 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- insertNoscriptContents() {
|
|
|
|
|
- const DOMParser = DOM.getParser();
|
|
|
|
|
- if (DOMParser) {
|
|
|
|
|
- this.doc.querySelectorAll("noscript").forEach(element => {
|
|
|
|
|
- const fragment = this.doc.createDocumentFragment();
|
|
|
|
|
- Array.from(element.childNodes).forEach(node => {
|
|
|
|
|
- const parsedNode = new DOMParser().parseFromString(node.nodeValue, "text/html");
|
|
|
|
|
- Array.from(parsedNode.head.childNodes).concat(Array.from(parsedNode.body.childNodes)).forEach(node => {
|
|
|
|
|
- this.doc.importNode(node);
|
|
|
|
|
- fragment.appendChild(node);
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- element.parentElement.replaceChild(fragment, element);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
lazyLoadImages() {
|
|
lazyLoadImages() {
|
|
|
DOM.lazyLoader(this.doc);
|
|
DOM.lazyLoader(this.doc);
|
|
|
}
|
|
}
|