|
|
@@ -197,6 +197,10 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
await this.processor.finalize();
|
|
|
}
|
|
|
|
|
|
+ getDocument() {
|
|
|
+ return this.processor.doc;
|
|
|
+ }
|
|
|
+
|
|
|
async getPageData() {
|
|
|
if (this.root) {
|
|
|
this.onprogress(new ProgressEvent(PAGE_ENDED, { pageURL: this.options.url }));
|
|
|
@@ -507,7 +511,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
frameElement.setAttribute("style", "all:initial!important;border:0!important;width:100%!important;height:" + elementInfo.height + "px!important");
|
|
|
const windowId = "shadow-" + this.options.framesData.length;
|
|
|
frameElement.setAttribute(docUtil.WIN_ID_ATTRIBUTE_NAME, windowId);
|
|
|
- this.options.framesData.push({ windowId, content: elementInfo.content, baseURI: this.baseURI });
|
|
|
+ this.options.framesData.push({ windowId, content: elementInfo.content, baseURI: this.baseURI, shadowRootContent: true });
|
|
|
element.appendChild(frameElement);
|
|
|
}
|
|
|
});
|
|
|
@@ -998,6 +1002,10 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
if (frameData.processor) {
|
|
|
this.stats.add("processed", "frames", 1);
|
|
|
await frameData.processor.run();
|
|
|
+ if (frameData.shadowRootContent) {
|
|
|
+ const frameDoc = frameData.processor.getDocument();
|
|
|
+ frameDoc.documentElement.setAttribute("style", "overflow:hidden");
|
|
|
+ }
|
|
|
const pageData = await frameData.processor.getPageData();
|
|
|
frameElement.removeAttribute(docUtil.WIN_ID_ATTRIBUTE_NAME);
|
|
|
if (pageData.content.match(NOSCRIPT_TAG_FOUND) || pageData.content.match(SCRIPT_TAG_FOUND)) {
|