Skip to content

Commit

Permalink
OPDS: import script after load finished event
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfactotum committed Dec 9, 2023
1 parent 39761bf commit 0b0d1ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ GObject.registerClass({
if (event === WebKit.LoadEvent.FINISHED) {
const lang = format.locales[0].baseName
webView.run(`globalThis.uiText = ${JSON.stringify(uiText)}
document.documentElement.lang = "${lang}"`)
document.documentElement.lang = "${lang}"
import('./opds.js').catch(e => console.error(e))`)
.catch(e => console.error(e))
for (const f of initFuncs) f()

Expand Down
4 changes: 3 additions & 1 deletion src/opds/opds.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<meta charset="utf-8">
<meta name="color-scheme" content="light dark">
<style>
:not(:defined) > * {
display: none;
}
:root {
overflow-wrap: anywhere;
font-size: 11pt;
Expand Down Expand Up @@ -592,4 +595,3 @@ <h1></h1>
</foliate-center>
</foliate-scrolled>
</foliate-stack>
<script src="opds.js" type="module"></script>

0 comments on commit 0b0d1ea

Please sign in to comment.