Protect Greasemonkey scripts?
Asked Answered
H

3

2

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.

Humber answered 19/7, 2010 at 20:15 Comment(1)
That's not really possible. even though obfuscation might make the code less readable, the logic is still available and an experienced javascript-programmer could easily de-obfuscate the code. also, if you don't want people to read your javascript code, you probably shouldn't write stuff in javascript in the first place.Hungary
Z
2

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

Javascript library: to obfuscate or not to obfuscate - that is the question and How can I obfuscate (protect) 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.

Ziguard answered 19/7, 2010 at 20:22 Comment(0)
W
2

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/

Wholesome answered 19/7, 2010 at 20:20 Comment(0)
Z
2

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

Javascript library: to obfuscate or not to obfuscate - that is the question and How can I obfuscate (protect) 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.

Ziguard answered 19/7, 2010 at 20:22 Comment(0)
D
1

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 .

Datura answered 21/7, 2010 at 8:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.