Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to read renderless.html file when i change the url to my book #1369

Open
awahab3109 opened this issue Jan 14, 2024 · 3 comments
Open

Comments

@awahab3109
Copy link

awahab3109 commented Jan 14, 2024

I was using renderless.html as an example to get all the data in sections so that I can apply turn.js library on it. The problem i am facing regarding opening of the book is that when i use the url as specified in example, (https://s3.amazonaws.com/epubjs/books/moby-dick/OPS/package.opf), i get all the section data ,but when i changed it into my own url, it throws an error on book.spine.get(item) function. It shows CORS error, although i already have set the CORS Origin on my digital ocean , I also tried to set {contained:true} in my book constructor, but no result.
Screenshot from 2024-01-14 19-59-18
If it's really a cors error why am I unable to open it using file input too. Keep in mind, I am able a file i downloaded from google, but unable to open the one I built myself

@zhanglun
Copy link

As shown in the error message in the screenshot, you cant access "file://xxx" with XMLHTTPRequest.
By default, XMLHttpRequest (XHR) is not allowed to access the file:// protocol for security reasons. This is due to browser policies and security restrictions.

maybe you can serve your demo with local server and access the files via the HTTP or HTTPS protocol.

@awahab3109
Copy link
Author

As shown in the error message in the screenshot, you cant access "file://xxx" with XMLHTTPRequest. By default, XMLHttpRequest (XHR) is not allowed to access the file:// protocol for security reasons. This is due to browser policies and security restrictions.

maybe you can serve your demo with local server and access the files via the HTTP or HTTPS protocol.

thanks for the reply, but unfortunately your solution didn't work

@johnfactotum
Copy link
Contributor

See #1397 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants