madmurphy / cookies.js

Simple cookie framework with full Unicode support
GNU General Public License v3.0
264 stars 54 forks source link

GPL is bad for client-side JS libraries? #9

Closed nyanpasu64 closed 5 years ago

nyanpasu64 commented 6 years ago

https://stackoverflow.com/questions/1239470/restrictions-of-gpl-on-javascript-libraries

I am not a lawyer. I have talked to lawyers about using the GPL and LGPL for code to be interpreted / dynamically linked into non-free software. We all got big headaches. The question isn't just whether you have to release the rest of your site under GPL. It's whether a non-free browser can legally run GPL code. My best non-legal advice is to never try to use the GPL on Javascript code. I'd never release a Javascript library under GPL, and if I found some code I wanted to use I'd try to get the author to give me an exception. The LGPL may be a better choice, but that license is so complex I suggest avoiding it as well. The FSF themselves have an answer for you in their FAQ If a programming language interpreter has a license that is incompatible with the GPL, can I run GPL-covered programs on it?. That answer itself is frustratingly ambiguous, but it suggests paths where you could run GPL code in a non-GPL browser. You may also find the FSF essay The Javascript Trap interesting, although again it doesn't really give a clear answer to your question. For context, it helps to remember that the GPL and LPGL were written in the Unix era when most everything was statically linked. No dynamic linking, no interpreted languages where the scripts themselves were considered valuable intellectual property, etc.

You have distributed the JavaScript library to the user; you are required to comply with the GPL's requirements on distribution then. Whether this requires you to distribute the rest of the website is where things get complicated - I'd advise you to talk with a competent lawyer about your exact situation if you're even thinking about going that route, and keep in mind that this is at least violating the spirit of the licence, whether or not it violates the letter of the license as well.

emphasis mine

nealmcb commented 5 years ago

@jimbo1qaz Note that that answer on Stackoverflow seems deeply flawed, as indicated by the large number of downvotes and commentary at What are the implications of licensing a JavaScript library under GPL? - Open Source Stack Exchange