Amazon.com Widgets
...not so private reflections of greg.newman
Categories & Search

DoubleClick and Define using Apple Dictionary

A fantastic prototype script for Mac dictionary lookups.


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.

[Via AlternateIdea - Home.]

Leave a comment