![]() |
#1 |
Member
![]() Posts: 22
Karma: 10
Join Date: Jun 2021
Device: Any ereader for Android or iOS
|
How to view a javascript alert dialog in Calibre
I have an ebook that loads javascript code and it works ok with Calibre.
However, one of the commands is "alert()" and for this command I see the message: Code:
ERROR: ... Ignored call to 'alert()'. The document is sandboxed, and the 'allow-modals' keyword is not set. Code:
cat EPUB/xhtml/raw/ch1.xhtml ... <iframe sandbox="allow-modal"> ... </iframe> Or is the page itself sandboxed, so this will not help? If the page itself is sandboxed, is there a way to indicate allow-modal to Calibre? I'm basically trying to get some feedback from an ebook that runs properly in the desktop but does not run ok in mobile, when run via Calibre Content Server. Thanks, Avner |
![]() |
![]() |
![]() |
#2 |
Member
![]() Posts: 22
Karma: 10
Join Date: Jun 2021
Device: Any ereader for Android or iOS
|
I tried using
https://www.mobileread.com/forums/sh...58&postcount=4 Code:
QTWEBENGINE_CHROMIUM_FLAGS="--no-sandbox" ebook-viewer |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,311
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
As I told you in the other thread, the book content is rendered in a sandboxed iframe. There is no way around that. If it were not the case JS in the book would be able to manipulate the library.
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jun 2025
Device: Readium
|
This is just to say that I agree support for the JavaScript confirmation/alert dialogs would be a very useful feature to have in the calibre Viewer. I particularly like the local storage support in the calibre Viewer. Both features are available in the Apple Books app.
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jun 2025
Device: Readium
|
...however, the calibre Viewer does not seem to persist the saved values between sessions, which beats the purpose of the localStorage feature.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,311
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yes, the calibre viewer is meant for viewing books not running arbitrary applications.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Trying to view an ebook results in Add Book dialog | alleyoopster | Calibre | 2 | 08-30-2014 09:07 AM |
Comments in Metadata-dialog: Icons in normal view missing, changes in HTML not saved | ikarus1969 | Calibre | 3 | 11-06-2013 02:40 PM |
XML error dialog in code view | davidfor | Sigil | 3 | 01-30-2012 08:29 AM |
Disable Javascript in Book View | TheGreatGig | Sigil | 7 | 11-21-2011 09:32 AM |
Find Dialog and XHTML Code View | jondolar | Sigil | 0 | 10-18-2011 10:16 AM |