Go Back   Google Chrome Forums > Google Chrome > Chrome Plugins


http://chromeplugins.org/frwrdicon.jpg
Top Tip : Click here to Boost Your PC & Chrome Browsing Speed
Reply
 
Thread Tools Display Modes
  #1  
Old 05-21-2009, 09:25 PM
Junior Member
 
Join Date: Apr 2009
Location: Madrid
Posts: 15
Cool YouSearch Bookmarklet!

Hi,
after a couple of half nights of loss of sleep I've done the bookmarklet YouSearch (no, it's not just for YouTube...).
This bookmarklet is a wannabe swiss knife for searching selected text. You select some text with the mouse and press the bookmarklet. A new window will open in which you can find an (extremely ugly) interface that will show you:

1) A textarea with the text you selected that you can eventually modify
2) A dropdown list with the engine to which you want to submit your query (Google is default)
3) the button to launch the query.

Ok, just select one option in the dropdown list, press the button "Search" and... YouSearch!

That's the code:
Code:
javascript:
function writeJS()
{ 
var str=''; 
str+='
<body> 
<FORM name="intro"> 
<table align=\'center\' height=\'10%\' valign=\'center\'> 
<tr><td> <p> You selected: <\/p> <\/td><\/tr>
<tr><td> 
<TEXTAREA NAME="SelectedText" ROWS="3" COLS="20"><\/TEXTAREA> 
<\/td><\/tr> 
<tr><td> <p> Search in... <\/p> <\/td><\/tr> 
<tr><td> 
<SELECT NAME="Search_list"> 
<Option value="http://www.google.com/search?hl=en&q=" >Google<\/option> 
<Option value="http://www.amazon.com/s/ref=nb_ss_gw?url=search-alias%3Daps&field-keywords=" >Amazon<\/option> 
<Option value="http://dictionary.reference.com/browse/" >Dictionary Reference<\/option> 
<Option value="http://search.ebay.com/search/search.dll?satitle=" >eBay<\/option> 
<Option value="http://maps.google.com/maps?q=" >Google Maps<\/option> 
<Option value="http://en.wikipedia.org/w/index.php?title=Special:Search&search=" >Wikipedia<\/option> 
<Option value="http://www79.wolframalpha.com/input/?i=" >WolframAlpha<\/option> 
<Option value="http://www.youtube.com/results?search_type=&search_query=" >YouTube<\/option> 
<\/SELECT> 
<\/td><\/tr> 
<tr><td> 
<INPUT TYPE=BUTTON OnClick="var aaa = document.intro.Search_list.options[document.intro.Search_list.selectedIndex].value; 
aaa += document.intro.SelectedText.value; 
window.location.href=aaa;" VALUE="Search"> 
<\/td><\/tr> 
<\/table> 
<\/form> 
<\/body>'; 
return str;
} 
var high=document.getSelection(); 
ow=location.href; 
if(high!='')
{ 
var res=window.open(''); 
res.focus(); 
pop=writeJS(); 
res.document.write(pop); 
res.document.intro.SelectedText.value += high; 
ow= void(null);
}
Note that you can quite easily personalize your searches. These are added to the dropdown list as options like:
<Option value="url" >Name<\/option>
So to put your own you just need to create a new option with the proper url and name. I added to the dropdown list Google, Amazon, Dictionary Reference, eBay, Google Maps, Wikipedia, WolframAlpha and YouTube.

Which Options are a must for you? Please if you find one that can be very useful post it for everyone!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 05-22-2009, 01:14 AM
Moderator
 
Join Date: May 2009
Location: Orange County
Posts: 330
Default

This sounds like Cleeki, in bookmarklet form.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 05-22-2009, 09:03 AM
Junior Member
 
Join Date: Apr 2009
Location: Madrid
Posts: 15
Default Yes, and I didn't copied

Yes, Cleeki gave me the idea... but I didn't copied! I've done everything on my own!
I think extensions like that are super useful and I like them a lot, I used them abundantly in Firefox, but I'm a super fan of bookmarklets, so I decided to write YouSearch because I think (and this is my personal idea, some will agree, some not) that a bookmarklet can have its advantages.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 05-22-2009, 11:20 AM
pumpman's Avatar
Senior Member
 
