From 8ce9ca1d928bda4b2721dfda03dbf2831b12626c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 11 Apr 2023 07:19:49 +0300 Subject: bump epubjs to 0.3.93 --- lib/epub.js/src/managers/views/iframe.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'lib/epub.js/src/managers/views/iframe.js') diff --git a/lib/epub.js/src/managers/views/iframe.js b/lib/epub.js/src/managers/views/iframe.js index 76b2c1d..e20e54d 100644 --- a/lib/epub.js/src/managers/views/iframe.js +++ b/lib/epub.js/src/managers/views/iframe.js @@ -16,7 +16,9 @@ class IframeView { layout: undefined, globalLayoutProperties: {}, method: undefined, - forceRight: false + forceRight: false, + allowScriptedContent: false, + allowPopups: false }, options || {}); this.id = "epubjs-view-" + uuid(); @@ -88,6 +90,15 @@ class IframeView { // Back up if seamless isn't supported this.iframe.style.border = "none"; + // sandbox + this.iframe.sandbox = "allow-same-origin"; + if (this.settings.allowScriptedContent) { + this.iframe.sandbox += " allow-scripts"; + } + if (this.settings.allowPopups) { + this.iframe.sandbox += " allow-popups"; + } + this.iframe.setAttribute("enable-annotation", "true"); this.resizing = true; @@ -221,7 +232,7 @@ class IframeView { this.lock("both", width, height); } else if(this.settings.axis === "horizontal") { this.lock("height", width, height); - } else { + } else { this.lock("width", width, height); } @@ -816,6 +827,11 @@ class IframeView { this.stopExpanding = true; this.element.removeChild(this.iframe); + if (this.pane) { + this.pane.element.remove(); + this.pane = undefined; + } + this.iframe = undefined; this.contents = undefined; -- cgit v1.2.3