Live data from Hacker News

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

github.com

131–140 of 152 posts

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

#131
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…

This is a nice way to do it if you’re already stuck with a solution (print to PDF would probably also, if you can script it).

In a green field world, I have a personal requirement that technical documentation systems are capable of bulk exporting to a human-readable format on disk. I’m pretty flexible on what that is, though. Markdown is preferred, but I’m also fine with static, dependency-free HTML and I could accept PDFs if the rest of it is super nice.

It’s an integral part of DR, and most places want their docs on-premise, so DR effectively requires offline documentation. Everywhere I’ve worked either a) writes documentation in something that works offline (eg git repo with tarballs somewhere), or b) has invested a bunch of time in trying to scrape their own wiki into something legible during DR.

I guess it’s a long-winded way of saying “that’s using a tool to fix a self-inflicted problem that shouldn’t exist”.

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

#132

Does this work for the Apple Docs website? Really tricky to get those offline.

Good news for you: here is the command to clone Apple Docs:

```bash bin/kage clone https://developer.apple.com/documentation/ \ --scope-prefix /documentation/ \ --out /Users/apple/data/apple-docs \ --chrome "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \ --max-pages 0 --max-depth 0 \ --workers 3 --browser-pages 3 --asset-workers 6 \ --render-timeout 60s --settle 2s --timeout 30s \ 2>&1 | tee -a /Users/apple/apple-docs.log ```

Adjust it to your needs :)

I smoke-tested it, and all the content and CSS work, but I stripped all the JS, so the sidebar won't work.

If you run into any problems, feel free to create new issues in the repo. It helps me prioritize and know what should be fixed.

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

#135

This is interesting. Is the intended use case mostly read-only websites like blogs/docs/essays? How well does it handle sites where navigation, search, dropdowns, or other UI interactions depend on JavaScript?

Currently, all of that is broken. At one point, I had a traumatic experience where an archived HTML file kept redirecting to the live site, even though I already had all the content rendered, so I ended up disabling all JavaScript entirely.

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

#136

This is interesting. Is the intended use case mostly read-only websites like blogs/docs/essays? How well does it handle sites where navigation, search, dropdowns, or other UI interactions depend on JavaScript?

If there's more demand for that, maybe I will implement a more relaxed version.

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

#138
post #115

> No tracking, no network calls, no surprises. Won't comment on a project (though idea seems interesting) but this in README is a tell for me ;)

Somehow 'Kage' is the first name claude suggests to me for any new project as well

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

#139
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.

I tried this on a small example and it works indeed. In my head this would have been something like a restrictive CSP script-source directive, even if not exposed in response headers or anything.

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

#140
It sounds like a nice idea, but "It drives a real browser, lets the page finish doing whatever it does, grabs the finished result, and then rips every script out of it." sounds like it'd fail for a lot of websites that do things like display some kind of modal banner inviting you to click something to close it, and that prevents scrolling while that is open, whilst also delaying loading the rest of the article until a certain scroll point is hit.
Post reply on HN