Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

If I used a GPL-licensed Javascript libarary 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?

share|improve this question
3  
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: stackoverflow.com/questions/2280742/… 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
3  
@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 –  Alison 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

2 Answers 2

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.

share|improve this answer
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. –  Alison 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/… –  Alison 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 at 18:35

I'd say that's not really relevant, because invoking JS from other JS shouldn't really count as linking, but if you want to be cautious, you can do following:

Keep GPLed library separate from your JS code, include it via <script src="..."/> tag. This way any kind of "combining" GPLed code with your code is done by the browser on the client side. So from your point of view, you're distributing clean, unmodified version of GPL lib, which is totally ok. Your code does not include anything GPLed, which also is ok.

share|improve this answer
4  
The GPL is not limited to linking, anywhere you call the API of a GPLed method or function either on object code or directly on source code of an interpreted language causes the derivative work to have to be licensed under the GPL. Your point is entirely wrong, I'm afraid, and very dangerous, that usage does form a derivative work that falls under the GPL. –  David Mar 28 '11 at 16:10
    
@David: based on what? btw. what you mean 'call'? client's browser is doing the calling. –  vartec Mar 28 '11 at 16:11
1  
@David: your argument is pure FUD. There are explicit laws (in Europe), and legal precedences (in US), that API cannot be copyrighted. Thus there is no legal way API call in your code would infect it with GPL, if you don't include any parts of GPLed librari in your code. That's how for example WINE can implement WinAPI without breaching Microsoft's copyright. –  vartec Mar 28 '11 at 16:26
    
@David: FSF is known to spread FUD without any legal base. I'd rather trust legal system, than a guy who puts tinfoil on his head. –  vartec Mar 28 '11 at 20:23
    
The FSF makes some claims about what is a derived work that seems dubious to me, although IANAL. Like any license, if you're in genuine doubt about whether it allows what you want to do, consult a lawyer. –  David Thornley May 3 '11 at 18:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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