readium / kotlin-toolkit

A toolkit for ebooks, audiobooks and comics written in Kotlin
https://readium.org/kotlin-toolkit
BSD 3-Clause "New" or "Revised" License
180 stars 77 forks source link

Fix applying preferences while recreating EPUB fragments #507

Closed mickael-menu closed 5 months ago

mickael-menu commented 5 months ago

Sometimes we need to trigger JavaScript during a configuration change. For example if the user submit new preferences (use case: switching the EPUB theme when the system mode changes).

This fails because the JavaScript layer (readium namespace) is not yet loaded.

As a workaround, we schedule incoming JavaScript requests until the webview page is loaded again.