Welcome guest, is this your first visit? Create Account now to join.
Results 1 to 7 of 7

This is a discussion on YouSearch Bookmarklet! within the Chrome Plugins section, part of the Google Chrome category: Hi, after a couple of half nights of loss of sleep I've done the bookmarklet YouSearch (no, it's not just ...


  1. #1
    Gianluca Ferrario is offline 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!

  2. #2
    devilslackey is offline Moderator
    Join Date
    May 2009
    Location
    Orange County
    Posts
    330

    Default

    This sounds like Cleeki, in bookmarklet form.

  3. #3
    Gianluca Ferrario is offline 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.

  4. #4
    pumpman's Avatar
    pumpman is offline Senior Member
    Join Date
    May 2009
    Location
    Australia
    Posts
    155

    Default

    This is a pretty handy bookmarklet, thanx

  5. #5
    Kyrax is offline 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.

  6. #6
    devilslackey is offline 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.

  7. #7
    Jesdisciple is offline 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 06:16 PM.

Similar Threads

  1. Need a bookmarklet ? Ask !
    By Kyrax in forum Chrome Plugins
    Replies: 32
    Last Post: 03-12-2011, 02:41 PM
  2. Google Translate Selected to Any Language - Bookmarklet
    By vietnam in forum Chrome Tips & Tricks
    Replies: 4
    Last Post: 12-10-2010, 11:23 AM
  3. Wiki-it! Bookmarklet
    By Kyrax in forum Chrome Plugins
    Replies: 8
    Last Post: 11-15-2009, 10:47 PM
  4. Bookmarklet for PageRank
    By woz2 in forum Chrome Plugins
    Replies: 6
    Last Post: 04-15-2009, 01:35 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •