mozdev.org

QLookup   

Home | Mailing List | Installation | Uninstallation | Extending | Source Code | Screenshots

QLookup is a quick hack to add Google and Dictionary lookups to the context menu in Mozilla. All you need to do is highlight a word or phrase on a web page and then right-click and select "Google" or "Dictionary" to perform a lookup on the selected word or phrase.

Simple hack? Yep. I firmly believe that (XPI + simple hacks) = success for Mozilla. I did this mainly for myself, because I wanted it. Send me a note if there's something else you'd like to see beyond Google and Dictionary.com. This is what Mozilla is all about. Enjoy.

Recently
I'm Mike Stricklin and I've recently (Oct 2002) adopted QLookup. It looked like a neat hack, but didn't work on my 1.1 browser, so I poked at the code and it seemed to be easy to fix. I've also changed a number of behaviors which may or may not be popular; let me know how you feel.

Fixes/Features

  • No longer hangs Mozilla 1.1 and better on shutdown.
  • All searches open in tabs now, rather than new windows. "It's the Mozilla way! ©"
  • Properly fetches selections from sub-frames.
  • If a string has a leading or trailing space, it's trimmed before 'Go to URL'.
  • If no-thing is selected, the QLookup menu items are disabled. Code for this ripped off from the LeoDict project.
  • Example code for extending included inline, in source code, also new page for same.
  • Hokay. I've been convinced that my schema for 'Go to URL' is wrong! wrong! wrong! It's possible to have interior spaces in URLs, and not necessarily a good thing to prepend 'http://'. Now we're back to the original functionality: whatever is selected, Go to URL will pass on the mozilla to use as best it can. Faulty URLs are *your* responsibility ;->
Install QLookup  email the author

Test Matrix

 Linux MacOS XMacOS oldWindows
1.0      X
1.0.1       
1.1 X   X X
1.2.1 X   X  

User Notes: [?]

If you do not get a response to a question posted in this forum, please try sending a message to the project's mailing list or to the project owner directly.

[1] Submitted by: JC on Monday November 12th 2001

Post any questions or comments here.

[2] Submitted by: JK on Monday January 14th 2002

is there a way to hack the hack to make results open in a new tab instead of a new window?

[3] Submitted by: Richard on Friday May 24th 2002

I like it, but can I get it to open a tab instead of a new window? I am HOOKED on tabs in Mozilla!!! :)

Thanx! Richard

[4] Submitted by: shipdoc on Saturday June 1st 2002

Qlookup http://qlookup.mozdev.org/ adds the term snarf!!! to the Help menu.

The item can be checked or unchecked.

A definition of snarf /vt./ "To grab, esp. to grab a large document or file for the purpose of using it with or without the author's permission" raises questions regarding the safety and purpose of this menu item.

Can anyone explain the function behind this menu item and validate its safety?

Thanks

shipdoc

[5] Submitted by: Greg on Wednesday June 5th 2002

Yeah, I noticed "Snarf!!!" on my Help menu as well... I was wondering where that came from. Please do tell, what does it do, if anything?

[6] Submitted by: Kevin C. (LeBleu) on Thursday June 6th 2002

Yes, it is possible to make it open in a tab instead of a new window, if you are using tabs. I submitted a patch to the author on 2002-05-24 with the modifications necessary to do so. I have as of yet received no reply.

I have now made the patch available from http://www.paganpaths.org/~lebleu/qlookup.js-tabpatch.txt as well.

Enjoy! -- Kevin

[7] Submitted by: walkAbout on Monday June 10th 2002

Hi, FYI, I posted this in the "netscape.mozilla.user.win32" NG:

--- Original Message --- On 2002-06-05 5:06 PM, walkAbout wrote:

Hi,

the latest builds seems to have a new bug. Or it is one of the add-ons I'm using (spellchecker, prefbar, calendar, qlookup). Ok, I will try it also without addons.

The problem is, when I exit Mozilla, I'm unable to reload it again. The splash screen appears and then nothing. Weird that I can open mailnews, so probably it is an addon that causes this.

Anyone else noticed this??

CU walkAbout

Hi again,

so for now I think it is the qlookup plugin. I did a new install just without this one and Mozilla works so far.

CU walkAbout

Jay Garcia (NS champion): When you exit Mozilla, do CTRL+ALT+DEL to bring up the "task list". If "mozilla" is listed then "end task" on it and try again. This anomaly happens sometimes when exiting from the mail/news component.

Yes Jay, that's what I did several times. Although Mozilla is completely removed from the memory, it doesn't start. Without the qlookup plugin everything is fine. If I have the time, I will forward these postings to guy, who developed this plugin.

CU walkAbout

[8] Submitted by: Sam on Monday June 10th 2002

I hope it is one of these addons that is flooding this fourm. In answer to your question, qlookup is highly unlikely to be causing the problem. It is, as the author says, just an interface hack, implemented via Javascript. You could probably remove Snarf if you like, its probably just for debugging.

[9] Submitted by: walkAbout on Tuesday June 11th 2002

Hi, sorry for the flood. I used accidental a local proxy server and this might caused the problem for the flood. This time without proxy... To the topic. Since I removed QLookup my Mozilla runs fine again.

[10] Submitted by: jccalhoun on Thursday June 20th 2002

I too have had problems with qlookup killing the latest builds of mozilla on winxp

[11] Submitted by: Jason Keirstead on Monday June 24th 2002

