No, it's not recommended and in some cases it'll break the code (such as if you enable self-defending). Can I run a minifier such as UglifyJS or Google Closure Compiler on the obfuscated output? You don't have to worry too much about code size because there is a lot of repetition, so the obfuscated code will be compressed extremely well by your webserver (if you have GZIP compression enabled on your server, which most do nowadays). Also strings are converted to \xAB hexadecimal code to make things a little bit harder to understand. Why is my obfuscated code larger than my original source?īecause the obfuscator introduces new pieces of code that are meant to protect and defend against debugging and reverse-engineering. And any tool that promises that is not being honest. Since the JavaScript runs on the browser, the browser's JavaScript engine must be able to read and interpret it, so there's no way to prevent that. No, while it's impossible to recover the exact original source code, someone with the time, knowledge and patience can reverse-engineer it. You can show your work to the client knowing that they won't have the source code until the invoice has been paid. Protection of work that hasn't been paid for yet. Making it faster to load and harder to understand Removal of comments and whitespace that aren't needed.This is specially important on 100% client side projects, such as HTML5 games Prevent anyone from simply copy/pasting your work.There are numerous reasons why it's a good idea to protect your code, such as: FAQ Why would I want to obfuscate my JavaScript code?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |