Live data from Hacker News

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

github.com

41–50 of 152 posts

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

#42
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 ignore the warning.)

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

#43

> kage serve $HOME/data/kage/paulgraham.com If the result is static why does it need a server? Isn't it possible to make it so that it can simply be opened by the browser? Like: $ firefox $HOME/data/kage/paulgraham.com Then the result would be useable on machines without kage nstalled.

You’ll likely run into a ton of CORS issues doing that.

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

#44
post #2

I find SingleFile [0] to be a much more robust version of this. It strips out all the JavaScript too, but also packs everything into a single HTML file that is easy to transfer. Binary assets (like web fonts and images) are packed as base64 strings. They also offer a CLI powered by Puppeteer. [1] [0]: https://github.com/gildas-lormeau/singlefile [1]: https://github.com/gildas-lormeau/single-file-cli

Love love love SingleFile too. The FF extension works pretty well for a clean save.

That said, Kage looks promising if OP can combine SingleFile reproduction quality with the HTTPTrack spidering approach. SPA's are kinda tricky with archiving and do wonder how well Kage would handle that

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

#45
post #2

I find SingleFile [0] to be a much more robust version of this. It strips out all the JavaScript too, but also packs everything into a single HTML file that is easy to transfer. Binary assets (like web fonts and images) are packed as base64 strings. They also offer a CLI powered by Puppeteer. [1] [0]: https://github.com/gildas-lormeau/singlefile [1]: https://github.com/gildas-lormeau/single-file-cli

This is what I first thought and it's a very elegant solution, and not needlessly overcomplicated.

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

#46

> kage serve $HOME/data/kage/paulgraham.com If the result is static why does it need a server? Isn't it possible to make it so that it can simply be opened by the browser? Like: $ firefox $HOME/data/kage/paulgraham.com Then the result would be useable on machines without kage nstalled.

Usually JavaScript is blocked when you load pages that way.

Since when? You won't be able to make HTTP requests to localhost, as it'd be a different Origin, but I don't think any mainstream browser blocks JS outright when you use file:// to load and view HTML files.

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

#47
post #34

For those with an eReader, one thing that works really well is using pandoc to download and convert a webpage to EPUB that you can then load to your reader. pandoc --from html --to epub --output /PATH/TO/FILE.epub https://example.com

Thanks, will try this out on the Kobo later.

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

#48
post #43

> kage serve $HOME/data/kage/paulgraham.com If the result is static why does it need a server? Isn't it possible to make it so that it can simply be opened by the browser? Like: $ firefox $HOME/data/kage/paulgraham.com Then the result would be useable on machines without kage nstalled.

You’ll likely run into a ton of CORS issues doing that.

I don't think so, there is no HTTP requests being done from JS as it's stripped away, and all the other resources are pulled down (and I'm assume their reference made relative), so really shouldn't be any issues because of CORS at all.

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

#49

> kage serve $HOME/data/kage/paulgraham.com If the result is static why does it need a server? Isn't it possible to make it so that it can simply be opened by the browser? Like: $ firefox $HOME/data/kage/paulgraham.com Then the result would be useable on machines without kage nstalled.

Usually JavaScript is blocked when you load pages that way.

Not all JavaScript, but a lot of APIs are restricted

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

#50

> kage serve $HOME/data/kage/paulgraham.com If the result is static why does it need a server? Isn't it possible to make it so that it can simply be opened by the browser? Like: $ firefox $HOME/data/kage/paulgraham.com Then the result would be useable on machines without kage nstalled.

Usually JavaScript is blocked when you load pages that way.

I am quite familiar with this and it is factually false
Post reply on HN