A realy cool context menu addon would be the ability to right click a <li>link</li> and open it in the Wayback machine or the Google cache.

[12] Submitted by: Daniel Wang on Thursday June 27th 2002

google search is kind of obsolete (moz already has 'Web search for "/selection/"' popup menu item).

[13] Submitted by: MSeeley on Thursday July 4th 2002

I like the feature for highlighting and doing a "new search" based on your selection. Is Qlookup the feature that so this too? I can't seem to find any others that mention it. If so I'd like to make some long needed changes if I can.

[14] Submitted by: Minh on Friday July 19th 2002

What does snarf do?

Suggestion: delete google search, add thesaurus, add translator, add tabs support or pop support, another idea is to have definitions appear as tooltips.

[15] Submitted by: sysinfo on Wednesday August 21st 2002

Just started tinkering with qlookup.. perfect addon for me with a few changes. Changed to a context submenu (adding 7-10 search items, so this is less cluttered), removed Snarf, and made the results come up in tabs (many thanks to Kevin C. for the initial code posted above)

Minh-or anyone else, really-a thesaurus and hopefully translation are in the works for my little modification, any interest in the results when they're finished?

[16] Submitted by: Stephanie on Saturday August 24th 2002

Jason, opening links in wayback or google cache would be great!

Sysinfo: yep, that would sound interesting. Where do I sign up? ;-)

[17] Submitted by: quanta on Thursday August 29th 2002

Qlookup and Mozilla 1.1 don't like each other. I also get the "mozilla.exe won't end process" problem, and I links that open in new windows will no longer load. Which sort of sucks. I love this plugin, but if it is causing so many problems, I really want to know how to remove it.

[18] Submitted by: georgie on Friday August 30th 2002

Manually, like any other XPI add-on not having an uninstall routine.

1- Quit mozilla, even the quicklaunch feature. 2- Open a file browser (explorer in Windows), go to the directory where you installed Mozilla. (Mozilla) 3- Delete the "Mozillachromeoverlayinfo" directory, and the file "Mozillachromechrome.rdf". 4- Delete the offending add-on *.jar file in the "Mozillachrome" directory, or in this case, it is in a subdirectory tree called "Mozillachromeqlookup". Delete that directory. 5- Start Mozilla.

[19] Submitted by: georgie on Friday August 30th 2002

Oh well, that thing looks really messed up....

1- Quit mozilla, even the quicklaunch feature.

2- Open a file browser (explorer in Windows), go to the directory where you installed Mozilla. Enter the "chrome" directory under Mozilla home.

3- Delete the "overlayinfo" subdirectory, and the file "chrome.rdf".

4- Delete the offending add-on *.jar file, or in this case, it is a subdirectory tree called "qlookup". Delete that subdirectory.

5- Start Mozilla.

I hope this helps.

georgie

[20] Submitted by: quanta on Friday August 30th 2002

Thanks for the tips - I assume deleting all the overlayinfo directory will kill all your XPIs. Although, I bit the bullet and just uninstalled Moz and reinstalled it and then came back here, reinstalling all my XPIs (except Qlookup, unfortunately). How do you install XPIs without having to download them again?

Sysinfo, Qlookup kicked butt when I used Moz 1.0 - if you are willing to make a "Son of Qlookup", please post it on Mozdev, I think we would all be very interested!

[21] Submitted by: quanta on Friday August 30th 2002

I see, deleting /overlayinfo and chrome.rdf is okay, since Moz will rebuild them when you restart it.

[22] Submitted by: Michael on Sunday September 8th 2002

Any fix on this, I had a clean Mozilla 1.1 install and just added this feature (I wanted the dictionary feature). I replicated all the hangs mentioned above. Ended up reinstalling 1.1 which removed the plug in -- all is well now without it again :(.

[23] Submitted by: quanta on Saturday September 14th 2002

Qlookup has been put up for adoption...Sysinfo or whoever, please adopt this kickass XPI...

[24] Submitted by: chandler on Saturday September 21st 2002

Would you add a note in "What's new" as follows: "Qlookup doesn't work with Mozilla 1.1, 1.2a"

[25] Submitted by: Roman Stukalov on Monday September 23rd 2002

>It doesn't seem to work in a frames-based page -- I'm >probably pulling the selection from the frame >definition page, not the currently active page... >drop me a line if you know a better way to: >selection = window._content.document.getSelection();

Hi! If you still curious here is how to do it:

var focusedWindow = document.commandDispatcher.focusedWindow; var selection = focusedWindow.__proto__.getSelection.call(focusedWindow);

Please, keep the project alive, Sorry for bad english.

[26] Submitted by: Roman Stukalov on Tuesday September 24th 2002

Hello All! It's me again.

I have fixed problem with "mozilla.exe won't end process" and "won't open links in new window". Also have i added posibility to use it on pages with frames and other small changes. I have tested it on mozilla 1.2a on Linux and win98.

How can i post here modified version?

Sorry again for bad english, Roman Stukalov <zulus3@yahoo.com>

[27] Submitted by: Dominic Tey on Sunday September 29th 2002

Hello, Roman,

why don't you adopt qlookup - I believe it's up for adoption.

Dominic Tey

[28] Submitted by: Dominic on Sunday October 13th 2002

Thanks, Mike for your adoption and improvements,
It's confiremd that it works for Mozilla 1.1 (Gecko/20020826) on Windows XP (haven't tested the sub-frame thingy but I have no doubt it will work too :-)
And searches appear in a New Tab which is truly "The Mozilla way! ©" as you said. Really, really appreciate this.
And as for your RFC, I think a error message is more informative (and looks less like a bug on qlookup/mozilla's part) than if an empty search tab is opened (which also has the disadvantage in shifting the user's focus to the new tab, and confusion the user)
Dominic Tey

[29] Submitted by: Michel Valdrighi on Saturday October 19th 2002

It works on Mozilla 1.2b (20021007).
I LOVE the Go To URL option ! It's something I've been asking for in the main Mozilla trunk... Though it could use some recognition of the highlighted string, to see if it really is an URL (the most basic way would be: "the string has no space inside, and either is a number, or has one dot in it").

[30] Submitted by: jccalhoun on Wednesday November 6th 2002

love that it has been updated. how about an option to change where the dictionary lookup goes to? I prefer meriam webster's online dictionary (www.m-w.com) to dictionary.com

[31] Submitted by: Sam Greenfield on Friday November 15th 2002

To get a lookup at m-w.com, you can change the file to read &lt;menuitem id="qlookup-dict" label="Lookup at m-w.com" oncommand="doLookup('http://www.m-w.com/cgi-bin/dictionary?va=')"/&gt;

This isn't the best way to do the update; I should really create a new item or somesuch.

[32] Submitted by: Sam Greenfield on Friday November 15th 2002

*sigh* I didn't realize the comments quote the HTML properly. And I didn't specify which file.

You can modify the file qlookup.xul (version 1.5 line 40) to read:
<menuitem id="qlookup-dict" label="Lookup at m-w.com" oncommand="doLookup('http://www.m-w.com/cgi-bin/dictionary?va=')"/>

[33] Submitted by: Tobias Pfaff on Friday November 29th 2002

I've made a few additions for different lookups:

Leo, a popular German-English Dictionary:
<menuitem id="qlookup-leo" label="Suche bei Leo Dictionary" oncommand="doLookup('http://dict.leo.org/?client=bookmarklet&#38;search=')"/>

Amazon.de, should work with Amazon.com as well:
<menuitem id="qlookup-amaz" label="Suche bei Amazon" oncommand="doLookup('http://www.amazon.de/exec/obidos/external-search/?index=blended&#38;keyword=')"/>

Internet Movie Database (us.imdb.com for English texts):
<menuitem id="qlookup-imdb" label="Suche bei IMDB" oncommand="doLookup('http://german.imdb.com/Find?for=')"/>

All Music Guide (sadly, this just works for one word queries):
<menuitem id="qlookup-amg" label="Suche bei All Music Guide" oncommand="doLookup('/cg/amg.dll?P=amg&#38;uid=SEARCH&#38;opt1=1&#38;sql=')"/>

[34] Submitted by: Kevin C. (LeBleu) on Friday November 29th 2002

Thanks for adopting and updating this Mike!

One thing I have to disagree with is testing whether something selected for "Go to URL" is really a URL. If you use the Mozilla feature where you can create keyword bookmarks that take a parameter, so, for example you can make typing "bug 1234" in the URL bar show you Mozilla bug #1234 or "cache URL" open the URL in the Google cache, then you may find it useful to treat the phrase "bug 1234" as a URL you can go to. (Espescially if it is on Slashdot ;)

Just my humble suggestion -- Kevin

[35] Submitted by: Sam Greenfield on Monday December 2nd 2002

I made a hack to put the qlookup items into their own submenu. I'm not sure if other folks would be interested in it. I added quite a few searches to the qlookup xul, so the submenu is pretty handy. Here is what my qlookup.xul file now looks like; this snippet goes inside the popup tag:

<menu label="Lookup">

<menupopup>

<menuitem id="qlookup-dict" label="dictionary.com" oncommand="doLookup('http://www.dictionary.com/search?q=')"/>

<menuitem id="qlookup-goog" label="Google" oncommand="doLookup('http://www.google.com/search?q=')"/>

<menuitem id="qlookup-news" label="Google News" oncommand="doLookup('http://news.google.com/news?client=googlet&amp;q=')"/>

<menuitem id="qlookup-groups" label="Google Groups" oncommand="doLookup('http://groups.google.com/groups?client=googlet&amp;q=')"/>

<menuitem id="qlookup-amaz" label="Amazon" oncommand="doLookup('http://www.amazon.com/exec/obidos/external-search/?index=blended&amp;keyword=')"/>

<menuitem id="qlookup-imdb" label="IMDB" oncommand="doLookup('/Find?for=')"/>

<menuitem id="qlookup-url" label="Go to URL" oncommand="gotoURL()"/>

</menupopup>

</menu>

Enjoy!

Sam

[36] Submitted by: lkisser on Friday December 13th 2002

Hello,
Just installed it and love it.
Anyway, I am using Mozilla 1.2.1 (20021130 WinXP) and whenever I right click on the page the menu items are not disabled even if nothing is highlighted. I think the function isSelection() does not get invoked, don't know why.

I also made a hack so that the tab is opened based on the load links in the background preference. I copied the codes from mozgest :)

// preferences root branch
var prefRoot =
Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");

function doUrl(urlToLoad) {
var browser = getBrowser();

// Original line
// browser.selectedTab =
// browser.addTab(urlToLoad, getReferrer(document));

var tab = browser.addTab(urlToLoad, getReferrer(document));
if (!prefRoot.getBoolPref("browser.tabs.loadInBackground"))
browser.selectedTab = tab;
}

[37] Submitted by: lkisser on Friday December 13th 2002

Hello,

Now I know why the menu items are not disabled even there is not any text highlighted. isSelection() is not called because linky was installed and linky.xul has onpopupshown on the same id too:
<popup id="contentAreaContextMenu" onpopupshown="linkyContext()">

So, I created a submenu based on what Sam wrote:

<popup id="contentAreaContextMenu">
<menu label="QLookup">
<menupopup onpopupshown="isSelection()">
<menuitem id="qlookup-goog" ...
<menuitem id="qlookup-url" ...
<menuitem id="qlookup-dict" ...
</menupopup>
</menu>
</popup>

and now qlookup and linky are together happily!

[38] Submitted by: dirk on Friday January 3rd 2003

great work!
dl /

[39] Submitted by: Tom on Tuesday January 7th 2003

Qlookup is great, thanks. Esp. love the url feature.

I have noticed one problem that I think might be attrubuted to qlookup. I use mozilla 1.2.1 at work and at home. At home I ahve qlookup installed, and sometimes when I click in the address bar, it will highlight the entire url and I can't click to deselect it. I'll have to use the arrow keys to get the cursor back. At work, I do not have qlookup installed and I do not notice the problem there. Anyone having the same issue?

[40] Submitted by: Sam Lee on Saturday January 11th 2003

Anyone thought of applying the same technique with custom keyword bookmark?
Coincidently, I have been hacking up something like qlookup with custom keyword bookmark, so that the functionalities can be extended simplying by adding custom keyword bookmark:
http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&group=netscape.public.mozilla.ui&selm=z9PT9.23%24Ey.317%40news.oracle.com

[41] Submitted by: ML on Tuesday February 4th 2003

Has anyone been able to get qlookup work with Phoenix 0.5? Thanks in advance,

[42] Submitted by: NectarineBlue on Saturday March 1st 2003

does anyone know how to get two sites to load at the same time like Opera's super search.. and when it comes to the google advanced search isnt that the same way one would get the google directory search? and if so why isnt it in there.

[43] Submitted by: nectarineblue on Sunday March 2nd 2003

// ==============
// original code didnt contain keywords
//
function doLookup(prefix) {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;
urlToLoad = prefix+selection;
doUrl(urlToLoad);
}

[44] Submitted by: Alexander Udalov on Sunday March 9th 2003

Great toy, this QLookup! Thanx! Among my long list in the popup menu I could donate the following:

<menuitem id="qlookup-images" label="Lookup at Google Images" oncommand="doLookup('http://images.google.com/images?client=googlet&amp;q=')"/>

that one was easy... didn't work the code for Google's 'Web Directory' yet, though. Also, I need more universal code to process entries in non-English, non-Latin languages, anyone to help?

Another working code:

<menuitem id="qlookup-ebay" label="Lookup at eBay" oncommand="doLookup('http://search.ebay.com/search/search.dll?MfcISAPICommand=GetResult&amp;query=')"/>

Naturally, this trick will work with national eBays, like eBay.de, eBay.jp, whatever. Here, also, I need some advanced help: how do you make external search at eBay having 'Search in titles AND descriptions' marked? Anyone to help?

