Codebox Software

LinkQuery Script

Published:

A GreaseMonkey script for obtaining information about links on a web page.

This script sends a query to the server hosting the file that a link points to, and retrieves information about the file, without actually downloading it. This can be useful if you want to know how large a file is before you start downloading it, or how recently a page has been updated. The information that the script can retrieve varies from website to website, but may include the following:

  • File/page size, in bytes
  • Content type
  • When the file was last modified
  • The type of web server hosting the file
  • The encoding used to transfer the file
  • The exact HTTP resonse code and message returned by the server

LinkQuery is activated by clicking on a link, while holding down the Ctrl and Shift keys on the keyboard. A small information pane opens next to the link when the query has been sent:

LinkQuery connecting

When the reply from the server is received, the information is displayed as shown:

LinkQuery results

You don't have to wait for the results for one link to be returned before querying another, just fire off multiple requests and wait for the results of each to come back. The results windows can be dragged around the screen using the mouse (grab them near the edge), and the results can be highlighted and copied to the clipboard using the normal keyboard shortcuts. Results windows can be closed at any time (even before the results have been received) by clicking on the Close link.

If the server returns an error, such as a '404 Not Found' response, then results are still displayed:

LinkQuery error

If you are using Firefox, and have the Greasemonkey extension, you can install this script now.