If I used a GPL-licensed Javascript library in a web application, would I then have to offer source code of the whole site to anyone who downloaded and executed the Javascript lib?

  • 5
    This is a very interesting question. Typically web applications aren't covered by the GPL because you're not distributing the code (which is why AGPL exists). However, in the case of code that runs on the browser, you are kind of distributing the code. If that's true, the nature of the GPL implies that your entire web application must be released under the GPL. – Scott Whitlock Mar 28 '11 at 13:22
  • 5
    @David - the question is whether the GPL forces you to release the rest of your web application (like the server side stuff) as well. You've used the Javascript library to create a derived work. The GPL would apply to the entire result. – Scott Whitlock Mar 28 '11 at 15:37
  • 1
    @David if it was clear, I wouldn't have asked :p – Armand Mar 28 '11 at 16:06
  • 1
    @Alison, ah OK, sorry, I mis-understood the full question then. No, the server side would not have to be GPLed. As long as the comms between the client and server are some format unlike a machine level functional invocation, like XML, you have nothing to worry about. Simply serving GPL code, be it HTML or JS, doesn't make the server-side code delivering it, or communicating with it in a non-remote invocation format, a derivative work. – David Mar 28 '11 at 16:17
  • 1
    Richard Stallman, author of GPL, on the issue: gnu.org/philosophy/javascript-trap.html – Honza Pokorny May 3 '11 at 14:16

You would have to offer the JavaScript of that library and the JavaScript of the application that accesses the API of that library (and any other libraries the applications accesses, which also need to have a GPL compatible license).

Remember, you need to provide the human readable JavaScript, not a whitespace stripped version as generally goes into production.

The HTML that invokes the JavaScript is clearly available already, it doesn't really count as "linking" to that JavaScript and it's availability means people are unlikely to worry over it.

  • 3
    I don't think linking is the only trigger. For instance, if your program depends on another helper application in such a way that your application can't function without the other library, then for the purposes of the GPL, it's all one application. I think in this case, I'd recommend consulting a lawyer. – Scott Whitlock Mar 28 '11 at 13:46
  • it has to be human-readable? Interesting. I will ask this as a separate question. – Armand Mar 28 '11 at 13:50
  • It has to be unaltered, both in GPL V2 and V3. OK, that may not be the same thing, I'm assuming human writable == human readable. – David Mar 28 '11 at 14:18
  • 1
    Posted as a separate question here: programmers.stackexchange.com/questions/62885/… – Armand Mar 28 '11 at 14:50
  • @ScottWhitlock For the purposes of the law, it only matters if one is a derivative of the other from a copyright perspective, not whether one can function without the other. If copyright law doesn't apply, the GPL (which is a license, not a contract, so can only grant permissions and not take them away) has no effect. It would be very difficult to show which of server and client in a typical web app is derivative of the other, if at all. I'd say it is more likely that the client is derivative of the server, as most devs normally write server then client, but that's a long way from uniform. – Jules Nov 16 '14 at 18:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.