As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I need a complex js obfuscator so that the js file won't be easy to reverse with a public tool like http://jsbeautifier.org/
You may try jscrambler.com. It's the only one I know that could help you. Check what it does.
You can shrink variable names when you use Dean Edward's packer. While this can be reversed, it does leave you with pretty unreadable code as the variables aren't easily identifiable.
http://dean.edwards.name/packer/
Use Packer algo http://dean.edwards.name/packer/
do check the options 'Base62 encode' and 'shrink variables'. This will obfuscate the code to a certain limit but still, as #musicfreak said, anyone who is determined can still make out the code.
If you use a JavaScript library, consider Dojo Toolkit which is compatible (after minor modifications) with the Closure Compiler's Advanced mode compilation.
http://dojo-toolkit.33424.n3.nabble.com/file/n2636749/Using_the_Dojo_Toolkit_with_the_Closure_Compiler.pdf?by-user=t
Code compiled with Closure Advanced mode is almost impossible to reverse-engineer, even passing through a beautifier, as the entire code base (includinhg the library) is obfuscated. It is also 25% small on average.
JavaScript code that is merely minified (YUI Compressor, Uglify etc.) is easy to reverse-engineer after passing through a beautifier.
Google Closure Compiler.
http://code.google.com/closure/compiler/
I use it on advanced. Read the docs about exporting public methods etc.
http://code.google.com/closure/compiler/docs/api-tutorial3.html
It rocks.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've worked a lot with v3 recently, and if you noticed, beside usual compression that is done on scripts (local variable renaming, white space removal, etc.), the API script is pushed forward on this, and also has classes and their methods renamed with 2 character names. Also I've noticed other 'strange' things, like the names that are exposed to the API users are stored as variables and used inside the script. In my opinion, I think there is also some sort of obfuscation intended.
Don't know if I made myself clear, or if this is some sort of compression that I didn't get right, but I think you get the point.
I'm interested if someone knows if this is something like a public utility that compresses scripts in such a way, or if someone could point out some references that might help.
Thanks.
I think that Google uses their Closure Compiler - it does much of what you describe.
Google Closure Compiler
CC is much more ambitious (and rewarding) than other tools like yui-compressor or jsmin
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I occasionally write JavaScript code. I am interested in minifying it for better performance, but I don't plan to spend to much time on that, especially in testing the minified result.
I found this online service:
http://www.lotterypost.com/js-compress.aspx
So a couple questions:
Is it reliable?
Microsoft AJAX minifier vs. YUI Compressor, what's the best option?
Any other similar online tool to recommend (and why is it better than the above link)?
Google's Closure Compiler
is an excellent Javascript minifier and compiler. It analyzes the code and reports the detectable errors. It removes redundant space and unreferenced code, and renames objects to shortest possible names. You just need to compile together all Javascript files that belong to one HTML page.
That link you post happens to be the one that I use too.
Use the MS AJAX Minifer. It's way better than the yui one. besides:
http://stephenwalther.com/blog/archive/2009/10/16/using-the-new-microsoft-ajax-minifier.aspx:
The Microsoft Ajax team (I work on
this team) has been using this tool
internally for a number of years. For
example, we use the Microsoft Ajax
Minifier to minify the Microsoft Ajax
Library before publishing it.
Well if you don't trust me, run your source code (if you don't have an actual source code to test, just grab the source at http://code.jquery.com/jquery-1.6.2.js) through both and see which is more "minified".
==
Google has the Google Closure Compiler but it analyzes your code and removes unreferenced code (to furthur reduce the size of the resultant file). However usually this is not what you want because even though the functions/variables are not referenced within that file, it may be referenced from your other js files that make up your site)
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What compressor is the best for javascript and css minified ? I am using YUI compressor , now. Any other best than YUI compressor ?
For JavaScript you could check for your self via the CompressorRater.
Another JavaScript compressor to note is the one that Google uses closure, checkout this article, which is not featured there.
I like Shrinksafe
Many other tools also shrink
JavaScript files, but ShrinkSafe is
different. Instead of relying on
brittle regular expressions,
ShrinkSafe is based on Rhino, a
JavaScript interpreter. This allows
ShrinkSafe to transform the source of
a file with much more confidence that
the resulting script will function
identically to the file you uploaded.
For CSS you can use Minify
I'm using JSMin service. I don't know if it's better or worse then YUI Compressor but it works well.
try http://shrinker.ch . it uses yuicompresspor for css files and google closure for javascript + some kind of magic.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'm looking for a free JavaScript obfuscator. Would compression be enough? What tools would you recommend? Of course, I don't need military-style obfuscation, I need a simple way to prevent kiddies from stealing my javascript by looking at the source or by using something simple such as unescape().
Thanks,
Tom
Your problem is that no matter how much you compress it or hide it, eventually the browser has to interpret it. The best you can do is renaming all variables to meaningless random vars, and removing all comments and whitespace.
A few good tools:
http://www.dev411.com/dojo/javascript_compressor/
http://javascriptcompressor.com/Default.aspx
http://developer.yahoo.com/yui/compressor/
You can use /packer/
http://dean.edwards.name/packer/
As a rule of thumb, do not use a obfuscator that uses eval since this will slow down your page, use a compressor that doesn't. This will provide obfuscation for newbies, anyone else will not be deterred by any obfuscator anyway.
Most obfuscators will create a strings representing the code in the end and then use eval, this can be undone by a simple alert statements, whats the point?
If you want simple obfuscation and excellent compression, I can recommend the YUI Compressor from Yahoo.
Check out For those looking - http://javascript-reference.info/javascript-obfuscators-review.htm - pretty good overview of JS obfuscators
I will second the recommendation for YUI Compressor as well, works very well and can compress and obfuscate, also makes recommendations on javascript coding.
I vote for Packer as well. There are online versions, Standalone Versions, and even a Console Version that I use to Automagically pack my javascripts when I build my web apps.
Try http://digua.sourceforge.net.
http://www.javascriptobfuscator.com/Default.aspx
http://ajaxian.com/archives/utility-javascript-obfuscator
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Has any one used this? I don't have a large background in Javascript and this lib looks like it may speed things along.
www.pyjs.org
yep. me. i'm the lead developer. drop by on groups.google.com "pyjamas-dev" and say hello.
Yes, I've used. It's amazing! I think it's much easier to use than the Java-based GWT. I found the Google Code wiki on it very practical: http://code.google.com/p/pyjamas/w/list
If you're just starting out with it, then definitely check out the showcase: http://pyjs.org/showcase/Showcase.html for usable snippets/widgets
As of now, it is not supported on M$ Windows, but runs beautifully on Linux.
yes it works fine on windows (it's a compiler: you just need python, to run the conversion to javascript). but if you're thinking of pyjamas-desktop, 0.6 added support for MSHTML as one of the engines, so that works too.
Yes. I've used pyjs to build minesweeper game: http://pymines.appspot.com/