views:

82

answers:

3

I know that anything that is downloaded and is in the user's possession is going to be pretty hard to protect, but I'm just wanting to hear opinions. I'm thinking of selling a script (made with Greasemonkey...), and I want to be able to prevent the user from easily viewing the source code, or sending it to others. Thanks in advance.

+2  A: 

Really the only thing you could try would be obfuscation but that is no guaranty that nobody will be able to read your code.

Try - http://www.javascriptobfuscator.com/

HurnsMobile
+2  A: 

As with any javascript, complete protection is impossible due to the nature of the language, see:

http://stackoverflow.com/questions/2862470/javascript-library-to-obfuscate-or-not-to-obfuscate-that-is-the-question and http://stackoverflow.com/questions/194397/how-can-i-obfuscate-javascript

However, you can obfuscate your javascript code or minify it, neither of which will completely protect it, but they will make it less human-readable.

Josiah
+1  A: 

With Greasemonkey, there is another option beyond JavaScript obfuscation.

You can compile your GM script into a Firefox extension instead.

Greasemonkey install makes it easy to see/get a GM's script code. But almost no civilians even know where to look for extension source files. (Of course, nothing will stop a determined programmer from getting and analyzing your code.)

One such compiler is at: http://arantius.com/misc/greasemonkey/script-compiler .

Brock Adams