40 ms·
SingleFile: Save a complete web page into a single HTML file
- sandes 5y agowget -r url ?
- wynemo 5y agousing it to export logseq page, works perfectly.
- vymague 5y agoHow to toggle reader mode/readability? It doesn't seem to be able to save pages when I toggled chromium's reader mode on. I followed the other advice on this thread. In the options: - Annotation editor > default mode > format the page - Annotation editor > annotate the page before saving It automatically format the page into reader mode then I can click "Save the page" icon to save it. But sometimes I want to download the page as is. Like this thread for example. "Restore all removed elements" button doesn't seem to work to revert the changes. For now I just set default as mode as normal and enable "annotate the page before saving", and then click "Format the page for better readability" when needed.
- gildas 5y agoYou could also create 2 separate profiles in the options page. One profile would open the annotation editor and the other would not. Then, you would just have to save pages with the appropriate profile. To restore the page, you should click on the "format page" icon.
- vymague 5y agoThank you. I'll give multiple profiles a try. As mentioned by some of the comments. It's a good tool for managing bookmarks. ArchiveBox supposedly does something similar but I couldn't make it work.
- gildas 5y agoThank you for the feedback! Regarding the bookmark management, it could certainly be better. I would have to find some time to code a bookmark manager extension based on SingleFile maybe.
- vymague 5y agoThank you for the extension. It works well enough for my bookmarks. Just open the bookmarks on my browser and use the "Save all tabs" feature. I think I'm not the only one who wants an alternative to pocket. A bookmark manager that can archive the links to prevent linkrot.
- kosasbest 5y agoLove this. Use it all the time. Handy for saving huge pages with all the styling intact for reading offline (like on a plane). You could save a webpage as a PDF, but I prefer this over a PDF.
- anned20 5y agoI also want to give praise about the demo. It's one of the best demos I've ever seen with such a project. Nice job!
- netsharc 5y agoA 16MB gif with no playback controls, so you had to go through the tedium.
- Minor49er 5y agoI would be surprised that the author wasn't using WebM to get a smaller filesize (not to mention higher quality) but the project itself leads me to believe that the author has a lot of free disk space to use
- a1445c8b 5y agoThere’s no need to make further assumptions about the author (who btw took the time to build a very useful tool and share to in the Internet for free). Just point out the issue of the GIF and move along.
- Minor49er 5y agoI never made an assumption about the author and certainly never said that the tool wasn't useful. You can feel free to move along yourself, though.
- tomcatfish 5y agoI think you missed something here; parent wasn't insulting the author. They were inferring that someone who made an archiving tool probably has resources that help with archiving (bandwidth means access to documents and storage space means a place to save them-- you get the idea).
- alberth 5y agoFYI - there’s an official standard (MHTML) for doing this that has existed for 20+ years and exists natively in browsers. https://en.m.wikipedia.org/wiki/MHTML https://en.m.wikipedia.org/wiki/MHTML
- toqy 5y agoFor anyone else that didn't read the README, MHTML is mentioned in the comparison section https://github.com/gildas-lormeau/SingleFile#file-format-comparison https://github.com/gildas-lormeau/SingleFile#file-format-com...
- dsl 5y agoTake the comparison with a grain of salt. Not including WARC is like excluding water from a comparison of beverages, it is the baseline standard.
- geitir 5y agoAnd it generally does not do a good job
- als0 5y agoWhat are the issues?
- hulitu 5y agoFrom my experience, wrong layout,missing pictures.
- geitir 5y agoThe big one in my experience is it doesn't play well at all with JavaScript. Single file to my knowledge (I experimented with it briefly) allows all js to load on page and can then embed loaded media as base64. I think it also has heuristics to embed relevant js as well. It still only gets you 90% of the way there, and I came to the conclusion that unless you are doing web archive type work or need audio / video a composite image works well
- theden 5y agoThis would be very useful in many situations, and a great demo!
- brentcetinich 5y agoI use HAR file extractor because normally I don’t want a single file I want a replica of the web servers file system structure including any dynamically loaded assets https://blog.cetinich.net/content/2022/download-website-and-all-assets/ https://blog.cetinich.net/content/2022/download-website-and-...
- abnry 5y agoI love, love this extension. I am working on an app to turn this into a single click bookmark system on Linux. Run an inotify service to watch your downloads and then process any Single file downloads to a database and update a browsable index.
- tomaskafka 5y agoAwesome! Let's bring it up a notch - save every page automatically. Then add a search engine over that, for 'what was that article about long term effects of DDT on ecosystems I was reading a long time ago?' queries. And you get a memex - a way to outsource part of the brain to a computer :).
- sitkack 5y agoThis sounds neat.
- samstave 5y agoWANT
- rhn_mk1 5y agoI'm using Recoll for this exact purpose. Just without inotify.
- m-p-3 5y agoI archived (privately) some documentation pages from some of our vendors that were behind a login page using that just in case it became inaccessible at a critical time for us.
- jrm4 5y agoTELL ME MORE. I think I basically get the idea, what kind of database are you using? Recoll sounds like a good idea, but I'm also thinking about how I might also make this public-ish. (i.e. I teach in college and would love to have a centralized way to store and search all my assigned readings, which are most often webpages)
- abnry 5y ago
- causi 5y agoThis is great for a page. I'd love to see it expanded to include an entire site.
- rambambram 5y agoI have been using WebScrapBook (an add-on for Firefox) for some time. I really like it. Has anyone else some experience with this add-on? Good or bad.
- jjice 5y agoI've been using it for a couple years (2 maybe) and I like it quite a bit as a quick and easy way to save pages. ArchiveBox looks fantastic, but I just don't have the motivation to set up the service and maintain it since I don't save enough links to make it worthwhile. SingleFile might be worth a shot, but it looks like WebScrapBook has been handling your needs just fine (they seem to have 90% of the same functionality).
- wabarc 5y agoSimilar approaches were proposed at https://github.com/wabarc/wayback https://github.com/wabarc/wayback
- vageli 5y agoAs a webscrapbook user, do you know if there is a migration path from pocket or another hosted service?
- rambambram 5y agoDon't know about a migration option, but I do remember there's a lot of custom configuration possible.
- rambambram 5y agoThanks! ArchiveBox does indeed look fantastic. Their homepage alone is beautiful. I bookmarked both ArchiveBox and now also SingleFile, but WebScrapBook gets the job done (in almost all cases).
- 87x06 5y ago
- reidjs 5y agoUnfortunately that won't allow you to click links in your offline version. you can do this properly with wget: (sorry I don't know how to do code formatting in hackernews) wget --mirror \ --convert-links \ --html-extension \ --wait=2 \ -o log \ https://example.com https://example.com
- hombre_fatal 5y agoYou don't need to newline every flag of a trivial command.
- all2 5y agoI'm guessing the user's intent was to have the command formatted across multiple lines.
- z3c0 5y agoCode formatting is just blockquotes. So one empty space followed by indented text (2 or more spaces)
- lysium 5y agoLooks like SingleFile helps with sites where you have to be logged in, something that is not that easy with wget.
- _dain_ 5y agoWhat are you talking about? I have hundreds of pages saved with SingleFile and I can click links in all of them.
- als0 5y agoThis is great. I've always wondered why this isn't the default behaviour for page saving in browsers. To an ordinary user saving a page implies saving a single file, not a file plus a directory of stuff. HAR can be useful but seems only for niche or specialised reasons.
- edf13 5y agoThe most impressive part of the demo is seeing how tidy his Downloads folder is!
- black3r 5y agoCan we please stop with the 17MB GIF images used as demos? They use up lots of data immediately as you open the page, and are impractical, you don't know how long the animation is, can't forward/rewind, and you can't press fullscreen on a mobile. And GitHub supports embedded videos in README.md files, videos are generally smaller than GIF files and their disabled autoplay is a feature = you save your data until you press play.
- gildas 5y agoAuthor here, sorry for the GIF file. I created it because people were not happy with the video hosted on Youtube. AFAIK, video files did not work when I did this demo. I'll try to improve this in the future.
- localhost 5y agoI wanted to comment on how useful that demo was to me. It did a great job at demonstrating why this is useful and how well it works compared to the native browser implementation. Thank you both for the demo and for the project!
- gildas 5y agoThanks :)
- tux1968 5y agoWould you mind sharing which tools you used to create that demo? It is really well done.
- gildas 5y agoSure! See here https://news.ycombinator.com/item?id=30530438 https://news.ycombinator.com/item?id=30530438
- selcuka 5y agoNote that you can trim about 1/3 of that video by using an online GIF compressor such as https://www.freeconvert.com/gif-compressor https://www.freeconvert.com/gif-compressor (no affiliation).
- vincentmarle 5y agoIf it’s a single file, then how do the images get stored?
- gildas 5y agoImages are stored as data URIs [1]. Note that they could also be stored as entries in a zip file too! [2]. [1] https://en.wikipedia.org/wiki/Data_URI_scheme https://en.wikipedia.org/wiki/Data_URI_scheme [2] https://github.com/gildas-lormeau/SingleFileZ https://github.com/gildas-lormeau/SingleFileZ
- danielam 5y agoThey're base64 encoded[0]. (This is an approach I myself have used in the past for simplifying the archival of regulatory texts.) [0] https://github.com/gildas-lormeau/SingleFile/blob/15801c8ef461fb4dbaa7c878b4c977c3f9f0020f/faq.md#why-pages-saved-with-singlefile-weight-more-than-uncompressed-maff-files https://github.com/gildas-lormeau/SingleFile/blob/15801c8ef4...
- sharps1 5y agoShould be noted Manifest V3 will break this extension for chromium based browsers. https://github.com/gildas-lormeau/SingleFile-Lite https://github.com/gildas-lormeau/SingleFile-Lite
- photon-torpedo 5y agoLove the list of notable "features". :)
- a1445c8b 5y agoAlso this: > Benefits of the Manifest V3 > - None
- js8 5y agoI use SavePageWE, it can save the page (into single file) as it was modified by JS after load, which is often useful. The only thing I miss I wish it was easier to script.
- j1elo 5y agoRelated: I used to keep a collection of locally mirrored web pages a long time ago, with a legendary Firefox extension called ScrapBook [0] (now long retired). The surprise for me is that after all these years I still remembered the name... While writing this comment I found that it lived on as a (now "legacy") new extension named ScrapBook X [1], and then yet another one named WebScrapBook [2], which seems to still be alive! [0]: http://www.xuldev.org/scrapbook/ http://www.xuldev.org/scrapbook/ [1]: https://github.com/danny0838/firefox-scrapbook https://github.com/danny0838/firefox-scrapbook [2]: https://addons.mozilla.org/en-US/firefox/addon/webscrapbook/ https://addons.mozilla.org/en-US/firefox/addon/webscrapbook/
- gildas 5y agoAuthor 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 https://github.com/gildas-lormeau/SingleFile-Lite [2] https://github.com/gildas-lormeau/SingleFileZ https://github.com/gildas-lormeau/SingleFileZ
- williamdclt 5y agoThank 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!
- rahimnathwani 5y agoIf 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?
- gildas 5y agoIn 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.
- warmwaffles 5y agoThis alone is fantastic. I've been looking for an mhtml replacement that worked well across all browsers.
- mieko 5y agoThanks 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 https://github.com/mieko/trailcap
- dgellow 5y agoThat's a nice and simple tool, good work. I'm personally using Zotero to save copies of web pages: https://www.zotero.org/ https://www.zotero.org/. With the browser extension you can save a snapshot in a few seconds.
- didericis 5y agoSimilar project -> https://github.com/Y2Z/monolith https://github.com/Y2Z/monolith (I used both and ended up favoring monolith, but can’t remember why. I think they’re pretty comparable/am grateful for both of them)
- octoberfranklin 5y agoI love monolith too, especially because it is so easy to modify. Only 2300 sloc! Sure, it uses libraries to do the heavy lifting, but these are all popular, well-tested libraries with well-scoped feature sets (html5ever for parsing HTML, url for parsing urls, etc). If you're looking for a tool like this but think you might need to tweak it, you should give monolith a try.
- spankalee 5y agoWe really, really need Web Bundles to progress and fix these problems correctly, once and for all. There are a lot of things that a tool like this can never get right, and the rest is complicated work that should never need to be done if we have a standard multi-file bundle format. https://wicg.github.io/webpackage/draft-yasskin-wpack-bundled-exchanges.html https://wicg.github.io/webpackage/draft-yasskin-wpack-bundle...
- deleted 5y ago[deleted]
- treeman79 5y agoIran has a habit of using tools like this to trick defense contractors into using their page.
- assemblylang 5y agoNice project! This project, and a similar project called Monolith[0], was a bit of an inspiration for making my own single HTML file tool called Humble[1] to solve a few edges cases I was having with bundling pages (and since I wanted a TypeScript API for making page bundles). [0] https://github.com/Y2Z/monolith https://github.com/Y2Z/monolith [1] https://github.com/assemblylanguage/humble https://github.com/assemblylanguage/humble
- wabarc 5y agoAnother similar project: [0] https://github.com/wabarc/cairn https://github.com/wabarc/cairn [1] https://github.com/go-shiori/obelisk https://github.com/go-shiori/obelisk
- megaman821 5y agoIs this still on track to become a standard? https://github.com/WICG/webpackage https://github.com/WICG/webpackage
- bachmeier 5y agoMaybe a little OT, but founders should take a careful look at this landing page. That's how you sell something. The demo is clear about the problem they're trying to solve and it convinced me that their product actually solves it. It's not just all the information they've included, but also the lack of irrelevant clutter.
- ihateolives 5y agoI scrolled past the gif because I didn't realize that it was an informative gif. First few seconds looked like just an animated logo and I never stayed to watch it. Or it could've just started with an action instead of animating the logo.
- farzher 5y agoyou actually sat there and watched a 17MB gif video at 1x speed with no controls? lol. worst landing page i've ever seen
- gildas 5y agoI think this is the worst comment I've ever seen as well! ;) BTW, it's not a landing page. This is the README on GitHub.
- fender256 5y agoYou read my mind, I was exactly looking for that!
- sergiotapia 5y agoI'm building a tool for people have a personal archive to their digital life so that 30 years from now they can revisit content they enjoyed in their younger years. https://github.com/sergiotapia/ekeko https://github.com/sergiotapia/ekeko This is awesome! I would love to integrate this somehow into my project to "singlefile" bookmarks as people make them. @gildas do you have any recommendation on how to approach this with your extension? Could I run a headless chrome and trigger this extension?
- gildas 5y agoI confirm that you could use a headless browser for this. This is actually what SingleFile CLI does [1]. Here is an example of JS code showing how to configure and inject SingleFile with puppeteer [2]. [1] https://github.com/gildas-lormeau/SingleFile/tree/master/cli https://github.com/gildas-lormeau/SingleFile/tree/master/cli [2] https://github.com/gildas-lormeau/SingleFile/blob/master/cli/back-ends/puppeteer.js https://github.com/gildas-lormeau/SingleFile/blob/master/cli...
- sergiotapia 5y agoThank you!
- necovek 5y agoGreat stuff! For some reason, I went in expecting to see a JS-enabled multi-page web site into a SPA in a single HTML file, but I didn't expect to see images get embedded. Perhaps offer a recursive traversal option too, but don't try that on Wikipedia :)
- manigandham 5y agoRelevant 'awesome' list for web archiving: https://github.com/iipc/awesome-web-archiving https://github.com/iipc/awesome-web-archiving There are many similar tools there, from archiving to rendering.
- givemeethekeys 5y agoNaming a thing takes creativity and luck. Congratulations on an excellent name!
- moffkalast 5y agoThis is what 10 year old me thought "Save As" in IE would do, but soon realized the harsh reality of "that's not how any of this works".
- avivo 5y agoWhy does this need to: - Read and change all your data on all websites - Modify data you copy and paste - Manage your downloads Is there a way to use a version that requires less of these permissions? e.g. it seems we can address the first permission by only activating it on click, but I'm not sure if that addresses the other ones.
- gildas 5y agoI try to use optional permissions as much as I can. The first permission is required because of assets and frames stored on third-party servers. The second permission should be optional, I don't remember why it's not. I'll try to see if I can make it optional. The last permission is required in order to save the page on the filesystem with the "downloads" API. Note that even if I make these permissions optional, you might still have to trust me anyway ;)
- deleted 5y ago[deleted]
- Mr_Modulo 5y agoThis is good for people who don't have constant internet access who need to reference web resources offline. Webpage saving technology does not seem to have kept pace with the evolution of the web. Images loaded by CSS aren't saved at all. JavaScript on the page will often hijack a saved page and not let it display at all. One option that works fairly well and does not require installing a browser extension is to save the page as a PDF. I wish browser developers would put more effort in this area.
- ctxc 5y agoBeen eyeing this for a long time! I'm building a bookmark app, and I plan to use this to save bookmarks! I'm a simple man, nothing too fancy. Here's a crude demo in progress - https://zewallet.netlify.app/ https://zewallet.netlify.app/ Follow progress here - https://twitter.com/recursiveSwings/status/1491772387464908805 https://twitter.com/recursiveSwings/status/14917723874649088... Would love to have ANY tips or feedback!
- TehShrike 5y agothe signup email confirmation link points to http://localhost:3000/ http://localhost:3000/ btw I'm definitely in the market for a bookmark service that archives my bookmarks, Diigo stopped working a year or two ago, and Pinboard can't stay up
- ctxc 5y agoAhh damn, should fix it! For now, you can edit the URL manually to take a peek. If you're interested, feel free to send a DM on Twitter @recursiveSwings, I'll let you know once it's in Beta! :)
- ctxc 5y agoFixed now!
- cxr 5y agoZotero deals with this reasonably well—and happens to be using SingleFile under the hood. Its landing page just targets a specific audience (academics), which means probably upwards of 90% of the people who would happily use it probably end up bouncing after thinking, "This isn't for me", before ever trying it. Give it a shot.
- wetpaws 5y agoAh, millennials invented .mht
- tzs 5y ago> For security reasons, you cannot save pages hosted on https://chrome.google.com https://chrome.google.com, https://addons.mozilla.org https://addons.mozilla.org and some other Mozilla domains. Interesting. What is it about those pages that makes saving them raise security issues?
- amccollum 5y agoMaybe because JS files (specifically add-ons) run from the local filesystem are given escalated privileges compared to normal usage, perhaps for ease of development. I'm just speculating, though.
- varenc 5y agoI think it’s a limitation on all extensions applied by Chrome/Firefox. My guess is to stop extensions from making you force install more extensions or something... (Also what’s up Andrew! YC S09 represent :wave_emoji:)
- Isthatablackgsd 5y agoThat is not the extension issue, that's the Google/Mozilla policy thing.
- kwhitefoot 5y agoThe list of problems that Manifest V3 causes are just more reasons to never use Chrome.
- zmix 5y agoI'd also recommend "Print Edit WE" and "Save Page WE" [2] for Chrome type browsers, both by one author. First one allows for editing of the page before printing/saving (as a single page HTML or MHTML), second one allows for single-page save. [1] https://chrome.google.com/webstore/detail/print-edit-we/olnblpmehglpcallpnbgmikjblmkopia https://chrome.google.com/webstore/detail/print-edit-we/olnb... [2] https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof https://chrome.google.com/webstore/detail/save-page-we/dhhpe...
- pan69 5y agoIn the olden days, Internet Explorer used to allow you to do this by saving the page to a HTM file. It would be a single archive with HTML and images etc embedded. New browsers don't seem to do this, the create a separate folder for the assets, which is super annoying.
- nickflood 5y agoThe Chromium Edge can produce .MHT files as well
- sam0x17 5y agoBack in the day this was always one thing that had me begrudgingly and shamefully opening IE so I could save a page as an MHT file. So long ago now. Cool to see this idea has been revived and not in a proprietary way
- dtjohnnymonkey 5y agoThank you! I've been looking for this for a while, nice to see someone finally did it!
- phil294 5y agoHow old is that demo gif? I just tried reproducing the normal saving shortcomings, and the bottom image ("Example of an SVG image with embedded JPEG images") loads just fine from the local folder, so this seems outdated. That being said, it's a bit weird that this kind of tool is even necessary at all. I would have expected native saving to include CSS background graphics as well, but apparently they don't for some reason, so I think this is pretty useful. Until now, I have also used pandoc (--standalone) to merge all resources into a single HTML file which worked great.
- gildas 5y agoThe demo is approximately 2 years old. Things probably changed meanwhile.
- wanderer_ 5y agoDang it, he beat me to it! I have been toying with the idea for quite some time, but this implementation is great, better than mine would have been, so I'm glad he did it. Maybe I'll make a CLI implementation (sorta like wget but with this tacked on...)
- xnx 5y agoI love SingleFile and have been using it for years! Is there any version that works on current mobile browser versions? I've stuck with an old version of Firefox on Android that still supports the extension.
- gildas 5y agoYou should be able to use it on Firefox for Android Nightly (which is very stable) by following this procedure: https://blog.mozilla.org/addons/2020/09/29/expanded-extension-support-in-firefox-for-android-nightly/ https://blog.mozilla.org/addons/2020/09/29/expanded-extensio... > approx
- manor 5y agoIf you keep the javascript, you also get the world's most portable (desktop) application format...
- steren 5y agoChrome can save to a single file (.mhtml). I am not sure I understand the difference.
- gildas 5y agoThe difference is the output format. I created SingleFile before Chrome supported MHTML files. At that time, to save web pages in a single file, the only technical solution in Chrome was to implement something like SingleFile. The advantage of HTML is that this format is much more durable though.
- steren 5y agoThat makes sense. I also used Data URIs to generate distributable web pages.
- Isthatablackgsd 5y agoYes, there is .mhtml but it execution plainly sucks because it didn't exactly saves everything. It would attempts to save but it won't be valiant at it, it is like using mhtml without "force (-f) argument".
- stanislavb 5y agoOpening the repo makes you download a 17MB gif. I hope you are not on expensive mobile connection. p.s. the demo is nice
- civilian 5y agoI was hoping this tool also solved a problem that comes from saving & reproducing JS-framework-heavy websites. Here's the bug: According the HTML spec, elements like <h2> and <div> cannot be inside <a> tags. But using js you _can_ push <div>s instead of <a>s. (It happens from document.insert-type functions, frameworks like Angular/React allow this) Look at nasa.gov, there's html: <a href="/press-release/nasa-invites-media-to-next-spacex-commercial-crew-space-station-launch-0" date="Wed Mar 02 2022 10:35:00 GMT-0800 (Pacific Standard Time)" id="ember196" class="card ubernode cards--card cards--2row cards--2col nodeid-477815 ember-view"><div class="bg-card-canvas" style="background-image: url(/sites/default/files/styles/2x2_cardfeed/public/thumbnails/image/51846702013_a0cc55100a_k.jpeg);"> <!----> <h2 class="headline"> ... </h2> </div> </a> After running this through SingleFile you can visually see the changes, but the html changes are: <a href="/press-release/nasa-invites-media-to-next-spacex-commercial-crew-space-station-launch-0" date="Wed Mar 02 2022 10:35:00 GMT-0800 (Pacific Standard Time)" id="ember196" class="card ubernode cards--card cards--2row cards--2col nodeid-477815 ember-view"></a> <div class="bg-card-canvas" style="background-image: url(/sites/default/files/styles/2x2_cardfeed/public/thumbnails/image/51846702013_a0cc55100a_k.jpeg);"> <h2 class="headline"> ...</h2> The way that sites like Wayback Machine handle this is by using the web-replay library Wombat https://github.com/webrecorder/wombat https://github.com/webrecorder/wombat that also uses JS to insert those elements. But what the hell! I was working on a similar html-downloading/reproducing tool and this bug really bothers me. I'd either like the HTML reading standard to be updated to accept <div> inside of <a>, or also make that impossible to do via JS.
- gildas 5y agoI think this issue could be circumvented by manipulating the page (replacing images, frames, css etc.) in the tab itself (SingleFile does it in background with a DOMParser instance). The trick is to avoid HTML parsing.
- codeflo 5y agoDoes this simply remove the JavaScript or do something more clever? Because I think in the age of SPAs, the proper way to save "content pages" might be to execute the JavaScript once and serialize the resulting DOM back to HTML. I didn't find anything in the FAQ that explains if it does something like that.
- gildas 5y agoIt saves what you see (and remove JS by default). There is an option to embed the JS and another one to save the "raw" page but I would not say it is reliable. The cleverness lies more in the ability to produce light pages.
- IggleSniggle 5y agoWhat a cool project! I love the way this embeds images. One of things I miss most, though, when going back to old sites, is embedded audio or video. From looking at the options, it seems like it might be able to handle encoding video and/or audio as Data URIs, but it's not totally clear if SingleFile does this or not. I wasn't sure if I was doing the correct things to force this behavior in the options. It would be great if the README could clarify how these are handled by SingleFile. Sometimes it might be nice to be able to embed these sorts of things, even if it does make the HTML ridiculous and bloated. Or, barring that, maybe just a recommendation to use one of the other formats in the comparison table for this kind of use case.
- mysterypie 5y agoSecurity question: Is a web extension safe if it is installed but if you're not using it at the moment? For example, if I were logged into my bank's website and I did not click the SingleFile button in the extension toolbar, could it still theoretically collect info from my bank's webpage or do other actions? I'd like to use SingleFile and have no reason at all to distrust it, but I'd like to understand the security impact of installing lots of web extensions. How do people handle security risks like that? Do you run a separate vanilla browser with no extensions for sensitive tasks?
- gildas 5y agoFor technical reasons beyond my control, SingleFile injects a (very small) script when the page loads even if you don't click on the button. It could also send any data to a third party server. Unfortunately, it is therefore impossible for me to technically and formally guarantee that SingleFile cannot behave maliciously. Note however that the extension has the status "recommended" on Firefox and that it undergoes a manual code review by Mozilla at each update.
- fmntf 5y agoCould you please elaborate what script is injected, that reason and why it is that out of your control? Thank you
- gildas 5y agoI will do it, but it will take me some time to explain it and rather than answering on HN I will integrate it in the FAQ. I created an issue for this here: https://github.com/gildas-lormeau/SingleFile/issues/885 https://github.com/gildas-lormeau/SingleFile/issues/885.
- varenc 5y agoOn Chrome you can go into extension settings and adjust permissions so SingleFile only has permissions “on click”. Then it won’t/can't inject that little JS snippet into a page until you actually want to use the extension. The only downside is that after enabling you then have to refresh the page for the extension to do its work. I wish this behavior was more well known and encouraged by Google.
- ilrwbwrkhv 5y agoThanks for this. I expected to see a pricing link somewhere, having been attuned to all the subscription Saas these days. Glad to see there are tools offering immense value for free still.
- gildas 5y agoIt is in fact more or less self-financed by... hmmm... a SaaS that I market but it's in B2B.
- slmjkdbtl 5y agoDoes it create an inline dataurl for each image even if they're the same?
- gildas 5y agoMost of the time, it will be able to deduplicate them. For example, if you save this page https://groups.google.com/a/chromium.org/g/chromium-extensions/c/3QAinUhCiPY https://groups.google.com/a/chromium.org/g/chromium-extensio..., each different avatar will be embed only once. To achieve this, SingleFile stores the content of duplicate images in CSS custom properties, displays them as background images in the IMG tags and uses a (properly sized) transparent SVG image as SRC. Thus, stylesheets are not broken.
- slmjkdbtl 5y agoNice, that definitely saves some space
- gildas 5y agoIn fact, SingleFile implements several ways to save space. In practice, the most effective mechanism is shaking the CSS tree. It's amazing how much CSS is useless in a page. It's especially annoying for SingleFile if it contains images... That's why SingleFile removes (almost) all unused rules, selectors and CSS properties by calculating the CSS cascade.
- leephillips 5y agoEven after reading the praise here I wasn’t prepared for how good and useful this extension is. It’s a perfect solution for saving local copies of web pages. I do this frequently, and am surprised I didn’t know about this until today. Even the way it handles settings for the extension is great, with good, built-in documentation. The ability to add annotations is icing, and since they become part of the HTML there is no lock-in or special file format needed.
- 87x06 5y ago
- jasonfarnon 5y agoDoes it have the option to automatically save every page you navigate to? There were some extensions back in the 2000s ("slogger" I think was one, "shelve" or something similar was another) but I don't think they work any more. The pages I think to save now are never the ones I want to look at 5 years down the road.
- bscphil 5y agoIt does, although I doubt you would want to do this, it's rather slow.
- pagekicker 5y agoMicrosoft had something called MHTML that did this about 20 years ago ... Tablet PC era.
- UberFly 5y agoI've been using this since Martin posted about it on Ghacks. Love using it and thank you gildas.
- TimTheTinker 5y agoFrom the warning before installing in FireFox: Add SingleFile? This extension will have permission to: - Access your data for all websites - Input data to the clipboard - Extend developer tools to access your data in open tabs - Download files and read and modify the browser's download history - Access browser tabs ... all of which I don't mind, as long as the extension can't exfiltrate any of the data it can access (send it to a third party). i.e. - no network connections from the extension - no modifying web pages or executing any code in the context of a web page Does anyone know whether these sorts of extensions can exfiltrate data? -- this is a concern if the project author's credentials are stolen by a threat actor, which has happened before.