Dissecting the Google Firefox Toolbar
8th July 2005
Google have finally released a Firefox version of the Google Toolbar, with some nice praise for XUL in to the bargain. Of course, the most interesting part of the toolbar from a geeky point of view is the bit that queries Google’s servers for PageRank. Sure enough, if you download the google-toolbar.xpi
file, unzip it, then unzip the google-toolbar.jar
file within there’s a file called pagerank.js
with all of the juicy details.
To query PageRank, the toolbar makes a standard HTTP request to toolbarqueries.google.com
, with the page to query in a parameter along with a hash (presumably to discourage scraping). pagerank.js
includes the hash algorithm, with some amusing implementation details:
var GPR_HASH_SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer.";
function GPR_awesomeHash(value) {
var kindOfThingAnIdiotWouldHaveOnHisLuggage = 16909125;
...
}
The spell check feature (spellcheck.js
) is interesting as well. When you click the “Check” button, the toolbar packages any content in form fields up in XML and POSTs it to http://www.google.com/tbproxy/spell. It get backs a simple XML document providing the offset, length and confidence for each spelling error along with a list of suggested alternatives. The user interface stuff is all handled by the extension.
If you want to watch the toolbar in action, I recommend the fantastic LiveHTTPHeaders extension.
More recent articles
- Gemini 2.0 Flash: An outstanding multi-modal LLM with a sci-fi streaming mode - 11th December 2024
- ChatGPT Canvas can make API requests now, but it's complicated - 10th December 2024
- I can now run a GPT-4 class model on my laptop - 9th December 2024