Future-proof your webpage archives in a unique HTML file with SingleFile

Archiving web pages is an age old problem: mostly, either you keep the content intact with PDF or Markdown files, but the format often breaks, or you just keep links but of course, web pages go down all the time. Apple has tried to address this problem with the Webarchive format, but lots of doubts have arisen about it: it seems it loads at least part of the content dynamically (causing privacy and future-proofing problems), and it famously does not work behind paywalls.

I wanted to share an amazing extension which has become important enough in my workflow that it made me ditch Safari: SingleFile, available for both Chromium-based browsers and Firefox (and only them, unfortunately).

What it does is extremely simple: it captures a snapshot of the rendered page as pure HTML and encodes all media as Base64 within the HTML page itself (hence the name, SingleFile). It allows for a faithful copy of the webpage you’re viewing in a portable, standard HTML file, which any browser can open even offline, as long as we’ll be using HTML (which is certainly a very long time).

This is really an elegant solution which gives as good results as the Evernote web clipper on a whole page, so simple that I wonder why it has not been implemented before (or elsewhere). If you need to capture web pages with the formatting intact for archival purposes (as people in the media industry often need to do), this is a great, free tool. :slight_smile: And even if it goes away, any file created with it will always work.

9 Likes

This looks very handy. Of course it doesn’t work with Safari, but I suspect that’s Safari’s fault. Worth opening Google Chrome on occasion if I need to use it.

Thanks for sharing it!

2 Likes

My pleasure! :+1:

Of course it doesn’t work with Safari, but I suspect that’s Safari’s fault.

Looking through the dev’s repository, he clearly states he does not want to pay a yearly Apple developer fee and a Mac just to port the extension to Safari. Which, despite regretting it, I think is fair criticism (and the promise of having web extensions on Safari seems to have fallen extremely flat, unfortunately).

1 Like

Yeah, needing a Mac is one thing, but an annual fee for a Safari extension is absurd.

2 Likes

I see two advantages:

  • HTML stores content essentially an infinitely-scrollable page while PDF splits content over multiple pages.

  • HTML can be edited in a text-based editor while PDF can only be edited by apps that allow such editing.

The alternative to the missing Safari extension could be to create an Automator or AppleScript option that calls on the CLI.

Thanks!

–
JJW

2 Likes

It’s an interesting concept; and I for one would be willing to help fund the Apple taxes by paying for the extension, but I 'm sure that results in problems for the developer that they do not want to face. There is so much about Safari that is broken – I almost daily encounter pages that are non-functioning in Safari. But, perhaps like others, I am a bit trapped in the slough of Safari with the extensions that I depend on daily.

2 Likes

I would too! I have even been thinking to offer the dev to take on the maintenance of a Safari branch, just because that’s a tool I would love to have there, but it’s beyond my skills at the moment (currently working on the side on Swift / SwiftUI / Core Data development, but I know next to nothing of browser extensions).

Word of warning: I have not been able to get the CLI or the Swift companion app to work. I’m probably doing something wrong though, I haven’t dug deep.

I keep trying other browsers, I love Firefox, I’m okay with Brave and Vivaldi but I keep coming back to Safari, it’s just the best designed but this could convert me — if DEVONthink plays well with the resulting files. I’ll check it out!

1 Like

Well, looks like it plays well with DEVONthink so between that and Hypothes.is’ extension I may be trying to switch from Safari yet again.

1 Like

This github repo has THE. BEST. demo animation EVER! Even with no audio, it tells you everything you need to know about how it works. Amazing and incredible…

2 Likes

If you want to use Safari and are interested in SingleFile, you can install a command-line interface for the product, found here. It requires Docker but then again, it’s all free.

The downside is, it won’t get rid of cookie notices or ads (unless you have a global ad-blocker on your system like AdGuard). For this, you might want to keep a Firefox or Chrome install on the side, and run the “Open in other browsers” extension in Safari to throw difficult links their way and save them there.

I’m finding myself gravitating back to Safari (which has the best browser interface to my taste at the moment) and I might be able to live with those compromises. :slightly_smiling_face:

Has anyone successfully used the the swift companion app?

Really? How hard is it these days to make a “web page” that works in Safari? When a page doesn’t work for me, I write off the website and blame the web developer. I figure they are doing something they shouldn’t be doing or they are following Google’s lead into non-standards based HTML/CSS/JAVASCRIPT.