mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-05 15:32:55 +02:00
feat: add allowPopups
option
This commit is contained in:
parent
f6fece4f88
commit
c168bb91ce
5 changed files with 25 additions and 14 deletions
|
@ -17,7 +17,8 @@ class IframeView {
|
|||
globalLayoutProperties: {},
|
||||
method: undefined,
|
||||
forceRight: false,
|
||||
allowScriptedContent: false
|
||||
allowScriptedContent: false,
|
||||
allowPopups: false
|
||||
}, options || {});
|
||||
|
||||
this.id = "epubjs-view-" + uuid();
|
||||
|
@ -92,9 +93,12 @@ class IframeView {
|
|||
// sandbox
|
||||
this.iframe.sandbox = "allow-same-origin";
|
||||
if (this.settings.allowScriptedContent) {
|
||||
this.iframe.sandbox += " allow-scripts"
|
||||
this.iframe.sandbox += " allow-scripts";
|
||||
}
|
||||
|
||||
if (this.settings.allowPopups) {
|
||||
this.iframe.sandbox += " allow-popups";
|
||||
}
|
||||
|
||||
this.iframe.setAttribute("enable-annotation", "true");
|
||||
|
||||
this.resizing = true;
|
||||
|
@ -228,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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue