混淆:JS保护

I've been writing lots of code for many years, but in the past it's never been required to be protected, mainly because the code was written for clients and not myself.

I have lots of JavaScript & jQuery code that I have written, my biggest issues is that I have Ajax requests as well, and these communicate with internal PHP files.

Here's a sample of code from Google:

function Yf(a, b, c) {
        c && (b = r(b, c));
        if (document.addEventListener) try {
                Zf(document, "DOMContentLoaded", b, a)
            } catch (d) {
                Zf(window, "load", b, a)
            } else if (!document.uniqueID && document.expando) var e = document.createElement("tempnode"),
                f = window.setInterval(function() {
                    try {
                        e.doScroll("left")
                    } catch (a) {
                        return
                    }
                    window.clearInterval(f);
                    f = e = null;
                    c && (b = r(b, c));
                    b()
                }, 50);
            else "readyState" in document ? f = window.setInterval(function() {
                    /loaded|complete/.test(document.readyState) && (window.clearInterval(f), f = null, c && (b = r(b, c)), b())
                },
                50) : Zf(window, "load", b, a)
    }

=====================================

Code comes from this url: http://www.google.com/inbox/assets/js/main.min.js

Online JavaScript beautifier: http://jsbeautifier.org/

Is this obfuscated or is it written this way from the beginning? (Sure, one can follow along and read this code and other lines, but there's no evidence of any Ajax requests that are communicating with an (or several) internal page files)

Similar question might have been posted previously, but bear with me.

Usually, no.

All those single letter variables are often the result of running code through a JavaScript minifier.

JavaScript code gets sent to the browser over HTTP, so it's practice to make the code as compact as possible to save on bandwidth (which, in Google's case, can be a lot). This involves the use of a minifier, which acts like a compiler of sorts that takes existing JS code and transforms it and optimizes it to be functionally identical, but in a much smaller size.

For more detail you can see the Wikipedia page on minification, which states:

Minification (also minimisation or minimization), in computer programming languages and especially JavaScript, is the process of removing all unnecessary characters from source code without changing its functionality. These unnecessary characters usually include white space characters, new line characters, comments, and sometimes block delimiters, which are used to add readability to the code but are not required for it to execute.