3

I'm about to release my first chrome extension to chrome web store. They want the code to be zipped and uploaded. And once through approval it will be available to users as .crx files, if I understand it correctly.

But these crx files are simple zip file with .crx extension right? If so, won't users be able to get hold of the source code?

Which means, I may get to see 100 more versions of my source code floating around the web store alongside my extension. :(

Is there anyway to prevent the user from getting hold of the source code?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Ivin
  • 4,435
  • 8
  • 46
  • 65
  • Did you consider publishing (outside of Chrome web store) your source code under a free license (GPLv3)? – Basile Starynkevitch Oct 25 '12 at 07:32
  • @BasileStarynkevitch You mean like host it on GitHub or other repositories? Will that give enough publicity as in chrome Webstore? – Ivin Oct 25 '12 at 07:41
  • Yes, publish the source code thru e.g. GitHub and the binary application thru Chrome store... – Basile Starynkevitch Oct 25 '12 at 07:42
  • @BasileStarynkevitc I dont have a premium account to maintain private repository in GitHub. So GitHub source would also be open. Is there any other place which offer private repository for free? – Ivin Oct 25 '12 at 07:47
  • I was suggesting to *publish* your source code under a free software license (not to keep it private). I certainly won't trust a random proprietary extension for Chrome... – Basile Starynkevitch Oct 25 '12 at 07:49
  • Ok, I didn't notice that. My need is to make it available for free but keep the source code to myself. – Ivin Oct 25 '12 at 07:55
  • Then nobody will use that, because people won't trust yet another extension... – Basile Starynkevitch Oct 25 '12 at 08:02
  • If that were the case, then there would be only open source applications in the world -- which is not! – Ivin Oct 25 '12 at 08:21
  • There are tons of extensions in CWS that are not open source. I think that most of the users just don't care about that and install these extensions anyway. – Konrad Dzwinel Oct 25 '12 at 09:09
  • @KonradDzwinel Thanks for the +ve push! :) Do you know how such extensions are hosted? I mean how developers protect their source code? – Ivin Oct 25 '12 at 10:03
  • 1
    From what I've saw - the code is 'protected' mostly by obfuscation. Also, some extensions put only a minimal and very simple JS file to CWS, the rest of the code (with most of the logic) is loaded from external servers while extension is running. It makes it much harder to understand what's going on. – Konrad Dzwinel Oct 25 '12 at 10:09

1 Answers1

6

Providing source code to your extensions is the simplest way to give something back to the open source community. Since you are using at least one open source application (Chrome) you should think about open-sourcing your projects as paying back the debt.

You should also understand that GitHub/Bitbucket profile is a developer portfolio. Many companies look at these before offering a job. Nowadays, each and every good developer has an extensive list of open source projects. This allows anyone to get an idea of how good is the code they write, how well they can collaborate with other developers, how much attention do they pay to the details etc.

Last but not least, if your extension is really good, if you constantly maintain it and develop new features and your users enjoy using it, you may be sure that it will defend itself from any kind of copies. If you open source your code you'll surely find some collaborators that will provide translations, new features and will help you to fix the bugs.

Anyway, an answer to your question is this: if you are afraid that someone will use your JavaScript code you can obfuscate it. Of course, obfuscated code can be prettified by someone who is desperate to read it but without the comments and meaningful variable names it will be a pain to do so. Other solution is to write a NPAPI plugin or Native Client app because these allow you to compile parts of the code.

daaawx
  • 3,273
  • 2
  • 17
  • 16
Konrad Dzwinel
  • 36,825
  • 12
  • 98
  • 105