Also, looking for code to include Wikipedia, Slashdot, Tucows News, Sourceforge, Freshmeat, Britannica, MapQuest, Oxford English Dictionary (if it's possible at all, w/out subscription...), and whatnot.
To QLookup creators: one little bug -- QLookup interferes with my Googlebox (out of Multizilla):
"The file /search?sourceid=mozclient&q={mysearchword} cannot be found. Please check the location and try again". Naturally, only {mysearchword} was entered and visible in the Googlebox. Out of two Googlebox and QLookup smart services, I need both, how do I disentangle them, please? Shouldn't be very hard, I suppose...

Thanx again, and please reply here.
AU

[45] Submitted by: AK47 on Sunday March 16th 2003

If you look at the screenshot he has im wondering how do you get his oter menue items? Also, how do you arrange your menus?

Thanks_Aaron Kok

[46] Submitted by: Posicionamiento on Monday March 17th 2003

Hi from Spain!!

[47] Submitted by: buscadores on Friday March 21st 2003

i don't like having the results on another window

[48] Submitted by: Diseño web on Wednesday April 2nd 2003

The best browser! /

[49] Submitted by: Jens G. Clausen on Friday April 4th 2003

A minor problem with the Go to URL-function. If the selected URL contains a protocol (http://www.foo.bar/) Qlookup will try to go address www.<protocol>.com

With http-links this gives a quite surprising result: the browser is redirected to a porn site.

A small suggestion: Test the URL before determining whether it needs a protocol or not.

[50] Submitted by: jccalhoun on Tuesday April 8th 2003

here's a request, how would one add an option to search the imdb (www.imdb.com)?

[51] Submitted by: ML on Wednesday April 9th 2003

Phoenix users can use SearchThis! (http://searchthis.mozdev.org)

[52] Submitted by: jonh on Friday April 11th 2003

searchthis.mozdev.org don't work for me..

[53] Submitted by: Brian on Sunday April 13th 2003

As Jens said, minor problem with the Go to URL-function, if the selected URL contains a protocol (http://www.foo.bar/) Qlookup ends up going to http://search.netscape.com/nscp_results.adp?query=http&source=NSCPRedirect for me. Thanks to the notes above, I figured out that as long as I only select (www.foo.bar/) then it ends up going to the correct place.

[54] Submitted by: Tim Nelson on Sunday April 13th 2003

As a non-root user using Redhat 7.2 (Mozilla 0.9.2.1) it complains "Failed to create directory" (probably due to not having root).

Thanks,

[55] Submitted by: Paul on Saturday April 19th 2003

Thanks you for the web, it is what I needed to complete my work.
You do a very good work and you must feel proud of it.

[56] Submitted by: adwod on Wednesday April 30th 2003

I see, deleting /overlayinfo and chrome.rdf is okay, since Moz will rebuild them when you restart it.

[57] Submitted by: diseño on Wednesday April 30th 2003

very nice work

[59] Submitted by: Sam Greenfield on Tuesday May 6th 2003

In the doLookup function, urlToLoad is set to "prefix+selection". I've played around with using "prefix+escape(selection)" instead. I've run into a problem when the selection is not escaped. I like to use Google to look up addresses. They may be formatted in a web page on two lines as:

123 Foobar lane
Foobar, NJ 00000

The problem with the existing code is that the lookup URL gets translated into something like http://www.google.com/search?q=123+Foobar+laneFoobar,+NJ+00000

As you can see, the linebreak between lane and Foobar is not converted. By escaping the code, the address gets converted to:
http://www.google.com/search?q=123%20Foobar%20lane%0D%0AFoobar,%20NJ%2000000

This allows google to recognize the address as an address.

Does anyone have other opinions? Can this (or should this) be rolled into the main code?

Thanks,
Sam

[60] Submitted by: Sam Greenfield on Tuesday May 6th 2003

For a working example of the issue I describe, you can use the following address to select and search in google. (My provided example is bogus)

135 W. 50th Street
New York, NY 10020

--Sam

[61] Submitted by: NectarineBlue on Sunday May 11th 2003

/*
* Quick Lookup for Mozilla
* QLookUp.Js (Example of my modifications)
*/

// ==============
// == load-time code ==
var elementTags = new Array('qoogle_web',
'google_pic',
'google_grp',
'google_dir',
'google_new',
'google_adv',
'allweb_web',
'allweb_new',
'allweb_pic',
'allweb_vid',
'allweb_mp3',
'allweb_ftp',
'all_info',
'almanacs_info',
'general_info',
'enter_info',
'sport_info',
'dict_info',
'ency_info',
'bio_info',
'web_pile',
'ima_pile',
'aud_pile',
'smd_pile',
'nws_pile',
'fil_pile',
'brd_pile',
'w_mama',
'n_mama',
'i_mama',
'a_mama',
'k_mama',
'dict',
'theo',
'go-url');


// ==============
function getSelection() {
var focusedWindow = document.commandDispatcher.focusedWindow;
var selection = focusedWindow.__proto__.getSelection.call(focusedWindow);
return String(selection);
}
// ==============
function isSelection() {
var activeP = 'true';

if (getSelection().length > 0)
activeP = 'false';

for (var i=0; i<elementTags.length; i++)
document.getElementById(elementTags[i]).setAttribute('disabled',activeP);
}

// ==============
function doUrl(urlToLoad) {
var browser = getBrowser();
browser.selectedTab = browser.addTab(urlToLoad, getReferrer(document));
}

// ==============
function doLookup(prefix) {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;
urlToLoad = prefix+selection;
doUrl(urlToLoad);
}

// ==============
function gotoURL() {
var selection = getSelection();
if (selection.length < 1)
return;
while (1) {
if (selection.substring(selection.length - 1, selection.length) != " ")
break;
selection = selection.substring(0, selection.length - 1);
}

doUrl('http://'+selection);
}


// ==============
function doGoogleAdvanced() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://www.google.com/search?as_q=';
urlPostfix = '&num=100&hl=en&ie=ISO-8859-1&btnG=Google+Search&as_epq=&as_oq=&as_eq=&lr=&as_ft=i&as_filetype=&as_qdr=all&as_occt=any&as_dt=i&as_sitesearch=&safe=images';

doUrl(urlPrefix + selection + urlPostfix);
}

// ==============
function doGoogleDirectory() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=';
urlPostfix = '&sa=N&tab=id&cat=gwd%2FTop';

doUrl(urlPrefix + selection + urlPostfix);
}

// ==============
function All_InfoPlease() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://www.infoplease.lycos.com/search.php3?query=';
urlPostfix = '+&in=all&go.x=21&go.y=8';

doUrl(urlPrefix + selection + urlPostfix);
}


// ==============
function All_Almanacs_InfoPlease() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://www.infoplease.lycos.com/search.php3?query=';
urlPostfix = '+&in=almanacs&go.x=13&go.y=6';

doUrl(urlPrefix + selection + urlPostfix);
}

// =================
function General_Almanacs_InfoPlease() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://www.infoplease.lycos.com/search.php3?query=';
urlPostfix = '+&in=general&go.x=11&go.y=7';

doUrl(urlPrefix + selection + urlPostfix);
}

// =================
function Entertainment_Almanacs_InfoPlease() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://www.infoplease.lycos.com/search.php3?query=';
urlPostfix = '+&in=entertainment&go.x=9&go.y=5';

doUrl(urlPrefix + selection + urlPostfix);
}


// =================
function Sports_Almanacs_InfoPlease() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://www.infoplease.lycos.com/search.php3?query=';
urlPostfix = '+&in=sports&go.x=11&go.y=7';

doUrl(urlPrefix + selection + urlPostfix);
}


