26

Something I've noticed over the past few weeks is how many big commercial websites use jQuery combined with lots of plugins - but don't admit it. They will rename the main library to something obscure, as well as the plugins. Quite a few will even remove the comments that contain the MIT/GPL license information. (just noticed today that odeon.co.uk have done exactly this)

Why are they doing this? are they abashed by the face that they are using a free and open source library?

Robert Harvey
  • 198,589
  • 55
  • 464
  • 673
  • 9
    Interesting question. Removing the copyright comments is infringing the license agreement, isn't it? – Pekka Jan 07 '11 at 13:55
  • I'm not sure this is off topic... would the closers care to explain? – marcgg Jan 07 '11 at 13:55
  • 2
    Why was this moved here? – Tom Jan 07 '11 at 13:57
  • 1
    @Tom - it is off topic for SO. I'm one of the people who voted to migrate it. I'm not entirely sure it's a good fit here, but the question is interesting enough to give it a chance. – Tim Post Jan 07 '11 at 14:00
  • 7
    @Tim Post: I would say it's fully on-topic for programmers, not at all for stackoverflow. So correct decision there. – Orbling Jan 07 '11 at 14:04
  • 3
    @marcgg: it's certainly not a programming question. Personally I voted to close as argumentative, but then again programmers.se pretty much exists to take in all those "subjective and argumentative" questions, at least in the minds of the other closers. – Wooble Jan 07 '11 at 14:04
  • @Wobble - This question doesn't really invite long winded answers, and doesn't ask for facts and references, but _it could_, which is why I chose to migrate it instead of just hammering it. – Tim Post Jan 07 '11 at 14:10
  • 3
    @Wooble - Programmers is *not* for argumentative questions. It is for subjective, but constructive questions. There may be occasion that you get back and forth, but if a question is just argumentative it has no more place in programmers than SO. – MIA Jan 07 '11 at 14:25
  • @Jim Leonardo: fair enough, although it's obviously a matter for argument whether all the talk about "shame" in the question is inherently argumentative or not. – Wooble Jan 07 '11 at 14:29
  • @Wooble - As opposed to the constructive and positive use of "shame"? – Jon Hopkins Jan 07 '11 at 15:55

9 Answers9

26

Well, its the same for some projects i work on, but only because of the automated minfying Process that is part of every release.

Hannes
  • 331
  • 5
  • 11
13

Under the definition of the MIT license, it is perfectly permissible. They are not distributing it, and even if they were, they would only have to include a copy of the license file (not required to be the header of each file).

Dekker500
  • 131
  • 2
  • Ah, good to know. – Pekka Jan 07 '11 at 14:04
  • Good information, but I Don't think this answers the question. The OP asked why companies were doing this, not if they were allowed to. – Simon P Stevens Jan 07 '11 at 14:24
  • 1
    -1. By hosting jQuery (or any other code) on your server, your *are* distributing the code (at least as far as the law is concerned), and the [MIT license](http://www.opensource.org/licenses/mit-license.php) **does** require the copyright notice to be left intact. – josh3736 Jan 07 '11 at 14:33
  • 3
    @josh3736 Could you point out a law that says this? GPL for example has a FAQ that specifically says this doesn't qualify as distributing. There is the Affero GPL licence if you want to disallow that kind of use. – Rene Saarsoo Jan 07 '11 at 14:57
  • @Rene Saarsoo: The MIT license explicitly states the copyright should not be removed if you are going to "use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software". – mipadi Jan 07 '11 at 16:06
  • @mipadi, sure, but MIT license doesn't say what does it mean to distribute the software. I assumed that MIT and GPL are compatible enough that "distributing" means the same thing. – Rene Saarsoo Jan 07 '11 at 16:40
  • @mipadi But jQuery is dual licensed under MIT and GPL. [If the GPL says it's OK](http://stackoverflow.com/questions/3640415/) and there isn't copyright in the file, isn't the company just licensing under GPL by default? – James Jan 07 '11 at 16:47
  • @Rene Saarsoo: Why does distribution matter? The MIT license says you have to keep the copyright in place, period. – mipadi Jan 07 '11 at 16:47
  • @James: Why does distribution matter in regards to keeping the copyright intact? – mipadi Jan 07 '11 at 16:48
  • @mipadi Because the copyright notice condition appears to be attached to distribution in the GPL, section 4. If this isn't distribution, do you still need the copyright notice? I have no idea; I'm asking. :-) – James Jan 07 '11 at 16:55
  • @James: We're talking about the MIT license, not the GPL. The MIT license says that if you are going to "use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software", then you must adhere to the guidelines of the license. This is different from the GPL, but the GPL also has a whole host of guidelines it bestows upon the licensee that require, for legal and practical reasons, to only apply upon distribution; the MIT license is much simpler. (For what it's worth, you can't remove copyright notifications on almost any work.) – mipadi Jan 07 '11 at 16:57
  • @mipadi The original question was asking about jQuery, not the MIT license specifically. Rene Saarsoo also referenced the GPL. There doesn't seem to be a MIT violation because the licensee doesn't appear to be licensing the software under the MIT license. – James Jan 07 '11 at 17:19
  • @ReneSaarsoo - what part of the GPL FAQ covers that? AFAIK, if you run code on a server and provide a web interface, you're fine, but any Javascript actually has to be conveyed to the browser in order to run. – detly Jul 17 '12 at 04:36
  • @detly http://www.gnu.org/licenses/gpl-faq.html#UnreleasedMods – Rene Saarsoo Aug 21 '12 at 21:25
  • @ReneSaarsoo - yes, but the Javascript is not running on the server, it's running on the user's computer. That is, it's not "on a server machine for the public to talk to", it's on a server machine for the public to download (ie. it is distributed like any tarball or binary). – detly Aug 21 '12 at 23:00
  • @detly But isn't it usually the case that the JavaScript running on the browser is just part of the whole application. It's quite rare that you can just download the web page and have the whole app working offline inside your machine. You might say it's a client app that's been distributed to the user as a web page. But in that case doesn't a plain HTML page also constitute a client app? Where do you draw the line? – Rene Saarsoo Aug 30 '12 at 08:01
  • @detly The fact that you can download jQuery library from a given page doesn't necessarily mean they're distributing it - it's just a coincidence of how web pages work. I might have a modified jQuery sitting in my web server, if you figure out how to download it, is it more like you hacking into my site or me distributing it? There's a lot of gray area in this whole thing. – Rene Saarsoo Aug 30 '12 at 08:13
  • @ReneSaarsoo - what you call a "coincidence" others might call a significant legal point. If it's running on the user's CPU, you have by definition distributed it to them. I don't have to hack your site to download it, the server sends it to my browser as a matter of course. – detly Aug 30 '12 at 08:17
6

Aside from the other answers, which are good guesses, the only other reason I could think to deliberately obfuscate which libraries you're using might be to minimize the impact if a remote exploit is discovered in the library.

If there was some big showstopper of a XSS hole discovered in jQuery, for instance, it might be of some benefit to have my use of it not be super obvious.

I agree with the other answerers who say it's probably a side-effect of deployment autominification.

Dan Ray
  • 9,106
  • 3
  • 37
  • 49
4

This may be done for optimization. An end-user needs not to receive that comments. Even if they save 1kb of code by this, it may be good

simon
  • 141
  • 4
3

Probably a misguided attempt at obfuscation, or another (arguably) misguided attempt to reduce bandwidth. I can't think of any practical or technical reason they would want to do this.

If you are curious, try emailing them asking why they removed the license information from the code.

Tom
  • 681
  • 6
  • 15
2

They may be using a local modified version, and have then renamed it to follow local standards parhaps?

JohnB
  • 1,231
  • 2
  • 8
  • 10
2

We rename ours because we provide drop-in widgets for our customers and they might be also using a different version of jquery that's incompatible with ours.

$ could be any version of jQuery (or sometimes other libraries like prototype), but dmJQuery is always the one we support.

(We don't really rename it in the source, just do this...)

/* make sure we use this version of jQuery and not any others. */
window.dmJQuery = jQuery.noConflict(true);
Mike Ruhlin
  • 121
  • 2
  • That's why you don't rename the file you download from jQuery. I kinda doubt that jquery-1.4.4.min.js would have conflicting versions. – James Jan 07 '11 at 16:44
  • yes, but if my script loads jquery-1.4.4.min.js, and their script loads jquery-1.4.1.min.js on the same page, we've got a version conflict... (besides, my script is bundled up into a single JS file for easy drop onto their servers...) – Mike Ruhlin Jan 07 '11 at 16:50
  • The solution to that is literally identical to your current solution, isn't it? Oh... Unless your jQuery isn't first version loaded. That, and having everything in one convenient file is understandable. :-) – James Jan 07 '11 at 17:09
1

As shown on the offical jQuery website, it's used by: Google, Dell, Digg, NBC, Netflix, Mozilla, WordPress and others.

It's a widely regarded and used library.

So I assume they change the name so that people don't know they use jQuery, as they'd view it negatively, because they are relying on someone else's code rather than having written it themselves.

Peter Bridger
  • 629
  • 1
  • 5
  • 7
1

Large website developers care about their users, I don't see any reason why they would go out of there way to obfuscate the technologies they use from the infinitesimal fraction of their users which are readying the source code of a page.