Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Make resources work after extraction #141

Closed
piegamesde opened this issue Nov 26, 2022 · 7 comments
Closed

Make resources work after extraction #141

piegamesde opened this issue Nov 26, 2022 · 7 comments

Comments

@piegamesde
Copy link

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 single index.html. (Or maybe swap the names, and have index_singlefile.html instead)

(Related to #102 and #119)

@gildas-lormeau
Copy link
Owner

all resources are broken

What do you mean?

@piegamesde
Copy link
Author

piegamesde commented Nov 26, 2022

Downloaded page with SingleFileZ:

image

Renamed the file to .zip, extracted it into a folder and opening its index.html:

image

(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)

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Nov 26, 2022

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.

@piegamesde
Copy link
Author

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.

@gildas-lormeau
Copy link
Owner

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.

@piegamesde
Copy link
Author

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?

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Nov 26, 2022

I agree, I'll try to document this issue. I'll need to test it in all major browsers first.

Repository owner locked and limited conversation to collaborators Aug 8, 2023
@gildas-lormeau gildas-lormeau converted this issue into discussion #161 Aug 8, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants