Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minify and obfuscate multiple javascript files at once [closed]

I want to minify and obfuscate multiple javascript files at once but keeping the way they are linked (name of variables and functions)

Do you know any software that could help ?

like image 918
Yukulelix Avatar asked Oct 19 '11 13:10

Yukulelix


People also ask

Does obfuscation affect performance JavaScript?

Name obfuscation does not affect the performance and should always be used. You can virtualize methods that are not computationally intensive.

Is obfuscated JavaScript slower?

It certainly does slow down the browser more significantly on older browsers (specifically when initializing), but it definitely slows it down even afterwards.

Should JavaScript be obfuscated?

While JavaScript obfuscation is often the entry point for those looking for some degree of source code protection, the bottom line is that obfuscation is usually a means to an end. While developing your application's threat model, it's important to understand the risks posed by unprotected JavaScript code.

Can you Deobfuscate JavaScript?

Press F12 to open Developer Tools inside Chrome. Now switch to the Scripts tab, right-click and choose De-obfuscate source. That's it! Alternatively, go to jsbeautifier.org and copy-paste the cryptic JavaScript /HTML code that you are trying to understand.


2 Answers

Pick whatever suits you best.

  1. Closure Compiler (online sandbox).
  2. YUI Compressor
  3. UglifyJS
like image 111
Sahil Muthoo Avatar answered Sep 29 '22 05:09

Sahil Muthoo


You can also convert multiple js files into multiple obfuscated files instead of having one single obfuscated files. I've created a solution and explained it on my blog. Please take a look: http://adilsblogs.blogspot.com/2012/07/obfuscating-multiple-js-files-using-yui.html

like image 33
Adil Malik Avatar answered Sep 29 '22 05:09

Adil Malik