4 ms·
I wrote a similar feature within Polar: https://getpolarized.io https://getpolarized.io It can take full HTML files and internalize the CSS + HTML and compile
by burtonator 7y ago
I wrote a similar feature within Polar:
https://getpolarized.io https://getpolarized.io
It can take full HTML files and internalize the CSS + HTML and compiles them into a .zip file.
The major difference is that its an Electron app and not a web extension though we're about 80% of the way done porting all of it to a web extension.
In retrospect, I would have done this as an EPUB.
Our users have asked for other features like taking multiple pages and building them as one 'book' and this feature is supported in EPUB.
Also, it would mean Polar would support EPUB natively anyway which is another big feature we need as we only support PDFs right now.
I lot of people here mention MHTML and WebArchive formats.
I think my main criticism of these is that EPUB has more universal 'reader' support and EPUB 3.0 is basically just HTML in an enclosure anyway.
- gildas 7y agoActually, what is supposed to be interesting and innovative in SingleFileZ is the fact that it produces self-extracting valid zip files in the form of HTML files. Thus, they can be read natively by any modern browser that supports JavaScript.
- burtonator 7y agoAh. Interesting. That's a good innovation. How do you determine the domain/URL? I guess it's just the URL of the source? What would you do if your HTML extraction script had a bug in the pre-compiled form? I guess you're just stuck? I guess that's not the end of the world. The EPUB form in a future version of Polar would at least require an EPUB reader which makes it a bit heavier.
- gildas 7y agoSingleFileZ creates its own paths to reference all the resources of the page in the zip. This prevents any invalid path issues. The URL of the resource is stored as a comment for each entry in the zip though (I'm unsure I'm really answering to your question). If there is a bug in the extraction script, there are some chances you can still unzip the file.