DoubleClick and Define using Apple Dictionary

—Friday, February 08 2008
var selection;
if(window.getSelection)
  selection = window.getSelection();
else if(document.selection)
  selection = document.selection.createRange();

document.observe("dblclick", function() {
  if(navigator.userAgent.include("Macintosh")) {
	  location.href = "dict://" + selection;
	}
});

A quick (and probably dirty) Prototype-based hack allowing Mac users to get the definition of any word by double clicking it.