What is the purpose of google.com/blank.html

Google has some URLs designed for special purposes, such as:

http://www.google.com/blank.html

and

http://clients3.google.com/generate_204

These are designed to facilitate detection of 'captive portals': that is, when you sign on to a wifi network at a hotel or airport, you (or an automated process) can go check these pages. If they return anything other than the intended result (i.e. if blank.html contains anything other than a blank page) then the process that's checking it knows that something is intercepting your web requests -- most likely a portal page demanding payment.

Example of its use, (WifiWatchdogStateMachine.java):

private static final String DEFAULT_WALLED_GARDEN_URL =
        "http://clients3.google.com/generate_204";
    /**
 * DNS based detection techniques do not work at all hotspots. The one sure
 * way to check a walled garden is to see if a URL fetch on a known address
 * fetches the data we expect
 */
private boolean isWalledGardenConnection() {
    HttpURLConnection urlConnection = null;
    try {
        URL url = new URL(mWalledGardenUrl);
        urlConnection = (HttpURLConnection) url.openConnection();
        urlConnection.setInstanceFollowRedirects(false);
        urlConnection.setConnectTimeout(WALLED_GARDEN_SOCKET_TIMEOUT_MS);
        urlConnection.setReadTimeout(WALLED_GARDEN_SOCKET_TIMEOUT_MS);
        urlConnection.setUseCaches(false);
        urlConnection.getInputStream();
        // We got a valid response, but not from the real google
        return urlConnection.getResponseCode() != 204;
    } catch (IOException e) {
        if (DBG) {
            log("Walled garden check - probably not a portal: exception " + e);
        }
        return false;
    } finally {
        if (urlConnection != null) {
            urlConnection.disconnect();
        }
    }
}

Further discussion about this can be found on this thread.


This URL is used by Google for multiple purposes, not just to facilitate detection of 'captive portals'.

I discovered that it is used in the case described below:

The Google blank.html referer is used when an image appears in the web-search SERP, and the user clicks on that image. this causes Google to display a black-background page with a larger view of the image thumbnail, and this (non-secured, i.e. HTTP not HTTPS) page contains some Google JavaScript/Ajax code that causes the original (full-size) image to be loaded by the browser, with a referer set to http://www.google.com/blank.html (or some localized variations, e.g. http://www.google.ca/blank.html etc).

Note that this different from what happens if the user does an image search. in that case, the image SERP is secured (HTTPS), and when the user clicks on a thumbnail image, google display the image scaled-up on black background, and the image SERP page contains some Google JavaScript/Ajax code that causes the original (full-size) image to be loaded by the browser, with a empty referer (not blank.html).

Tags:

Google