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

creating blob in the readium (because of this ,facning data migration) #747

Open
mohan9000 opened this issue Oct 22, 2020 · 3 comments
Open

Comments

@mohan9000
Copy link

mohan9000 commented Oct 22, 2020

hi , we have found that there is blob creation in the readium library and assigning that value to the iframe src , and for the data-src assigning differently is there any particular reason for doing that, please consider this one as priority

@mohan9000
Copy link
Author

example

please find this attachment

@mohan9000
Copy link
Author

in the above attachment there are two different values for the src and data-src

@danielweck
Copy link
Member

Blobs URI are used when some pre-processing is required on EPUB resources, or when the EPUB container itself is zipped instead of "exploded" (i.e. unzipped).
For example, drag-and-dropping an EPUB file onto the web/cloud reader triggers a code path that stores the EPUB in memory, and extracts / inflates resources from the EPUB container dynamically, whenever the webview requests them (i.e. byte ranges / binary buffers => Blob URIs).
Another example is when loading an exploded EPUB (i.e. not zipped) from an HTTP server, and when some resources are "encrypted" (e.g. obfuscated fonts). In this case, a wholesale replacement of all font references (i.e. URLs) is necessary, and unfortunately this is a "viral" behaviour that impacts all associated resources: fonts faces are declared in CSS, so the stylesheets must be "patched" and consequently served as Blob URIs ... but stylesheets are referenced from HTML files, so they too must be converted to binary blobs.
Finally, there is the base case of the top-level HTML file (i.e. the one passed to its host iframe), which needs to be injected "ahead of time" with custom CSS or MathJax (this is from the top of my head, I do not remember exactly). When this is needed, the HTML URL becomes a Blob URI, and the <head><base href="..."> construct is used so that resources linked from the HTML document can simply resolve with their normal URL (i.e. not Blob).

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

2 participants