Re:Show HN: Make your HTML documents portable by converting ...
by assemblylang on Wednesday February 09, 2022 @04:49PM
(#30279026)
I made a tool like this called humble[0] with a CLI interface that base64 encodes and inlines everything in an HTML file, images, audio, video, CSS, JS, favicons, cursors. The file sizes will be large of course (base64 encoding incurs a 34% size penalty), but useful in cases where you want portable single file documents.
Re:Show HN: Make your HTML documents portable by converting ...
by iggldiggl on Wednesday February 09, 2022 @09:15AM
(#30272829)
If you follow Google's official recommendations as to how file system access is supposed to work on Android, you can't resolve any relative paths with regards to files received from other apps.
So if you're e.g. using a file explorer (one app) to browse through your storage and then open an HTML file in a browser (a different app), then the browser is officially unable to resolve any relative paths in that HTML files, so no images, no links, no style sheets, no scripts, no nothing.
Re:Show HN: Make your HTML documents portable by converting ...
by Jaruzel on Thursday February 10, 2022 @09:38AM
(#30286605)
If you Save a page via your browser, it[1] creates the .html file, plus a sub-folder of the same name with all the assets in. The html gets re-written to reflect the new file paths.
---
[1] In Chrome, IE, an Edge definitely. Not sure about Firefox or Safari.
[0] https://github.com/assemblylanguage/humble
So if you're e.g. using a file explorer (one app) to browse through your storage and then open an HTML file in a browser (a different app), then the browser is officially unable to resolve any relative paths in that HTML files, so no images, no links, no style sheets, no scripts, no nothing.
---
[1] In Chrome, IE, an Edge definitely. Not sure about Firefox or Safari.
> Not sure about Firefox
It does that, too.