Fixed scripts could not be enabled on file: SVG documents.
This commit is contained in:
parent
fd7718e6f8
commit
cc87b48861
|
@ -10,7 +10,7 @@ class DocumentCSP {
|
||||||
let {document} = this;
|
let {document} = this;
|
||||||
if (!(document instanceof HTMLDocument)) {
|
if (!(document instanceof HTMLDocument)) {
|
||||||
// this is not HTML, hence we cannot inject a <meta> CSP
|
// this is not HTML, hence we cannot inject a <meta> CSP
|
||||||
if (!capabilites.has("script")) {
|
if (!capabilities.has("script")) {
|
||||||
// safety net for XML (especially SVG) documents
|
// safety net for XML (especially SVG) documents
|
||||||
document.defaultView.addEventListener("beforescriptexecute",
|
document.defaultView.addEventListener("beforescriptexecute",
|
||||||
e => e.preventDefault(), true);
|
e => e.preventDefault(), true);
|
||||||
|
|
Loading…
Reference in New Issue