AutoPager
is a Firefox extension which automatically loads the next page of a
site inline when you reach the end of the current page for infinite
scrolling of content.
By default AutoPager works with a ton of sites, including Lifehacker, the New York Times, Digg, and, of course, Google.
You can always find the detail code changes at http://www.teesoft.info/hg/AutoPager/ .