Fixing the Feeling Lucky extension for FF 2.0

Brad Kowalczyk’s Feeling Lucky extension…

“Performs Google’s ‘I’m Feeling Lucky’ search with any selected text and opens the result in new a tab.

This is the first ever Firefox extension that I’ve created. I found myself selecting, copying, pasting text into the location bar to do an ‘I’m Feeling Lucky’ search all too often so I figured I should make an extension to make it just a little simpler.

Simply select some text and either hit ‘Enter’ or right-click it and select ‘Feeling Lucky’ The web page of the first Google search result for that text will open in a new tab.”

Mozilla

I felt I needed this, but it wasn’t FF 2.0 compatible, so I fixed it. Apparently, the only thing needed for that was replacing a call to gContextMenu.searchSelected() in feelingLucky.xul with a call to getBrowserSelection(). In addition to that, the em:maxVersion in install.rdf needs to be set for 2.0, naturally.

I’ve packed one fixed version of this, but I haven’t tested it (too lazy). Try it at your own risk.

0 thoughts on “Fixing the Feeling Lucky extension for FF 2.0

  1. Actually, SearchWith’s Address Bar option doesn’t do Google’s Feeling Lucky directly. Like the name says, it uses the same mechanism as the address bar so that if you try selecting SearchWith from your comment and apply SW’s Address Bar to it, you’re taken to SearchWith.com. If you apply Feeling Lucky to the same selection, you’ll get to the SearchWith Extension page – which is what I prefer.

    I assume this is because with the address bar, Smart keywords are only applied after other means of validating the written URL, such as adding a TLD, have failed.

  2. Pingback: Nuudelisoppa » Firefox: pressing enter randomly opens a Google search

  3. I’ve updated my fixed version to include support for Firefox 3.0.0.*. No changes in the code itself were apparently needed.