Home >Web Front-end >JS Tutorial >Script analysis, compression, obfuscation tool JSA new version released, compression efficiency increased by about 10%_javascript skills
SA 1.0 Alpha is released, with compression efficiency increased by about 10%
Compression algorithm improvements:
Implemented its own text compression algorithm
* Improved compression ratio and decompression efficiency.
Optimized syntax compression
* Merged consecutive var statements,
* Removed redundant var statements,
* Removed redundant braces ({, }),
* Removed extra semicolons (;).
UI improvements:
* Automatic encoding recognition
* Support file drag and drop
* Support JAVA1.4.2 When the jar is opened in java, it can be double-clicked to run, but if The JAR opening method has been modified (such as winrar), please use the following method:
CMD>java -jar xx.jar
* Formatting
Comments can only be between each statement, and comments inserted in the middle of the statement It may be lost during formatting, so consider it a bug.
* Compression parameter settings
Operation->Settings:
Perform syntax compression: local variables will be replaced and redundant syntax will be deleted.
Perform text compression: segment the script text into words, replace and compress it. It can be restored through eval(decompression function()) during execution.
Compatible with IE5 and NS3: Older browsers give priority to regular expression support. Do you need to be compatible with them (a slightly more complex decompression function needs to be used).
Condition settings for executing text compression: To set when to use text compression, there are two items, ratio requirement and size requirement; because eval requires additional overhead, so only when the text compression ratio is less than the specified value and the file size is greater than Text compression is used only when specified.
ANT Task
* Default encoding: Take the default encoding of JRE, which may change with different machines. Therefore, it is recommended to manually specify the encoding method (eg:charset="utf- 8"/charset="GBK")
* jsicompile task: compile JSI (compression, preload compilation, customized startup file)
* jscompress compression script
ANT Task example
jsicompiler Example (third-party script that handles JSI and its integration)
xml code