|
|
@@ -1006,17 +1006,17 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
const frameDoc = frameData.processor.getDocument();
|
|
|
frameDoc.documentElement.setAttribute("style", "overflow:hidden");
|
|
|
frameDoc.querySelectorAll("a[href]").forEach(element => {
|
|
|
- element.target = "_top";
|
|
|
- element.rel = "noopener";
|
|
|
+ element.target = "_blank";
|
|
|
+ element.rel = "noopener noreferrer";
|
|
|
});
|
|
|
}
|
|
|
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) || frameData.shadowRootContent) {
|
|
|
- frameElement.setAttribute("sandbox", "allow-popups allow-scripts allow-same-origin");
|
|
|
- } else {
|
|
|
- frameElement.setAttribute("sandbox", "allow-popups");
|
|
|
+ let sandbox = "allow-popups allow-top-navigation allow-top-navigation-by-user-activation";
|
|
|
+ if (pageData.content.match(NOSCRIPT_TAG_FOUND) || pageData.content.match(SCRIPT_TAG_FOUND)) {
|
|
|
+ sandbox += "allow-scripts allow-same-origin";
|
|
|
}
|
|
|
+ frameElement.setAttribute("sandbox", sandbox);
|
|
|
if (frameElement.tagName == "OBJECT") {
|
|
|
frameElement.setAttribute("data", "data:text/html," + pageData.content);
|
|
|
} else {
|