by koinedad on 3/24/24, 2:45 PM with 1 comments
by Turing_Machine on 3/24/24, 3:22 PM
Sadly, the powers that be keep making it harder and harder to run HTML+JS programs from plain local text files (for example, programs that need any kind of resource other than a few pre-defined ones like images -- you can't even load WASM!)
And no, "start a local server" isn't a useful answer for a kid who might be working on a locked-down school or library PC. It's also not a useful answer for anyone who might want to develop browser-based apps that run from the local file system, but who doesn't want to ship hundreds of megs of hackery (Electron, I'm looking in your direction).
As far as "security" goes, I'm pretty sure that firing up some bozo web server presents a greater security risk than allowing a web page to access resources in its own folder.
As far as "security" in general goes: well... if I can convince you to install arbitrary files of my choice on your machine and run/open them, "security" is already an illusion.
They could easily have made modern stuff like fetch work with local files (the underlying code would be different, of course, but the interface would be the same). And yeah, this would require a bit of care to make sure you didn't allow JS code to fetch something outside the folder the web file was coming from. So what? That's your job, mang.
I mean, imagine how secure a web browser would be that wasn't allowed to load any local files, or even connect to the internet. Almost perfectly secure. Also perfectly useless.