Live data from Hacker News

Show HN: Kage – Shadow any website to a single binary for offline viewing

github.com

111–120 of 152 posts

Re: Show HN: Kage – Shadow any website to a single binary for offline viewing

#111
post #81

Earlier quoted context omitted.

Exactly. For downloading, Kage requires Chrome or Chromium. Running it inside Docker makes setup easier and keeps cleanup simple: https://github.com/tamnd/kage/blob/main/Dockerfile Btw, let me think the way to only enable this when running inside Docker.

Docker is designed to be undetectable by default, the best way I have found is to set env IN_DOCKER=True manually in your Dockerfile + check that there is no $DISPLAY configured + that you're on linux. Usually if all/most of those are true you can safely add --no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage etc. all the docker-specific flags. Thats what we do in https://github.com/ArchiveBox/ArchiveBox/bl…

It should be fixed by https://github.com/tamnd/kage/pull/12

Thanks for nice trick.

Re: Show HN: Kage – Shadow any website to a single binary for offline viewing

#112
post #52

Earlier quoted context omitted.

Somewhere around 2019, each document loaded from file:// became its own origin in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1500453 (I didn't check when this happened in Chromium) Related WHATWG discussion: https://github.com/whatwg/html/issues/3099

Yeah, but that's fine, the document is .html, and it can load ./app.js or ./style.css just fine even if loaded by file:// (as long as it isn't initiated by JS itself, then Origin starts to matter a lot more), otherwise basically every single local HTML file would suddenly be broken, I don't think anyone would have accepted that even with the origin changes.

React and Angular are completely broken through file://

Re: Show HN: Kage – Shadow any website to a single binary for offline viewing

#113
post #14
post #10

One use I'd have for this is company wikis that you want to give folks easy offline access to (maybe the wiki has documentation that's useful at sites that don't have cellular coverage). Cool! It would be especially cool to have a version that didn't require the separate serving process - even though it's nifty you can package up a whole site as a single binary. Maybe a single HTML entrypoint shim with a bit of javas…

Submitting this to Hacker News is the right place! Thanks for your idea. I will consider implementing that :) Also, in my mind, I already have a script/program to convert HTML to Markdown, so it could actually store everything on disk as a folder of Markdown files, and then commit them to a Git repo.

I'd like to request something between what GP suggested and what your program is doing currently - basically I still want a single binary, but instead of embedding a full browser in it, I would like the binary to be just a self-extracting archive that calls the user's default browser, maybe in a new window/frame.

Basically I'm looking for something like the old-school .chm files on Windows, where you could pack a bunch of HTML documents into a single archive and open it without needing to embed a full browser engine.

This would have the advantage of keeping the file sizes really small. And you don't have to worry about the browser engine become outdated and potentially becoming an attack vector.

Re: Show HN: Kage – Shadow any website to a single binary for offline viewing

#114
post #72

Earlier quoted context omitted.

You can also do an animated svg which is way smaller than a gif because it's just text keyframes ( https://github.com/vytskalt/pseudoc/blob/main/assets/factori... )

How can you do it? I don't see an SVG output from ascii-gif.

it might be this: https://github.com/mrmarble/termsvg

Re: Show HN: Kage – Shadow any website to a single binary for offline viewing

#116

Earlier quoted context omitted.

Yeah, but that's fine, the document is .html, and it can load ./app.js or ./style.css just fine even if loaded by file:// (as long as it isn't initiated by JS itself, then Origin starts to matter a lot more), otherwise basically every single local HTML file would suddenly be broken, I don't think anyone would have accepted that even with the origin changes.

React and Angular are completely broken through file://

I don't know about Angular but React works perfectly fine through file://. I'd think the bundler/packager matter more than whar JS libraries you use, you sure you're not actually thinking of something else not handling file:// properly?

Re: Show HN: Kage – Shadow any website to a single binary for offline viewing

#117
post #72

Earlier quoted context omitted.

You can also do an animated svg which is way smaller than a gif because it's just text keyframes ( https://github.com/vytskalt/pseudoc/blob/main/assets/factori... )

How can you do it? I don't see an SVG output from ascii-gif.

I used a different project, https://github.com/marionebl/svg-term-cli

Re: Show HN: Kage – Shadow any website to a single binary for offline viewing

#118

Cool project! I know it's written in go, but it would be cool to see something like this which uses Cosmopolitan Libc + redbean or something similar to create a binary which runs anywhere. Would be fun to be able to pass around self-executable website archives. https://github.com/jart/cosmopolitan https://justine.lol/cosmopolitan/index.html https://redbean.dev (Certificates just expired for justine's website, just ig…

I never understood the appeal for cosmopolitan. I'd rather have platform specific minimal binaries than a single binary with hacks. Installing packages is a solved problem

Installing packages is a completely different activity than passing around self-executable archives among friends. Not everything needs to go through a CI pipeline and distribution platform before you can share it with others. On top of that, I really enjoy being able to write quick little utilities and then pass them around without worrying about what operating system anyone who stumbles upon it has.

It's fine if you don't personally find it useful for your workflow, but I think it's mad cool, especially since you can zip together multiple binaries into one, along with data.

Post reply on HN