Hacker News new | ask | show | jobs
by beatgammit 2458 days ago
You can't know before loading a page whether it'll load non-free code. Browsers don't have a mechanism for telling you what license governs the code, and figuring out what license blocked JavaScript uses is a fair bit of work, especially since most pages use multiple JavaScript files, and which flies are downloaded may change from page to page.

Even if nearly everyone uses GPL for their JavaScript, you still need to go through this process for every site that may use non-free software, which is a royal pain.

Perhaps a "better" solution is to fight to have browsers check the license of JavaScript before loading it (either prompt the user, or have a browser setting for acceptable licenses), but that's a much harder battle than promoting JavaScript-less web pages, especially since the user has control of blocking JavaScript today.

1 comments

LibreJS is a Firefox add-on that does roughly what you describe. If a piece of Javascript code is not properly annotated with a license (for example in a comment block at the top) it refuses to execute it.

https://www.gnu.org/software/librejs/

https://www.gnu.org/software/librejs/free-your-javascript.ht...

It can be a bit fickle. I recently tried to make code comply with it and it didn't initially work because I was using a non-standard version of the ISC license with one different word.