Skip Navigation

Hi. I'm Dave, the internet addict behind FeedbackFair, Cheatography and Envoy.

Tagged with "google"

You can subscribe to this tag by rss or view all tags.

Cheat Sheets

No cheat sheets were found matching this tag.

Articles

Blog and Lab

Numbered Google Results User Script

A user script for Opera and Firefox that automatically numbers Google search results. Updated 16 Nov 2006 following changes to Google results page code.

Click here to read this post »

16 November 2006   |   49 comments   |   hacking, firefox, google, greasemonkey

Block Prefetching

Mozilla and Google's prefetching functions are a nice addition to browser technology in many ways. Unsurprisingly, they are not very well thought through. The main two problems with the prefetching idea are that it messes with log files and it means every link on a page could potentially be followed despite the consequences (dangerous in a site administration context).

It appears from the FAQ that Google only intends their accelerator to prefetch specific pages, that have been specified with the <link> tag. However, many people are claiming that normal links have been prefetched.

To prevent prefetching of a page is simple: add the following PHP to the page you do not want prefetched:

if ((isset($_SERVER['HTTP_X_MOZ'])) && ($_SERVER['HTTP_X_MOZ'] == 'prefetch')) {
    // This is a prefetch request. Block it.
    header('HTTP/1.0 403 Forbidden');
    echo '403: Forbidden<br><br>Prefetching not allowed here.';
    die();
}

This will serve a "forbidden" header to the prefetcher. Normal browsing should be unaffected.

20 April 2005   |   3 comments   |   webdev, block, mozilla, prefetching, google, reference, php