fix(reader): use CSP for protecting foliate instead of iframe sandbox (#848)
This commit is contained in:
@@ -83,7 +83,7 @@ export class FixedLayout extends HTMLElement {
|
||||
})
|
||||
// Foliate recommends disabling scripts for untrusted book content:
|
||||
// https://github.com/johnfactotum/foliate-js#security
|
||||
iframe.setAttribute('sandbox', 'allow-same-origin')
|
||||
iframe.setAttribute('sandbox', 'allow-same-origin allow-scripts')
|
||||
iframe.setAttribute('scrolling', 'no')
|
||||
iframe.setAttribute('part', 'filter')
|
||||
this.#root.append(element)
|
||||
|
||||
@@ -241,7 +241,7 @@ class View {
|
||||
})
|
||||
// Foliate recommends disabling scripts for untrusted book content:
|
||||
// https://github.com/johnfactotum/foliate-js#security
|
||||
this.#iframe.setAttribute('sandbox', 'allow-same-origin')
|
||||
this.#iframe.setAttribute('sandbox', 'allow-same-origin allow-scripts')
|
||||
this.#iframe.setAttribute('scrolling', 'no')
|
||||
}
|
||||
get element() {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<title>Grimmory</title>
|
||||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover">
|
||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-eval' 'wasm-unsafe-eval'; worker-src blob:; frame-src blob: data:; object-src 'none'; form-action 'none';">
|
||||
<link rel="icon" type="image/svg+xml" href="assets/favicon.svg"/>
|
||||
<link rel="manifest" href="manifest.webmanifest">
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user