What are some good ways to prevent people from copying my source code? [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last year.
Improve this questionI have a lot of customized javascript and layout design, and I want to prevent people from using those. Is there any practical way to do this, or do I basically just have to 开发者_JAVA百科be happy my php code does not show? I want to at least make it difficult to copy my site.
If people really want to get access to your source code they can do that fairly easily.
It is possible to slow people down to a limited degree by obfuscating code.
See:
- http://code.google.com/p/minify/
- http://refresh-sf.com/yui/
- http://ajaxian.com/archives/utility-javascript-obfuscator
Maintaining obfuscated code is difficult. What you want to do is obfuscate it before deployment so that you can test and debug with the normal version. Debugging problems on a live site can be made a lot more difficult by the obfuscation.
All client-side code can be copied. If you're a web designer, your best bet is to just brand yourself well and keep innovating so that clients are more interested in the originator than the imitator.
There's no way to prevent people from seeing your source code. There are ways to obfuscate it and make it difficult to reuse, but there's no way to hide it. Also note that obfuscation makes it hard to maintain as well.
By far the most widespread method is to write so bad code that no one in their right mind would want to copy it, it's employed by approx 99% of web sites.
Is it actually a problem to you if someone snatch a piece of your code?
Sure it is a problem if someone the steal the whole site/application, but the only way you can really deal with that anyway is through standard legal means.
I use the Google Closure compiler for javascript. This is to reduce download size and remove redundant code but it has the added benefit of making the code much harder to read.
I have always envied people who sell JavaScript products because their work is always out in the open. I think this is a terrific deterrent for anybody who has something to lose—i.e., businesses, commercial web sites, and such. The day Google (or another big search engine) offers the possibility to search in pages' source code, you can start detecting copyright infringements within minutes.
And even if that search engine option never comes up, it's still possible to find out, very quickly and effortlessly, whether a site uses stolen Javascript.
On the other hand, a minifier used by the person stealing the code would make this much, much harder. So some minification/obfuscation, as suggested in the other answers, is probably a good idea nevertheless.
You can use an obfuscator for your code which will make site loadable but not readable to the other developers - they will not have an easy way to modify and adapt it.
You can use an obfuscator, if you like. It makes the source human-unreadable.
Scare them by using copyright marks in your code and a good lawyer. If they believe that you will sue them maybe the will steal form someone else.
精彩评论