1395 posts
  • 9 Years of Membership
  • Collector Level 6
  • Community Superstar
  • Super Copyright Ninja

hi – I want to try and somehow protect scripts I buy from being looked at/taken by competitors who do Ctrl-U and click the filename.js in my site pages.

though i realize you can’t protect .js from advanced techno-geek hackers, would something like minify or other obfuscator at least provide some protection against casual copycat/thiefs? or, any speed or other drawbacks to using obfuscators?

i like protecting stuff I buy (for example I domain-lock .swfs); wanted to see if any easy way (not php/asp redirect, that’s too techy for me to do), to somehow protect .js files?



780 posts
  • Collector Level 1
  • Trendsetter
  • 5 Years of Membership
  • Author Level 6
+3 more

Using a compiler like google closure to minify and hyper crunch your code is a good thing to do. There are many minifiers and most will perform variable renaming/method renaming and optimization of your code. I use google closure as part of my build process and its very nice.

However, I’d use these tools to increase my development productivity ( google closure gives you quite a lot in this regard) and to improve the overall file size of your assets.

Sadly protecting your code base will be difficult no matter how much obfuscation you manage to implement because the assets are downloaded to the clients computer. You will be investing too many resources when the same time can be well spent going about the real needs that bring value to your business.

You have exclusive copyright to your work. This is enough protection to stop abuse of your code. Any serious business will consider those implications and not go that route.

Edit: I misread your wanting to protect code you write versus code you purchase on envato. I guess the original authors of said code will have to do the minification anyway. Attempting to go for advanced crunching of the code base that involves variable/methods renaming is complex and needs to be thought out from the beginning as the developer is writing the code or you’ll simply end up breaking the code.