MozillaZine

Open dictionary search in a pop-up

Discussion of general topics about Mozilla Firefox
pdrub
 
Posts: 42
Joined: March 24th, 2004, 3:58 pm

Post Posted May 7th, 2004, 8:54 am

OK, may be it is a stupid question, but I tried to find out how to do it and didn't find the answer on this forum:
while doing a dictionary search for a highlighted word from the contex menu, the search opens in a new tab. How to make it open in a pop-up window instead?
Thanks!

MonkeeSage

User avatar
 
Posts: 1011
Joined: December 20th, 2002, 8:15 pm

Post Posted May 7th, 2004, 9:31 am

AFAIK, there is no built-in dictionary search from the context menu, so I gather that you're using some extension that does it, is that correct?


Shelumi`El
Jordan

S.D.G
"[M]en are usually satisfied with bad argument only when their convictions rest on other grounds." --John Oman

pdrub
 
Posts: 42
Joined: March 24th, 2004, 3:58 pm

Post Posted May 7th, 2004, 10:08 am

Yes, let's say SearchThis. Although I also don't know how to do it with Dictionary Search either.

MonkeeSage

User avatar
 
Posts: 1011
Joined: December 20th, 2002, 8:15 pm

Post Posted May 7th, 2004, 10:38 am

OK, the reason I asked is because I think you'll have to hack the extension if it doesn't already have an option to do it.


Shelumi`El
Jordan

S.D.G
"[M]en are usually satisfied with bad argument only when their convictions rest on other grounds." --John Oman

frease

User avatar
 
Posts: 3981
Joined: September 16th, 2003, 1:17 pm

Post Posted May 7th, 2004, 10:53 am

pdrub wrote:OK, may be it is a stupid question, but I tried to find out how to do it and didn't find the answer on this forum:
while doing a dictionary search for a highlighted word from the contex menu, the search opens in a new tab. How to make it open in a pop-up window instead?
Thanks!


Why not try this bookmarklet which lets you open the highlighted word search in an iframe:

Code: Select all
javascript: function a( elm, obj ){for(x in obj)elm[x] = obj[x]}; if (!window.inp) { var elm = document.createElement('iframe'), b = document.body; q=window.getSelection(); if (q==0) q=prompt('Input searchword',''); a(elm,{frameBorder:0,src:%22http://dictionary.reference.com/search?r=1&q=%22 + q}); elm.setAttribute('id', q); elm.setAttribute('noresize', 'resize'); a(elm.style,{width:'100%',height:'200px',position:'fixed',left:'0px',top:'0px',borderBottom:'1px solid black; z-index:4;'}); inp = document.createElement('input'); inp.setAttribute('style', 'position: fixed; right: 19px; top: 0px; height:30px; width:30px; z-index:3; text-color:black; border: 1px black solid;'); inp.setAttribute('type', 'submit'); inp.setAttribute('id', q); inp.setAttribute('value', 'X'); document.body.insertBefore(inp,document.body.firstChild); b.appendChild(elm); inp.onclick = function(){ b.removeChild(inp); b.removeChild(elm); inp=0;}; } else { alert('A search window is already open, please close it to search again.'); } void(0);

pdrub
 
Posts: 42
Joined: March 24th, 2004, 3:58 pm

Post Posted May 7th, 2004, 12:15 pm

MonkeeSage: Never hacked an extension. I'll probably look into it, but I thought there might be an easier way (either some obscure pref in TBE, for example, or an extention that would do it...)

frease: Sorry, but what should I do this the bookmarlet?

mai9

User avatar
 
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona

Post Posted May 7th, 2004, 1:16 pm

pdrub, you bookmark it and give it a keyword.


if you want to test it copy it and paste it to the urlbar.

pdrub
 
Posts: 42
Joined: March 24th, 2004, 3:58 pm

Post Posted May 8th, 2004, 12:16 pm

Well, correct me if I am wrong: the bookmarklet works this way: I highlight the text and click on the bookmark. Now, this is nice, but I still wonder if there is a way to make the following: I highlight a word, ckick the right button, select "Dictionary search for <word>" and the result opens in a pop-up (or an iframe, for that matter)
Thanks for help

mai9

User avatar
 
Posts: 1619
Joined: January 15th, 2003, 3:41 pm
Location: Barcelona

Post Posted May 9th, 2004, 4:39 pm

maybe some search extension fits your needs:

http://extensionroom.mozdev.org/list.php/Firefox/search

pdrub
 
Posts: 42
Joined: March 24th, 2004, 3:58 pm

Post Posted May 10th, 2004, 9:38 pm

mai9 wrote:maybe some search extension fits your needs:

http://extensionroom.mozdev.org/list.php/Firefox/search
Thanks, but, nope, none will open the search in a pop-up. Guess I'll have to hack an extension for that, as MonkeeSage propesed. Started learning XUL :)

AnonEmoose
 
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Post Posted May 10th, 2004, 11:13 pm

try this new extension by Cusser.... http://forums.mozillazine.org/viewtopic.php?t=75294 i think it will work by subsituting the line in contextsearch.js from
Code: Select all
getBrowser().addTab(searchUrl);
to
Code: Select all
openTopWin(searchUrl);
i haven't tried it but it just might work

pdrub
 
Posts: 42
Joined: March 24th, 2004, 3:58 pm

Post Posted May 11th, 2004, 8:48 am

Thanks a lot, AnonEmoose. It opens the window not in a pop-up, but in the same window, but now I know where to look, so probably I will be able to figure out how to do that :) .

pdrub
 
Posts: 42
Joined: March 24th, 2004, 3:58 pm

Post Posted May 11th, 2004, 12:01 pm

Great, it works!! Just use window.open instead of openTopWin!
thanks, AnonEmoose

AnonEmoose
 
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Post Posted May 11th, 2004, 7:46 pm

<wink> <wink> that was gonna be my "next" suggestion.... LOL ;) ;) ....
truth be told, i thought u didn't want a new tab but i didn't realize u wanted it in a new window ... I think u can use
Code: Select all
openNewWindowWith(searchUrl)
also

kozaki

User avatar
 
Posts: 50
Joined: July 24th, 2004, 9:05 am
Location: UE

Post Posted September 12th, 2004, 10:35 am

AnonEmoose > Thanks

Nice tips, + this time Context Search extension worked on my Mozill-Firefox-0.9.3mdk.rpm version :o)
The last one i tried, it couldn't help but crash the browser whenever i tried to use it !o)
Firefox/-dev/Palemoon & ex-Opera fan - Arch Linux, Android, Windows phone - RAID-lvm Core i3, Atom systems
"Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, be4 the Web..." - Tim Berners-Lee, July 1996

Return to Firefox General


Who is online

Users browsing this forum: No registered users and 3 guests