Join Date: May 2009
Location: Australia
Posts: 151
Send a message via MSN to pumpman
Default

This is a pretty handy bookmarklet, thanx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 05-22-2009, 12:20 PM
Senior Member
 
Join Date: Apr 2009
Location: Qc, Canada
Posts: 495
Default

Bookmarklets certainly have their advantage.

Cleeki is a pretty large extension... and all it's javascript is injected in every page / iframe you visit.

Bookmarklets don't have this issue.
__________________

ChromeGestures
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 05-22-2009, 01:27 PM
Moderator
 
Join Date: May 2009
Location: Orange County
Posts: 330
Default

I wasn't saying one was better. I just said it was similar in function.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 01-04-2010, 12:44 PM
Junior Member
 
Join Date: Jan 2010
Posts: 4
Default

Thanks for this... Cleeki isn't available for Linux, and I missed my search bar from Fx.

EDIT: I improved it by simply opening the form if no text was selected (moved the if-statement's beginning). Before, the page would display the source URL instead of a form.
Code:
javascript:function writeJS(){ var str=''; str+='<body> <FORM name="intro"> <table align=\'center\' height=\'10%\' valign=\'center\'> <tr><td> <p> You selected: <\/p> <\/td><\/tr><tr><td> <TEXTAREA NAME="SelectedText" ROWS="3" COLS="20"><\/TEXTAREA> <\/td><\/tr> <tr><td> <p> Search in... <\/p> <\/td><\/tr> <tr><td> <SELECT NAME="Search_list"> <Option value="http://www.google.com/search?hl=en&q=" >Google<\/option> <Option value="http://www.amazon.com/s/ref=nb_ss_gw?url=search-alias%3Daps&field-keywords=" >Amazon<\/option> <Option value="http://dictionary.reference.com/browse/" >Dictionary Reference<\/option> <Option value="http://search.ebay.com/search/search.dll?satitle=" >eBay<\/option> <Option value="http://maps.google.com/maps?q=" >Google Maps<\/option> <Option value="http://en.wikipedia.org/w/index.php?title=Special:Search&search=" >Wikipedia<\/option> <Option value="http://www79.wolframalpha.com/input/?i=" >WolframAlpha<\/option> <Option value="http://www.youtube.com/results?search_type=&search_query=" >YouTube<\/option> <\/SELECT> <\/td><\/tr> <tr><td> <INPUT TYPE=BUTTON OnClick="var aaa = document.intro.Search_list.options[document.intro.Search_list.selectedIndex].value; aaa += document.intro.SelectedText.value; window.location.href=aaa;" VALUE="Search"> <\/td><\/tr> <\/table> <\/form> <\/body>'; return str;} var high=document.getSelection(); ow=location.href; var res=window.open(''); res.focus(); pop=writeJS(); res.document.write(pop); if(high!=''){ res.document.intro.SelectedText.value += high; }

Last edited by Jesdisciple; 01-04-2010 at 05:16 PM..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
bookmarklet search

Thread Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a bookmarklet ? Ask ! Kyrax Chrome Plugins 27 02-08-2010 04:04 AM
Wiki-it! Bookmarklet Kyrax Chrome Plugins 8 11-15-2009 09:47 PM
Bookmarklet for PageRank woz2 Chrome Plugins 6 04-15-2009 01:35 AM
Google Translate Selected to Any Language - Bookmarklet vietnam Chrome Tips & Tricks 3 04-10-2009 02:06 PM




Chrome Central - Chrome Talk - Chrome Tips and Tricks - Chrome Plugins - Chrome Themes - Chrome Tools - Bugs and Vulnerabilities - Chrome Tech - General Chat


All times are GMT. The time now is 12:24 AM.


Powered by vBulletin® Version 3.7.4 PL1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Google Chrome and Google™ is a Trademark of Google Inc
This site chromeplugins.org is not affiliated with or sponsored by Google Inc.
Thanks: Taree SEO Forum and John