Lurker News

Comments (141) 55 threads

Show all comments

Showing thread 3 of 55

ninalanyon3 replies#
> 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.

doctoboggan4 replies#
Usually JavaScript is blocked when you load pages that way.
pixelatedindex#
I thought all the JS was stripper?
embedding-shape1 reply#
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.

Continue this thread — 6 replies

dmazzoni#
Not all JavaScript, but a lot of APIs are restricted
recursive1 reply#
I am quite familiar with this and it is factually false
danielheath3 replies#
Js modules don’t work on file urls (classic js does).

Continue this thread — 3 replies

afavour1 reply#
You’ll likely run into a ton of CORS issues doing that.
embedding-shape#
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.
tamnd#
You could use python -m http.server instead. I haven't tried it yet, but it should work.

Actually, Kage has two parts: a crawler that crawls pages and converts them to clean HTML by capturing the DOM after rendering in Chrome/Chromium, and a pack/serve component that packages the result as either a ZIM file for Kiwix or an executable file.