// =================
function Dictionary_InfoPlease() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://www.infoplease.lycos.com/search.php3?query=';
urlPostfix = '+&in=dictionary&go.x=10&go.y=9';

doUrl(urlPrefix + selection + urlPostfix);
}

// =================
function Encyclopedia_InfoPlease() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://www.infoplease.lycos.com/search.php3?query=';
urlPostfix = '+&in=encyclopedia&go.x=15&go.y=6';

doUrl(urlPrefix + selection + urlPostfix);
}


// =================
function Web_DogPile() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://search.dogpile.com/texis/search?q=';
urlPostfix = '&cat=web&top=1';

doUrl(urlPrefix + selection + urlPostfix);
}


// =================
function Pic_DogPile() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://search.dogpile.com/texis/search?q=';
urlPostfix = '&cat=ima&top=1';

doUrl(urlPrefix + selection + urlPostfix);
}

// =================
function Mp3_DogPile() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://search.dogpile.com/texis/search?q=';
urlPostfix = '&cat=audio&top=1';

doUrl(urlPrefix + selection + urlPostfix);
}


// =================
function Media_DogPile() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://search.dogpile.com/texis/search?q=';
urlPostfix = '&cat=smd&top=1';

doUrl(urlPrefix + selection + urlPostfix);
}

// =================
function News_DogPile() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://search.dogpile.com/texis/search?q=';
urlPostfix = '&cat=nws&top=1';

doUrl(urlPrefix + selection + urlPostfix);
}


// =================
function Files_DogPile() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://search.dogpile.com/texis/search?q=';
urlPostfix = '&cat=files&top=1';

doUrl(urlPrefix + selection + urlPostfix);
}


// ==============
function Web_Mama() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http:www.mama.com/Mamma?query=';
urlPostfix = '&image222x=31&image222.y=7&qtype=0';

doUrl(urlPrefix + selection + urlPostfix);
}


// ==============
function News_Mama() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://www.mamma.com/Mamma?cb=Mama%2FMamma&query=';
urlPostfix = '&image222.x=38&image222.y=5&qtype=4';

doUrl(urlPrefix + selection + urlPostfix);
}


// ==============
function Images_Mama() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://mamma18.mamma.com/Mamma_pictures?query=';
urlPostfix = '&go.x=22&go.y=8&qtype=48';

doUrl(urlPrefix + selection + urlPostfix);
}

// ==============
function Audio_Mama() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://mamma18.mamma.com/Mamma?timeout=8&query=';
urlPostfix = '&go.x=59&go.y=9&qtype=49';

doUrl(urlPrefix + selection + urlPostfix);
}

// ==============
function Kids_Mama() {
var selection = getSelection();
if (selection.length < 1)
selection = prompt('Keywords...','');
if (selection.length < 1)
return;

urlPrefix = 'http://mamma18.mamma.com/Mamma?timeout=8&query=';
urlPostfix = '&go.x=56&go.y=5&qtype=80';

doUrl(urlPrefix + selection + urlPostfix);
}

[62] Submitted by: Nectarine Blue on Sunday May 11th 2003

<overlay id="qlookup"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script type="application/x-javascript" src="qlookup.js"/>

<popup id="contentAreaContextMenu" onpopupshown="isSelection()">
<menuseparator id="qlookup-sep"/>

<menu label="Lookup">
<menupopup>

<menu label="Google">
<menupopup>
<menuitem id="google_web" label="Web" oncommand="doLookup('http://www.google.com/search?q=')"/>
<menuitem id="google_pic" label="Image" oncommand="doLookup('http://images.google.com/images?q=')"/>
<menuitem id="google_grp" label="Groups" oncommand="doLookup('http://groups.google.com/groups?client=googlet&amp;q=')"/>
<menuitem id="google_dir" label="Directory" oncommand="doGoogleDirectory()"/>
<menuitem id="google_new" label="News" oncommand="doLookup('http://news.google.com/news?client=googlet&amp;q=')"/>
<menuitem id="google_adv" label="Google Advanced" oncommand="doGoogleAdvanced()"/>
</menupopup>
</menu>

<menu label="AllWeb">
<menupopup>
<menuitem id="allweb_web" label="Web" oncommand="doLookup('http://www.alltheweb.com/search?cat=web&#38;cs=iso-8859-1&#38;q=')"/>
<menuitem id="allweb_new" label="News" oncommand="doLookup('http://www.alltheweb.com/search?cat=news&#38;cs=iso-8859-1&#38;q=')"/>
<menuitem id="allweb_pic" label="Picture" oncommand="doLookup('http://www.alltheweb.com/search?cat=img&#38;cs=iso-8859-1&#38;q=')"/>
<menuitem id="allweb_vid" label="Video" oncommand="doLookup('http://www.alltheweb.com/search?cat=vid&#38;cs=iso-8859-1&#38;q=')"/>
<menuitem id="allweb_mp3" label="Mp3" oncommand="doLookup('http://www.alltheweb.com/search?cat=mp3&#38;cs=iso-8859-1&#38;q=')"/>
<menuitem id="allweb_ftp" label="Ftp" oncommand="doLookup('http://www.alltheweb.com/search?cat=ftp&#38;cs=iso-8859-1&#38;q=')"/>
</menupopup>
</menu>


