mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-10-24 22:59:51 -04:00
Add destroy method
Which revokes all blob URLs and removes the element from document.
This commit is contained in:
1 parent
a817932b08
commit
5da3be5200
7 files changed
+45
-5
No files matched your search
@@ -842,6 +842,10 @@ class MOBI6 {
|
||||
isExternal(uri) {
|
||||
return /^(?!blob|filepos)\w+:/i.test(uri)
|
||||
}
|
||||
destroy() {
|
||||
for (const url of this.#resourceCache.values()) URL.revokeObjectURL(url)
|
||||
for (const url of this.#cache.values()) URL.revokeObjectURL(url)
|
||||
}
|
||||
}
|
||||
|
||||
// handlers for `kindle:` uris
|
||||
@@ -1154,4 +1158,7 @@ class KF8 {
|
||||
isExternal(uri) {
|
||||
return /^(?!blob|kindle)\w+:/i.test(uri)
|
||||
}
|
||||
destroy() {
|
||||
for (const url of this.#cache.values()) URL.revokeObjectURL(url)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user