|
|
@@ -280,6 +280,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
// ------------
|
|
|
const EMPTY_DATA_URI = "data:base64,";
|
|
|
const EMPTY_IMAGE = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
|
|
+ const SCRIPT_TAG_FOUND = /<script/gi;
|
|
|
const NOSCRIPT_TAG_FOUND = /<noscript/gi;
|
|
|
|
|
|
class DOMProcessor {
|
|
|
@@ -756,7 +757,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
await frameData.processor.preparePageData();
|
|
|
const pageData = await frameData.processor.getPageData();
|
|
|
frameElement.removeAttribute(DOM.windowIdAttributeName(this.options.sessionId));
|
|
|
- if (pageData.content.match(NOSCRIPT_TAG_FOUND)) {
|
|
|
+ if (pageData.content.match(NOSCRIPT_TAG_FOUND) || pageData.content.match(SCRIPT_TAG_FOUND)) {
|
|
|
frameElement.setAttribute("sandbox", "allow-scripts allow-same-origin");
|
|
|
} else {
|
|
|
frameElement.setAttribute("sandbox", "");
|