<menu label="InfoPlease">
<menupopup>
<menuitem id="all_info" label="All" oncommand="All_InfoPlease()"/>
<menuitem id="almanacs_info" label="All Almanacs" oncommand="All_Almanacs_InfoPlease()"/>
<menuitem id="general_info" label="General" oncommand="General_Almanacs_InfoPlease()"/>
<menuitem id="enter_info" label="Entertainment" oncommand="Entertainment_Almanacs_InfoPlease()"/>
<menuitem id="sport_info" label="Sports" oncommand="Sports_Almanacs_()"/>
<menuitem id="dict_info" label="Dictionary" oncommand="Dictionary_InfoPlease()"/>
<menuitem id="ency_info" label="Encyclopedia" oncommand="Encyclopedia_InfoPlease()"/>
<menuitem id="bio_info" label="Biographies" oncommand="doLookup('http://www.infoplease.lycos.com/biography.php3?query=')"/>
</menupopup>
</menu>

<menu label="DogPile">
<menupopup>
<menuitem id="web_pile" label="web" oncommand="Web_Pile()"/>
<menuitem id="ima_pile" label="Pic" oncommand="Pic_DogPile()"/>
<menuitem id="aud_pile" label="Mp3" oncommand="Mp3_DogPile()"/>
<menuitem id="smd_pile" label="Media" oncommand="Media_DogPile()"/>
<menuitem id="nws_pile" label="News" oncommand="News_DogPile()"/>
<menuitem id="fil_pile" label="Files" oncommand="Files_DogPile()"/>
<menuitem id="brd_pile" label="Boards" oncommand="doLookup('http://www.boardreader.com/scripts/texis.exe/search?query=')"/>
</menupopup>
</menu>

<menu label="Mama">
<menupopup>
<menuitem id="w_mama" label="Web" oncommand="Web_Mama()"/>
<menuitem id="n_mama" label="News" oncommand="News_Mama()"/>
<menuitem id="i_mama" label="Pics" oncommand="Images_Mama()"/>
<menuitem id="a_mama" label="Audio" oncommand="Audio_Mama()"/>
<menuitem id="k_mama" label="Kids" oncommand="Kids_Mama()"/>
</menupopup>
</menu>

<menuitem id="dict" label="Dictionary" oncommand="doLookup('http://www.dictionary.com/search?q=')"/>
<menuitem id="theo" label="Thesaurus" oncommand="doLookup('http://thesaurus.reference.com/search?q=')"/>
<menuitem id="go-url" label="Go to URL" oncommand="gotoURL()"/>

</menupopup>
</menu>


</popup>
</overlay>

[63] Submitted by: NectarineBlue on Sunday May 11th 2003

If anyone notices any errors in the code that I posted please let me know.. I also created them into search keys. thought the two could go hand and hand.

[64] Submitted by: Sam Greenfield on Monday May 12th 2003

It looks like your code works, but there are definitely some major issues. You have around 20 different functions that have almost identical code. This is very poor style. My recommendation is that you rewrite doLookup to take two arguments, "prefix" and "suffix" and modify the XUL accordingly. Your code will be more readable and easier to maintain.

--Sam

[65] Submitted by: complejo on Monday May 12th 2003

good site

[66] Submitted by: motilla on Monday May 12th 2003

hi from spain

[67] Submitted by: adwod on Monday May 12th 2003

corious

[68] Submitted by: Trung Nguyen on Friday May 23rd 2003

Please continue to improve on this excellent add-on to Mozilla. I've used over several months and loved it. It's very convenient. However, I can not find it the active project list. That is the reason I write this message. This add-on actually becomes a neccessity for web users like me using Mozilla instead of the Micro(Macro=big)s$ft I.E.

Thanks alot for your contribution.

Trung

[69] Submitted by: complejo on Friday May 23rd 2003

good site

[70] Submitted by: rtfm- on Sunday June 1st 2003

cool plug in. add your own search engine to the source code and voila. really nice time saver for us lazy types

[71] Submitted by: barbadillo on Tuesday June 24th 2003

nice web

[72] Submitted by: shilmar on Monday June 30th 2003

very nice work

[73] Submitted by: hank on Thursday July 3rd 2003

Feel like a total idiot: I made changes to both the .xul and .js files but Moz 1.3 seems not to take notice and still shows the original setup. I even moved the qlookup folder to the desktop (Windows). Obviously I'm missing something here with my first attempt at hacking.

[74] Submitted by: chee on Thursday July 10th 2003

Hi,

Can anyone please tell me how to make configure qlookup to open the search results in the following ways:

1. In Existing Tab.
2. In New Tab and switch focus to that tab.
3. In New Tab in the background.

I'm using TabBrowsing Extensions and somehow can't configure the qlookup behaviour to get results for each of the above scenarios.

Thanks!

[75] Submitted by: Herb on Friday July 25th 2003

Kevin mentioned above that it would be nice to have the selected text interpreted as a bookmark keyword. For example, selecting "bug 12345", and then the Goto URL menu item, would then use the bookmark with the "bug" keyword, and substitute the %s in the bookmark URL with 12345. This doesn't work with the current version of qlookup.js. So here's a fix. In the function doUrl(), Change this:

browser.addTab(urlToLoad, getReferrer(document))

to this:

browser.addTab(getShortcutOrURI(urlToLoad), getReferrer(document));

Another benefit of resolving bookmark keywords is that now you don't need to hardcode any URLs in your qlookup menu entries. Instead, you use the bookmark keyword, and if you later find a web application that you like better than the one you were using, you just change the bookmark URL.

For example, you have created a bookmark with a keyword for a google search. The bookmark URL is
"http://www.google.com/search?q=%s" and the keyword is "gg". This allows you to do a google search for qlookup by typing "gg qlookup" in the location bar.

