4 ms·
I use the SinglePage add-on for Firefox (think it is available for Chrome as well?) to save the current page DOM to HTML as a self-contained file (inlined CSS a
by livrem 3y ago
I use the SinglePage add-on for Firefox (think it is available for Chrome as well?) to save the current page DOM to HTML as a self-contained file (inlined CSS and data:-URLs for all images) with no dependencies and all the scripts removed etc. It is not perfect, and I do not trust browsers to always remain backwards compatible, but I prefer it to save pages as PDF or as multiple files.
Interestingly one of the few pages I ever saw it fail on was this article on portable EPUBs. Guess it has too much magic going on to make the formatting work. The saved page is perfectly readable, but the style is nothing at all like what the original page was for some reason.
I like how fbreader on Android just displays all books exactly the same, and as configured in the app rather than using any of the styling from the EPUB file. I never noticed that it tried to apply CSS or run scripts included in files and I hope it never tries to do either of those things. Loading external dependencies sounds like an even worse idea and I did not think that was even allowed.
- actionfromafar 3y agoSingleFile, right? Edit: On that note, what's up with the Firefox Add-Ons? Currently, they are all setup so that to do something interesting, they need all the permissions. Which leads to a natural market being created, of bad actors go shopping for Add-Ons they can take over. Can something be done about this? For instance for this "SingleFile" addon. It needs to access the rendered document in the DOM to be able to introspect and save it all to a file. But why does it need access to everything? Can't it have just permissions: - "snapshot DOM once" - "write to a single file"
- pbronez 3y agoAgree. There are many extensions that I want to use on arbitrary websites, but rarely. This could be handled by the browser locking the extension out from everything, until the moment I manually invoke it, at which point it’s allowed access to the page I’m currently looking at. Now, maybe that’s how it already works, but I have no confidence in it.
- gildas 3y agoAuthor here, I wished SingleFile would use less permissions, but it's unforntunately not possible from a technical point of view. Anyway, if you run some code I've written but are suspicious, you have to trust me or review the code which is open-source.
- darkteflon 3y agoSingleFile is amazing - one of my most-used extensions on both desktop and mobile by far. It’s elegant, unobtrusive and it just works. Thanks for making!
- gildas 3y agoThank you for trusting me and for your kind words ;)
- vertis 3y agoI use SingleFile ALL the time. Thank you so much for it. I Perma-web anything that I find interesting, after discovering by going back in my notes that half the bookmarks I'd added no longer existed 5 years later. I don't think I could do half as good a job if it wasn't for your extension. I owe you a coffee/beer -- actually i just found your donation page, but still a drink IRL if we ever run into each other at a conference/etc.
- gildas 3y agoThank you very much for your support! I've just read your post about SingleFile and Obsidian [1]. I'm glad to see that you've managed to integrate SingleFile perfectly into your workflow :) [1] https://vertis.io/2024/01/26/how-singlefile-transformed-my-obsidian-workflow/ https://vertis.io/2024/01/26/how-singlefile-transformed-my-o...
- vertis 3y agoIt's the least I could do :)
- 3y ago
- livrem 3y agoSingleFile, yes. Thanks. Did not see it within the edit-window. I agree about permissions. In this case it looks like it needs a bit more, since it has some options like enabling auto-save after page-load for tabs for instance. Not a feature I have used, but I am sure it can be useful for semi-manually scraping sites.
- dotancohen 3y agoAnother comment explains why the page is difficult to parse: > It's a very well thought through article by the developer of Nota, trying to bring EPUB format up to parity with PDF. It's a serious start and they've already written a viewer. In fact, the article itself is displayed in a browser-based wasm port of the viewer (and looks good!).
- JadeNB 3y ago> I use the SinglePage add-on for Firefox (think it is available for Chrome as well?) to save the current page DOM to HTML as a self-contained file (inlined CSS and data:-URLs for all images) with no dependencies and all the scripts removed etc. It is not perfect, and I do not trust browsers to always remain backwards compatible, but I prefer it to save pages as PDF or as multiple files. Ha, I think that one of my first HN comments, 10 years or so ago, was how I wanted to be able to save HTML web pages as HTML, not as PDF. I'm sure I didn't explain (or understand) my reasoning well, but it was roundly regarded as a ludicrous thing to want to do. I'm glad to hear that I was just a decade out of sync.
- gildas 3y agoActually, the first release of SingleFile is 13+ years old but it was less popular at the time because Chrome (it didn't yet support MHTML) had a negligible market share. People generally saved their pages in MAFF or MHTML format in Firefox or IE. It was when Firefox abandoned XUL extensions that SingleFile was able to rise from the ashes, because there was once again a real interest in it.
- dsr_ 3y agoFBReader uses CSS from the document by default; you can turn it off in, IIRC, four stages. KOreader gives you more control but in a less friendly manner: in addition to choosing specific CSS from several supplied files, you can write your own. (Also wins for KOreader: excellent OPDS support, and easy self-hosted sync server.)
- Shorel 3y agoYes, but this article has an EPUB download button. This feature makes SinglePage unnecessary for any page using this system.
- Agraillo 3y agoFunny, my misspelling sometimes also. I suppose this has something to do with probabilities inside our brain, the phrase "Single page" might be more probable than "Single file" (Hmm, I smell some similarities to LLM probabilities). On a side note, what is interesting with SingleFile is that since the file can contain anything including JS, it's possible to create a local "executable" (html) that uses the resources inside the file and does not use a single external file. I have an actual game-like piece that runs locally with bunch of files and comparatively easily transforms into a single self-running "program" that even runs on a mobile file manager with WebView support