31

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?

gnat
  • 21,442
  • 29
  • 112
  • 288
Armand
  • 6,508
  • 4
  • 37
  • 53
  • 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
  • This question on stackoverflow will help: http://stackoverflow.com/questions/2280742/gplv3-can-i-use-these-programs-in-commercial but to be on the safe side,consult with a person knows about GPL Licensed software very well. – Gandalf Mar 28 '11 at 13:47
  • @objectiveME: this is slightly different, since the question is whether or not the javascript library being downloaded to the client counts as "distributing" it. – Scott Whitlock Mar 28 '11 at 13:51
  • @Scott Whitlock I am sure downloading the javascript library will count as distributing it.Since its a web application,maybe Alison might clarify what "anyone who downloaded and executed the Javascript lib" means in this context. – Gandalf Mar 28 '11 at 14:12
  • @objectiveME , it does not count unless the JS is unaltered. Both the GPL v2 and v3 have reasonably specific text about this. v3 is slightly clearer and has less room for misunderstandings. – Thomas the Tank Engine Mar 28 '11 at 14:35
  • @David did you mean "unaltered" or "altered"? – Armand Mar 28 '11 at 14:42
  • @objectiveME by "downloaded and executed the Javascript lib", I meant the Javascript was linked in an HTML page, and therefore downloaded and used by the client's web browser. – Armand Mar 28 '11 at 14:43
  • @Alison Unaltered. You could reasonably say you have fulfilled your requirement if the JavaScript is available by typing the URL to the JavaScript into a browser you see the unaltered JavaScript source. It would be safer to make it available as a download, though, for completeness. – Thomas the Tank Engine Mar 28 '11 at 15:09
  • 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
  • @Scott Whitlock , the GPL clearly does not force you to release the server side code, I have to disagree there is any uncertainty there. Only the AGPL could enforce that. Overall, the FSF does answer GPL questions like these, it might be worth asking them if someone is relying on the answer to this. – Thomas the Tank Engine Mar 28 '11 at 16:03
  • 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. – Thomas the Tank Engine Mar 28 '11 at 16:17
  • So it's been a year now, what is the outcome of this? Did you talk to a lawyer? Please help others by posting your answer. Much appreciated! – DeepSpace101 Feb 16 '12 at 21:54
  • @Sid no, not talked to a lawyer. I was surprised there wasn't a clear answer to the issue in the first place. As there isn't, I think it's open to interpretation as many licensing issues seem to be and I'd be very surprised if any two lawyers were to give the same answer anyway. – Armand Feb 17 '12 at 09:15
  • 1
    Richard Stallman, author of GPL, on the issue: http://www.gnu.org/philosophy/javascript-trap.html – Honza Pokorny May 03 '11 at 14:16

1 Answers1

5

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. – Thomas the Tank Engine Mar 28 '11 at 14:18
  • 1
    Posted as a separate question here: http://programmers.stackexchange.com/questions/62885/must-source-code-released-under-gpl-be-human-readable – 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