Digital Propulsion

JS OBFUSCATOR

JS Obfuscator Readme *BETA*

INTRODUCTION
JS Obfuscator will allow you to obfuscate and optimize your javascript files by converting variable and function names into the shortest names possible and by stripping out extra text such as comments and spaces. JS Obfuscator is FREEWARE and can be downloaded from here.

REQUIREMENTS
.NET 2.0 Framework (can aquire from Windows Update, too)

USING THE SOFTWARE
Step 1: General Tab
On the first tab you need to specify an input and output folder. The input folder should contain the .js file(s) that you want to obfuscate. The output folder is where the obfuscated output files will be placed.

Step 2: Files Tab
The files tab will show you all .js files from the input folder (from the General tab). You can optionally display all files (*.*) by changing the Filetype Filter. You must check the files that you want the obfuscator to include (note, this application only supports stand-alone javascript files at the moment, no inline javascript, sorry).

Step 3: Extra Characters Tab
The extra characters tab has 3 checkboxes: Strip out all line breaks, Strip out extra spaces, Strip out comments. Strip out all line breaks will cause all of your javascript code to be put on a single line. This will remove line breaks and most likely make your script smaller. Strip out extra spaces will cause your javascript to not have more than one space (or tab or line break) in a row. This can make the readability go down, but should make for a smaller JS file. Unless you want your javascript to maintain readability, you will probably want to check all three of these.

Note, right now inline comments (//) will not be converted to multi-line comments (/* */) automatically. This means, if you strip all line breaks out, you will need to make sure the "Strip out comments" checkbox is checked OR make sure you have no inline comments in your code.

Step 4: Obfuscation
By obfuscating your function and variable names you're not only making your javascript less-readable to end-users, you're optimizing it by converting long variable and function names into one or two character random names.

If you want to obfuscate your functions and variables, make sure the Enable Function Obfuscator and Enable Variable Obfuscator checkboxes are checked. Next you will want to click Check All and then either manually rename all of your functions and variables, or click the New Random Functions and New Random Variables buttons. The New Random buttons will generate function and variable names that are as short as possible.

REPORTING BUGS
Any bugs, comments or suggestions can be submitted using the form, here. If your .js file doesn't work after converting, please send me the .js file so that I can attempt to fix it. Send the .js file to this email (replace 'at' with @): aplocher at gmail.com.

FUTURE FEATURES
  • Ability to obfuscate and optimize inline Javascript (and the HTML that calls the JS)
  • Syntax highlighted code preview
  • Recently used projects
  • Convert inline comments (//) into multi-line comments (/* */) when line breaks are stripped out
  • Auto-backup input files
  • Ability to specify a common prefix for all obfuscated variables and functions.


W3C: XHTML 1.0 Transitional  W3C: CSS Validated