|
@@ -1005,10 +1005,14 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
if (frameData.shadowRootContent) {
|
|
if (frameData.shadowRootContent) {
|
|
|
const frameDoc = frameData.processor.getDocument();
|
|
const frameDoc = frameData.processor.getDocument();
|
|
|
frameDoc.documentElement.setAttribute("style", "overflow:hidden");
|
|
frameDoc.documentElement.setAttribute("style", "overflow:hidden");
|
|
|
|
|
+ frameDoc.querySelectorAll("a[href]").forEach(element => {
|
|
|
|
|
+ element.target = "_top";
|
|
|
|
|
+ element.rel = "noopener";
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
const pageData = await frameData.processor.getPageData();
|
|
const pageData = await frameData.processor.getPageData();
|
|
|
frameElement.removeAttribute(docUtil.WIN_ID_ATTRIBUTE_NAME);
|
|
frameElement.removeAttribute(docUtil.WIN_ID_ATTRIBUTE_NAME);
|
|
|
- if (pageData.content.match(NOSCRIPT_TAG_FOUND) || pageData.content.match(SCRIPT_TAG_FOUND)) {
|
|
|
|
|
|
|
+ if (pageData.content.match(NOSCRIPT_TAG_FOUND) || pageData.content.match(SCRIPT_TAG_FOUND) || frameData.shadowRootContent) {
|
|
|
frameElement.setAttribute("sandbox", "allow-popups allow-scripts allow-same-origin");
|
|
frameElement.setAttribute("sandbox", "allow-popups allow-scripts allow-same-origin");
|
|
|
} else {
|
|
} else {
|
|
|
frameElement.setAttribute("sandbox", "allow-popups");
|
|
frameElement.setAttribute("sandbox", "allow-popups");
|