Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Server

Notices

Reply
 
Thread Tools Search this Thread
Old 09-20-2023, 10:43 AM   #1
allio
Junior Member
allio began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2017
Device: Kindle PaperWhite 3 (2015) WiFi
How to access the elements in "read-book-iframe-1"?

I want to customize the contents with some javascript such as onClick event

The code below results in the error "Uncaught DOMException: Blocked a frame with origin "" from accessing a cross-origin frame."

Code:
let read_book_iframe = document.getElementById("read-book-iframe-1");
let element= read_book_iframe.contentWindow.document.querySelector('div');
allio is offline   Reply With Quote
Old 09-20-2023, 10:47 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,963
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You cannot book content is rendered in a sandboxed iframe. If you want to use javascript put it in the book you are reading.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to tag books as "to be read" "reading" "read" Xwang Library Management 17 04-24-2021 02:41 PM
Pressing "Restore Defaults" under "Book Details" wipes all "Look & Feel" settings. MarjaE Library Management 1 03-30-2021 11:46 AM
Can't access the library "Book" in T65s giotti Boyue 4 01-09-2020 02:05 PM
Touch How transfer "Books Read" and "Hours Read" data Abrakadabra77 Kobo Reader 5 02-16-2015 03:30 AM
"E-book access not so equal" from the Daily Illini Nate the great News 1 12-11-2009 01:16 PM


All times are GMT -4. The time now is 09:28 AM.


MobileRead.com is a privately owned, operated and funded community.