So in qlookup.xul, instead of having

you can now simply use:

Now you can also easily use URLs with qlookup that require a string after the selected text. The bookmark URL can have the %s embedded anywhere in the URL. This would simplify complex menu setups as posted by NectarineBlue tremendously. No new js code is needed at all.

[76] Submitted by: Herb on Friday July 25th 2003

The qlookup.xul changes got stripped from my update above. Trying again. It should read:

So in qlookup.xul, instead of having

&lt;menuitem id="google_web" label="Web" oncommand="doLookup('http://www.google.com/search?q=')"/&gt;

you can now simply use:

&lt;menuitem id="google_web" label="Web" oncommand="doLookup('gg ')"/&gt;

Fun stuff!

[77] Submitted by: Herb on Friday July 25th 2003

What would be really cool is if it was possible to dynamically generate a popup menu with entries for all bookmarks with keywords. Could use the bookmark name as the menu item text. Anyone know if it is possible to dynamically generate popup menus?

[78] Submitted by: Diseño web on Friday August 1st 2003

Congratulations for your site

Hector gomis diseño web

[79] Submitted by: Herb on Friday August 1st 2003

Found a "similar" (rip-off???) Firebird extension at:
http://searchthis.mozdev.org/index.html

[80] Submitted by: james on Saturday August 2nd 2003

Hope it works.

[81] Submitted by: Directory on Saturday August 9th 2003
[82] Submitted by: Herb on Monday August 11th 2003

All of the features of qlookup (and SearchThis), and a lot more, are available in NeedleSearch. Go take a look at http://needlesearch.mozdev.org/
Very cool.

[83] Submitted by: Alfons on Sunday August 17th 2003

Congratulation - it works!

[84] Submitted by: Diseño web on Thursday August 21st 2003

Congratulations for your great job.

Héctor Gomis diseño web estudio

[85] Submitted by: cantabriaconfidencia on Friday August 29th 2003
[86] Submitted by: Michael Rabe on Sunday August 31st 2003

Viele Grüße aus Hamburg!

Raben-Design, Michael Rabe - Logo-Design und Grafik-Design, Illustration und Foto-Retusche, Karten-Design
http://www.raben-design.de/

[87] Submitted by: Alex on Sunday August 31st 2003

Nice project!

[88] Submitted by: Domenico on Thursday September 4th 2003

Great job

/comex
/hechoamano
Consultoria
Artesanias

[89] Submitted by: Carlos on Thursday September 4th 2003

Great work!!!


/host
Diseño web hosting

[90] Submitted by: esrws on Thursday September 4th 2003
[91] Submitted by: diseño web on Thursday September 4th 2003

Great work!


/
/

[92] Submitted by: David on Thursday September 4th 2003

Does it works to other languages than english?


-----

[94] Submitted by: Diseño web on Monday September 8th 2003

This site its very cool!

/

[95] Submitted by: tom on Monday September 8th 2003

/

[96] Submitted by: peter on Monday September 8th 2003

greetings from
/

[97] Submitted by: 3D on Monday September 8th 2003

greetings to your great team

3-D

[98] Submitted by: reinhard on Monday September 8th 2003

QLookup is a nice an helpful tool -

[99] Submitted by: Jose on Thursday September 11th 2003

Good luck!

[100] Submitted by: Mary on Thursday September 11th 2003

Very useful site

[101] Submitted by: Urbe on Saturday September 13th 2003

Hello, I just wanted to say you have a very informative site which really made me think, Thanks !

[102] Submitted by: Educoweb on Saturday September 13th 2003

I just surfed in and found your site, I really enjoyed the visit and hope to come back soon. Greetings..

[103] Submitted by: h&b on Sunday September 14th 2003
[104] Submitted by: Albert on Monday September 15th 2003

Thanks for the site, I really enjoyed it.

[105] Submitted by: Abel on Wednesday September 17th 2003

Congratulations for your site!

[106] Submitted by: al the best from BRD on Saturday September 20th 2003

versteigerung
Doppeldecker
greencard usa
kosmetik shop
sofort kredit
online shopping
dvd shop
kreditkarte
versicherungsvergleich
handy shop
partnervermittling
last minute

[111] Submitted by: Auktion Tipp on Saturday September 20th 2003
[113] Submitted by: normas ISO on Saturday September 20th 2003

Good Job!

[114] Submitted by: Eduardo on Saturday September 20th 2003

very well project

[115] Submitted by: Andreas on Sunday September 21st 2003
[117] Submitted by: Ulrich S. Kapp on Monday September 22nd 2003

Hope I'll get through all this spam!!

I have an important question about this context menue:
Will other googles (eg. google.de) or other directory services be supported by this feature?

Ulrich S. Kapp
BIGPiNG! OHG, Webdesign und Internetberatung / Web Design and Internet Consulting

kapp@bigping.de

[121] Submitted by: Florencia Sarasola on Thursday September 25th 2003

IF you need voluntaries, contact me.

[122] Submitted by: German Cars on Saturday September 27th 2003

Best regards


5 Dec New version: 0.6.3 available.
Valid 'Go to URL' criterion re-worked.
Menu items disabled if no-thing selected.
Example code for extending functionality added.

For questions or comments about qlookup, please send a message to the qlookup mailing list.
Copyright © 2000-2008. All rights reserved. Terms of Use & Privacy Policy.