Amazon.com Widgets
Twitter » Linkedin » Flickr » DjangoPeople » Feed

This site is now an archive. New posts will be written at gregnewman.org. Please follow the new site and update your feeds.

...not so private reflections of greg.newman
RSS feed - 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.]