Scrubber Obfuscator v0.1
A tool written in PHP to drastically reduce the size of Javascript files. Strips all unnecessary whitespace, as well as replaces variable and function names with shorter character strings. Scrubber has support for jQuery so that jQuery function names (attr, removeClass, etc.) can be used without being scrubbed.Download
Download Scrubber-0.1.zipObfuscate
Use
You can use Scrubber two ways, through the command line, or through a web form.Command Line
Scrubber takes 4 options.- -i [file] - in file to be processed
- -o [file_name] - filename of file to be saved to. will throw errors if directory is not writable.
- -s [s1,s2,s3...] - special words to not obfuscate (see Special Keywords heading below)
- -e [true|false] - if true, the output will be echoed instead of written to a file
If either -i or -o are not specified, Scrubber will complain about a file not existing.
Html Form
Scrubber has 2 options from a form. $_POST['s'] is the same as -s in the command line. $_POST['echo'] should always be set to true, otherwise an error will be thrown.Special Keywords
In addition to all reserved words in javascript as well as all function names in jQuery, you can specify any keywords you need to remain untouched. Cases where this is necessary: AJAX, POST, GET commands where a script is expecting parameters. Those parameters need to remain the same.Special characters are specified the same way in cli and forms: comma delimited with no spaces after the commas. "post_this,post_this_too,etc".
Knowing this, there are certain ways that you can optimize YOUR code to work best with Scrubber. If you have an AJAX POST or GET call, when specifying them, do not use the same variable names for your javascript names and post/get variables.
$.post("myscript.php", {
post_this: post_this_new,
post_this_too: post_this_too_new
}, function()...
Contact
If you have any questions, and/or bug fixes, contact me at hello () andrebluehs [] net.
Scrubber by Andre Bluehs is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.