News for hackers. Stuff that matters.
Re:Show HN: Capsule – Single-file web apps that save their d... by Dwedit on Tuesday September 15, 2026 @10:12AM (#49712828)
You'd think so, but web browsers are downright lobotomizing the ability for local HTML files to run any meaningful javascript code. Want to run a JS file from the same directory? CORS ERROR!!!!

Hence 200MB applications that are complete copies of the Chromium browser to run under 1MB of actual web code.

Re:Show HN: Capsule – Single-file web apps that save their d... by derpyzza on Tuesday September 15, 2026 @11:59AM (#49714559)
couldn't you just embed the js directly into the html file though? that would sidestep the CORS error. and since most of the people using a program like this are likely to be using AI to generate their ( likely throwaway ) applets anyway, readability and maintainability for the source doesn't matter as much as it would with human authors so having a separate js file doesn't bring that many advantages anyway.
Re:Show HN: Capsule – Single-file web apps that save their d... by fallinditch on Tuesday September 15, 2026 @01:12PM (#49715600)
Sharing HTML files with embedded Javascript is problematic: iOS users can't open the files directly, and have to save the file and then 'open with ... '.
Re:Show HN: Capsule – Single-file web apps that save their d... by krapp on Tuesday September 15, 2026 @08:25PM (#49720654)
Sounds like iOS is problematic.
Re:Show HN: Capsule – Single-file web apps that save their d... by throw101010 on Tuesday September 15, 2026 @11:05AM (#49713664)
Isn't that the price of a relatively well sandboxed experience by browsers?

I've experienced the same limits building small tools for myself and friends that I wanted to contain in a single HTML file without external dependencies... but I understand why the same project without these restrictions could easily become malware, and ones that could be easily propagated.

Re:Show HN: Capsule – Single-file web apps that save their d... by Dwedit on Tuesday September 15, 2026 @12:31PM (#49715015)
I wish the browser would either allow local-only or internet-only, then only make up its mind after the first attempted request. Fetch an image from the internet? No script access for local files. Fetch a JS from elsewhere on the hard drive? No internet access. That could provide the sandbox while still being flexible.