View Single Post
Old 07-19-2021, 06:56 PM   #1
avnermoshkovitz
Member
avnermoshkovitz began at the beginning.
 
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.
Is it possible to use iframe with attribute sandbox="allow-modal" within the page, e.g.

Code:
cat EPUB/xhtml/raw/ch1.xhtml 
...
<iframe sandbox="allow-modal">
  ...
</iframe>
to show the alert?

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
avnermoshkovitz is offline   Reply With Quote