Extending the "Direct Link Add On" from Mozilla Firefox

The Direct Link AddOn for Mozilla Firefox is a nice piece of software that allows to call web pages based on the currently selected text.
You are able to open web pages by selecting some text an clicking Direct Link / Open from the context menu. By default you can use this to open google and  wikipedia based on the currently selected text.

If you want to extend the selections offered by the default installation you need to change 2 files a directory called something like .../extensions/{a4ffd900-48b6-11db-b0de-0800200c9a66}/chrome/content 

 

What I'm doing here is to add a link to call the german /english dictionary offered from dict.leo.org 

In search.js add

  case "leo" :
      URL = 'http://dict.leo.org/ende?lp=ende&lang=de&searchLoc=0&cmpType=relaxed&sectHdr=on&spellToler=on&search='
          + selectedText + '&relink=on';
      break;

to the switch {......} block

In  menu.xul add  then line

 <menuitem id="directlink-leo" label="LEO" oncommand="openAsUrlDispatch('leo');"/>

somewhere to the <menupopup> block 

 

The above works for me on Ubuntu 6.10 and Firefox 2.0. But I'm NOT responsible for any damage the above might cause.