Make resources work after extraction #161
Replies: 7 comments
-
What do you mean? |
Beta Was this translation helpful? Give feedback.
-
Downloaded page with SingleFileZ: Renamed the file to .zip, extracted it into a folder and opening its (the GitHub logo you can see on the second image only works because it is a html-embedded SVG in the first place, so no external resource) |
Beta Was this translation helpful? Give feedback.
-
It's a limitation of the browser because you're opening the page from the filesystem. If you use an HTTP server, resources will be displayed as expected. |
Beta Was this translation helpful? Give feedback.
-
Oh, indeed. I'm sorry for the confusion then, I thought this limitation only applied to the single-file archive and not to the extracted contents. |
Beta Was this translation helpful? Give feedback.
-
Note that it used to work in the past, but vendors make the use of the filesystem less and less convenient, probably for security reasons. |
Beta Was this translation helpful? Give feedback.
-
I see. Then the best thing we can do is to warn users about this better, not sure how though. Maybe add a README to the archive that hints at miniserve or something like that? |
Beta Was this translation helpful? Give feedback.
-
I agree, I'll try to document this issue. I'll need to test it in all major browsers first. |
Beta Was this translation helpful? Give feedback.
-
I really like the concept of having all resources bundled in a zip file, as opposed to having to embed them as base64 in the html. However, it's a bit unfortunate that the extracted output only works as zip file: when extracting the contents and opening it, all resources are broken. It'd be cool to have both. The idea is that JavaScript is only required for the single-file, and one still has a fully static archive if needed.
I don't know much about how this works internally, but for me it'd be fine if the zip archive contained a separate
index_archive.html
that does this job instead of having everything within a singleindex.html
. (Or maybe swap the names, and haveindex_singlefile.html
instead)(Related to #102 and #119)
Beta Was this translation helpful? Give feedback.
All reactions