Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Obfuscation:</strong></p> <p>Try <a href="http://yuilibrary.com/" rel="noreferrer"><strong>YUI Compressor</strong></a>. It's a very popular tool, built, enhanced and maintained by the Yahoo UI team.</p> <p>You may also use:</p> <ul> <li><a href="http://closure-compiler.appspot.com/home" rel="noreferrer">Google Closure Compiler</a></li> <li><a href="http://marijnhaverbeke.nl/uglifyjs" rel="noreferrer">UglifyJS</a></li> </ul> <p><strong>Private String Data:</strong></p> <p>Keeping string values private is a different concern, and obfuscation won't really be of much benefit. Of course, by packaging up your source into a garbled, minified mess, you have a light version of <strong>security</strong> through <strong>obscurity</strong>. Most of the time, it's your user who is viewing the source, and the string values on the client are intended for their use, so that sort of private string value isn't often necessary.</p> <p>If you really had a value that you never wanted a user to see, you would have a couple of options. First, you could do some kind of encryption, which is decrypted at page load. That would probably be one of the most secure options, but also a lot of work which may be unnecessary. You could probably base64 encode some string values, and that would be easier.. but someone who really wanted those string values could <strong>easily decode them</strong>. Encryption is the only way to truly prevent anyone from accessing your data, and most people find that to be more security than they need.</p> <p><strong>Sidenote:</strong></p> <p>Obfuscation in Javascript has been known to cause some bugs. The obfuscators are getting a little better about it, but many outfits decide that they see enough benefit from <strong>minifying</strong> and <strong>gzipping</strong>, and the added savings of obfuscation <strong>isn't always worth the trouble</strong>. If you're trying to protect your source, maybe you'll decide that it's worth your while, just to make your code harder to read. <a href="http://www.crockford.com/javascript/jsmin.html" rel="noreferrer"><strong>JSMin</strong></a> is a good alternative.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload