News for hackers. Stuff that matters.
Re:SingleFile: Save a complete web page into a single HTML file by gildas on Wednesday March 02, 2022 @11:39AM (#30529269)
Author here, it makes me really happy to see SIngleFile on the front page of HN. Thank you! I take the opportunity to make you aware of the upcoming impacts of the Manifest V3 [1], and for those who prefer zip files, I recommend you to have a look here [2].

[1] https://github.com/gildas-lormeau/SingleFile-Lite

[2] https://github.com/gildas-lormeau/SingleFileZ

Re:SingleFile: Save a complete web page into a single HTML file by mieko on Wednesday March 02, 2022 @12:15PM (#30529803)
Thanks for this project. I found SingleFile a year or two ago, and used it to take "HTML Screenshots" of third party sites I could embed in guided walkthroughs with modified/example data changed, instead of just PNGs.

SingleFile was ultra-valuable for this.

If anyone has a similar use-case, I wrote some pretty rough (and slow) code to post-process SingleFile's output to remove any HTML that wasn't contributing to the presentational render by launching puppeteer and comparing pixels. It's available here: https://github.com/mieko/trailcap

Re:SingleFile: Save a complete web page into a single HTML file by gildas on Wednesday March 02, 2022 @12:24PM (#30529903)
It's interesting! I had started something similar as part of testing but hadn't really finished my work. I will have a look at your project.
Re:SingleFile: Save a complete web page into a single HTML file by bscphil on Wednesday March 02, 2022 @09:51PM (#30536536)
One very useful thing you could add to this (if you feel like it) would be to make it work with snapshotted directories, rather than a single HTML file with inlined data. You can get the former with SingleFileZ and then extracting the resulting zip file.

I like these because it makes it easier for me to make manual edits when necessary and it's a better solution for long term archiving (IMO). But I would love to add your project to my workflow.

Re:SingleFile: Save a complete web page into a single HTML file by MandieD on Wednesday March 02, 2022 @06:28PM (#30534935)
Oh, that’s such a good idea for documentation - thanks for sharing!
Re:SingleFile: Save a complete web page into a single HTML file by badsectoracula on Wednesday March 02, 2022 @12:19PM (#30529844)
Single File is one of my favorite addons since it allows me to keep offline copies of articles, tutorials, etc i see online without losing images, etc (there have been a ton of articles lost over the years and while some are preserved in archive.org, they often lack things like images, etc, so i prefer to save anything i come across). So thank you for making it :-).

Now, having said that, the text in SingleFile-Lite's "Notable features of SingleFile Lite" sound like a list of issues :-P. It looks like these are issues with Chrome, but do you know if/how these "improvements" will affect Firefox?

Re:SingleFile: Save a complete web page into a single HTML file by gildas on Wednesday March 02, 2022 @12:23PM (#30529881)
AFAIK, for the moment Mozilla is aware of the regressions that Manifest V3 causes and shows a good will to try to reduce them as much as possible. You can find some information about this here https://github.com/w3c/webextensions/tree/main/_minutes
Re:SingleFile: Save a complete web page into a single HTML file by saaspirant on Wednesday March 02, 2022 @08:22PM (#30535911)
I use archivebox(Django-based) for keeping offline copies (which uses SingleFile and few other libs in backend) https://github.com/ArchiveBox/
Re:SingleFile: Save a complete web page into a single HTML file by wabarc on Thursday March 03, 2022 @07:30AM (#30540055)
You might be interested in https://github.com/wabarc/wayback, a chat-based archiving tool.
Re:SingleFile: Save a complete web page into a single HTML file by joisig on Wednesday March 02, 2022 @02:37PM (#30531842)
Thank you for the Manifest V3 critique, the examples you give make it really clear how many things are regressing with this upcoming change :/
Re:SingleFile: Save a complete web page into a single HTML file by gwbas1c on Wednesday March 02, 2022 @01:23PM (#30530812)
FYI: Figure tags don't convert their hrefs to base64.

For example, try saving my home page: https://andrewrondeau.herokuapp.com/

The img tags are converted correctly, but there's still <figure class=image><a href="https://andrewrondeau.herokuapp.com/... in the single HTML file.

Re:SingleFile: Save a complete web page into a single HTML file by gildas on Wednesday March 02, 2022 @01:28PM (#30530877)
I cannot reproduce your issue, I just did a test on this page and I see the expected `<img src="data:image/jpeg;base64,...` in the saved page.
Re:SingleFile: Save a complete web page into a single HTML file by gwbas1c on Wednesday March 02, 2022 @08:27PM (#30535942)
Look for figure tags, not image tags

Even better, just search for ="http

Re:SingleFile: Save a complete web page into a single HTML file by gildas on Wednesday March 02, 2022 @08:36PM (#30536011)
All I can find is a <a> tag.

Edit: I think I now understand the issue. I confirm SingleFile saves only the current page and not linked images, for example.

Re:SingleFile: Save a complete web page into a single HTML file by JeremyNT on Wednesday March 02, 2022 @01:37PM (#30530993)
I've been using SingleFile for the last year or so, it's amazing!

I'm going to hijack your post for a question! I love the way you can use the editor and select "format for better readability," then save just the stripped down version of the page. I use this to send it to my e-ink device.

The question I have is whether it's possible to toggle the default save to use the formatted version automatically? I dug into the options and didn't turn anything up!

Re:SingleFile: Save a complete web page into a single HTML file by gildas on Wednesday March 02, 2022 @01:48PM (#30531149)
You can enable these options for this:

- Annotation editor > default mode > edit the page

- Annotation editor > annotate the page before saving

Re:SingleFile: Save a complete web page into a single HTML file by gildas on Wednesday March 02, 2022 @05:58PM (#30534589)
Sorry, I was wrong, you have to select "format the page" instead of "edit the page" (first item).
Re:SingleFile: Save a complete web page into a single HTML file by williamdclt on Thursday March 03, 2022 @06:56AM (#30539792)
Thank you for your work! I've been using start.me for my new tab page (it's the page you see every single time you open a tab, I can't believe most people don't make it useful), but it's way too slow so I SingleFile it and have a local Firefox extension to set it as my new tab page.

It's too complicated but at least it works!

Re:SingleFile: Save a complete web page into a single HTML file by aantix on Wednesday March 02, 2022 @01:23PM (#30530794)
Is it possible to use this within the context of the current web page, without the extension portion?

Taking a snapshot of my user's screen and then display it to them later (maybe in an iFrame)?

Re:SingleFile: Save a complete web page into a single HTML file by gildas on Wednesday March 02, 2022 @01:31PM (#30530918)
It's possible but it's a bit limited. It won't be able for example to save images coming from a different origin.
Re:SingleFile: Save a complete web page into a single HTML file by hrgiger on Wednesday March 02, 2022 @12:32PM (#30530037)
Thanks for the work you have done, its a lazy man heaven especially for bulk downloads and helped me a lot. About a month ago I have decided to backup my bookmarks via archivebox, it was more than 1k bookmarks, most reliable methods were singlefile and wget.
Re:SingleFile: Save a complete web page into a single HTML file by graderjs on Wednesday March 02, 2022 @10:47PM (#30536919)
Well done, gildas! You have really built a quality product and marketed your work well.
Re:SingleFile: Save a complete web page into a single HTML file by unicornporn on Thursday March 03, 2022 @01:06AM (#30537735)
I love it and use it. But product? Nothing is being sold and product sounds almost condescending. :)
Re:SingleFile: Save a complete web page into a single HTML file by graderjs on Thursday March 03, 2022 @01:52AM (#30537959)
> But product? Nothing is being sold and product sounds almost condescending. :)

Really!? You don't think it's trying to be condescending to try to find criticism on someone's praise, haha? Heh, aanyway :) You feel product is bad!? So weird!! I guess you find there what you bring to it. Wonder what you're protecting there, if you share more of your thinking, we can do know you more. Even so, I think we can just celebrate gildas' achievement! :)

Re:SingleFile: Save a complete web page into a single HTML file by gildas on Thursday March 03, 2022 @05:02AM (#30539157)
Thank you Cris!
Re:SingleFile: Save a complete web page into a single HTML file by austincheney on Wednesday March 02, 2022 @01:24PM (#30530821)
Twelve year project with nearly 7000 commits shows a lot of dedication. Good work.
Re:SingleFile: Save a complete web page into a single HTML file by rahimnathwani on Wednesday March 02, 2022 @12:04PM (#30529645)
If I start using SingleFile today, will I still be open saved pages after the update to Manifest V3?

I mean, if I want to save pages over the next 11 months, should I install SinglePage or SinglePage-lite?

Re:SingleFile: Save a complete web page into a single HTML file by gildas on Wednesday March 02, 2022 @12:08PM (#30529698)
In fact, you simply do not need an extension to open pages saved with SingleFile (or SingleFile Lite) because they are standard HTML pages. So you don't have to worry about that.
Re:SingleFile: Save a complete web page into a single HTML file by warmwaffles on Wednesday March 02, 2022 @12:19PM (#30529849)
This alone is fantastic. I've been looking for an mhtml replacement that worked well across all browsers.
Re:SingleFile: Save a complete web page into a single HTML file by cloudwizard on Wednesday March 02, 2022 @01:39PM (#30531021)
Is there a configuration for the zip version where I can avoid duplicating the static assets? Thanks
Re:SingleFile: Save a complete web page into a single HTML file by gildas on Wednesday March 02, 2022 @01:45PM (#30531103)
I guess you're referring to SingleFileZ. This option is not needed because zip files (i.e. what SingleFileZ produces) already provide this feature.
Re:SingleFile: Save a complete web page into a single HTML file by stragio on Wednesday March 02, 2022 @12:52PM (#30530319)
Very nice! Will use it for sure. May I ask you how you created that good looking demo gif?
Re:SingleFile: Save a complete web page into a single HTML file by gildas on Wednesday March 02, 2022 @01:00PM (#30530438)
I used:

- ScreenToGif to record video sequences and produce the final GIF: https://www.screentogif.com/

- Macro Recorder to record and replay user navigation: https://www.macrorecorder.com/

- Blender to edit the video, add text comments, and make the intro: https://www.blender.org/

Re:SingleFile: Save a complete web page into a single HTML file by e19293001 on Wednesday March 02, 2022 @08:34PM (#30535985)
Thank you for sharing!
Re:SingleFile: Save a complete web page into a single HTML file by narag on Wednesday March 02, 2022 @03:40PM (#30532792)
Thank you, very useful and works like a charm: a must have.