fix(reader): use CSP for protecting foliate instead of iframe sandbox (#848)

This commit is contained in:
James Ward
2026-04-25 18:00:20 -04:00
committed by GitHub
parent 254765f4aa
commit 30434e4dcd
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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() {