gildas-lormeau / SingleFile

Web Extension for saving a faithful copy of a complete web page in a single HTML file
GNU Affero General Public License v3.0
15.16k stars 994 forks source link

Re-save a folder as a self-extracting zip html file #1468

Open eugenesvk opened 3 months ago

eugenesvk commented 3 months ago

Is your feature request related to a problem? Please describe.

I save a page in the universal self-extracting zip file. Then I realized I forgot to ignore fonts, so I'd like to remove them instead of getting back to the page and resaving it

Describe the solution you'd like

Describe alternatives you've considered (optional) You can reopen the unzipped page and save it again, but then you might forget what profile was used and inadvertently change something you didn't want changed

Additional context (optional) N/a

gildas-lormeau commented 3 months ago

This is possible by opening the index.html file in the browser after extracting the zip file and save the page again with SingleFile. If you use Chrome, you need to enable "Allow access to file URLs" in the extension page, i.e. chrome://extensions/?id=mpiodijhokgodhhofbcjdecpffjipkle. Otherwise I would recommend to run a HTTP server and open the index.html through it (e.g. http://localhost:8080/saved-page/index.html).

Alternatively, you can use SingleFile CLI to re-save the page, see https://github.com/gildas-lormeau/single-file-cli.

eugenesvk commented 3 months ago

That's the workaround I mentioned and use, but you lose profile (maybe you originally saved a zip which includes searchable text, but then on resaving used a different profile)

And even when using the same profile the saved file is slightly different, has a different number of files (besides those you delete, of course). Though maybe the 2nd part doesn't matter, it's just some js chunking and such that's performed differently

Is there maybe a way to "split" the saved file into pure zip and SingleFile's metadata so you could edit the zip as you like and later combine it with the metadata into your cool universal format?

gildas-lormeau commented 3 months ago

Right now, I agree that today manipulating a self-extracting file is very complicated, if not impossible (for universal files) with existing tools. It's technically possible to implement such a tool, but it requires a bit of work.

johanssontobbe commented 1 month ago

Possibly related. I saved a lot of pages as Self Extracting Zip, and then I figured out that HTML Reader for Obsidian didn't really handle that well. So maybe a convert/edit function?

gildas-lormeau commented 1 month ago

@johanssontobbe This should be possible with SingleFile CLI, see https://github.com/gildas-lormeau/single-file-cli. You can pass a list of paths to save with the option --urls-file. You should be able to save them without using an HTTP server.