Google Chrome: Add a Send Link Button to the Bookmarks Bar

Contributor Icon Contributed by shamanstears Date Icon September 8, 2008  
Tag Icon Tagged: Google

Most browsers provide you with a way to easily email a link to the page you are currently viewing. When clicked, your default email application will produce a new message with the link in the body and the page title in the Subject line and the To field left blank for you to address. This functionality is missing from Chrome, but can easily added by creating a button on the Bookmarks bar.


1. Open Chrome.

2. Right-click the Bookmarks bar and select Add Page.

3. In the Name textbox, input the word Send Link.

4. In the URL textbox, input the following:
javascript:location.href='mailto:?SUBJECT='+document.title+'&BODY='+escape(location.href);

5. Make sure that the Bookmarks bar folder is selected and click OK.

or just drag this link to your Bookmarks bar: Send Link.

Previous recipe | Next recipe |
 
  • Kipp
    This is awesome, thanks!!
  • Laurie
    Excuse me for bumping this to the top of the comments, but it is fairly important:

    Even though the original script is great it should be modified to:
    javascript:location.href='mailto:?SUBJECT='+escape(document.title)+'&BODY='+escape(location.href);

    The addition of the extra 'escape' function around the document.title ensures that the script works if the webpage's title contains a 'special' javascript character such as &.

    You can test this by trying the original script with the webpage http://b2evolution.net/index.php (which fails due to an & in the title). This modified script fixes the problem for this and probably many other webpages.
  • crispinr
    hi - how would I amend your (great) script so I can force the Send To to use GMail? Thanks!
  • I've noticed that people have been having mixed results with trying to do this. I would recommend using an application called ChromeMailer to easily set Gmail as the default for all mailto: links. It requires Microsoft .NET Framework 2.0.
  • DavidP
    Excellent! Thanks.
  • Asm
    Hi, first I apologize for my ignorance, I really do. I have followed the instructions as above. I thus have "send to" link in the bookmark folder . Here is the ignorant part: I click on it and nothing happens. No form pops up. I tried to highlight some text then click on send to, still nothing....I highlight the address bar and click on send to, nothing....
  • john
    Freaking amazing! Thanks much. Gotta believe Google will add this upon vrelease!1
  • John
    How easy was that ! Have been annoyed ever since first using Chrome that there was no way to send a link but with a few simple strokes problem solved. Thanks, Cheers, John.
  • John
    Maybe I wrote too soon, have tried several sites and when I try to send link I get the following message
    Error 300 (net::ERR_INVALID_URL): Unknown error.
    What to do now ?? John.
  • John
    Relax John, silly me got : and ; wrong. All OK now Thanks again sorry for my mistake, have deleted first try. John.
  • Jonna Mackin
    You left no way to comment and paste in the url once you are in the add page screen, so I had to type in the url for send link, which was a pain!
  • Jo
    Genius!
  • I use this functionality all the time. Excellent, thank you.

    Now how about those pesky mouse gestures, grrrr.
  • B alert
    lack of Send Link button had been a big inconvenience using Chrome.
    Big improvement now, thank you; ' may make Chrome my default browser
    if I can learn how to import bookmarks etc from Firefox rather than I.E..

    ('only open IE to install critical updates.)
  • CJV
    Dude you have just democratized javascript!
    Thanks,
    CJV
  • DavidL
    Nice work...however I would prefer to have this as a menu item, instead of having to toggle the Bookmarks Bar each time...any suggestions?
  • Hussein
    Works ..Thanks .
  • Joe
    Very Nice Thanks
  • ravi7640
    Great ! It works perfectly. Chrome team should make this feature official.
  • Ali
    the instructions above were just perfect and helped... now, i can send link as easy as it is in IE...
  • PK2009
    That's really cool. If you had a whole set of bookmarks in a folder, how would you send all the links together in one email and then choose the subject title? The code seems to work for single sites.

    Thanks,

    PK
  • Svet
    This works. But how do you send an actual page in an e-mail (not the link)?
  • mecheng
    How go I get gmail to be my default email program?
  • mecheng
    More to the poit how do I get the send link button to send a gmail message?
  • I have the french version of google chrome. What is the bookmarks bar. I have tried to right click on all bars I could find and all icons and nowhere did I find "Add Page" or a french equivalent which would require a name and an URL.
  • Sorry. I did find it . The name is completely different. It's called favorites manager. And it's a new favorite you want to create called "send link"
  • Don
    The link button worked great, after I installed Gmail notifier to get it open in gmail instead of Outlook.

    Thank you.

    P.S. Is it possible to have a script that also will copy any highlighted text and paste it into the email?
  • mecheng
    Don, that worked for me to, good suggestion.
  • Grunt101
    rockin' man... the bookmark link is well handy but useless if you don't use Outlook!
    this is a perfect fix! thanks so much
  • rksue
    Worked great. Thanks
  • David
    Thanks so much with the "Send Link" trick for Google Chrome - works very well.
  • Many many thanks :)

    excellent |!!
  • Speak for Many
    THANK YOU IMMENSELY!!!
  • Moshe Hackner
    Thank you very much for posting this.
  • David
    I just feet an irrepressible urge to join the already loud chorus saying: THANK YOU ... this has been my one main quarrel with Chrome (I ditched FF in favor of Chrome, just love it). I know other people talk about lack of RSS support but i'm like meh. This trick/tool/tip or whatever else you'd like to call it is just awesome. Thanks again... now i'm inspired to find a similarly concise solution to global warming :)
  • sumod
    Excellent, works perfectly thanks!
  • ajishgopan
    Thanks for this.

    But when I click on the "Send link" bookmark, the outlook window opens up alright with the subject line. But the body is blank.

    Any clues?

    ajishgopan
  • mabar207
    Same here... I use chrome mailer so when I click on a mailto link it opens up gmail in a new tab. I don't know if these guys are getting in the way of each other, but almost everything's fine with the script except that the body is blank. There is no link in the email... Any idea hoe to fix that?
  • Brilliant, thanks
  • IleneG
    This is so cool...and it worked first time for this non-geek person!
  • smt121
    works great
  • Tony
    Sweet!
  • Gar
    How would you know how to do that, that's amazing, thanks a bunch
  • Sharon
    It would be helpful if a print preview was provided
    for the Google Chrome: Add a Send Link Button
  • Anthony
    Thank you!!!!!!!!!!!
  • That worked the nuts, but how do you add a button on the Bookmarks Bar to simply open Outlook....Al
  • MFortGarry
    AWESOME... I would really like to use Google Chrome as my default browser, but the lack of this function always drove me back to IE or Firefox... how frustrating... and your option to just drag the link to the Bookmarks was incredibly simple...thanks
  • Laurie
    Almost gave up Chrome purely because this feature is missing so tried this and it seemed to work fine for most sites.

    But, when I wanted to use it seriously for the first time it does not put the link in the body.

    The site that is failing is http://b2evolution.net/index.php - can anyone tell me why the script doesn't work with this site?
  • Mike
    I don't know anything about javascript, but I found the link is included int he email body if I delete the subject line part.
  • Laurie
    Thanks for that - I have just started on javascript in the last week and your post made me look at the title of the failing website http://b2evolution.net/index.php which contains an '&' (ampersand) character. This causes the rest of this script to fail as '&' is a special character in javascript and would need to be converted to \& for the script to work properly.

    This implies that any website containing one of javascript's special characters (http://www.w3schools.com/jS/js_special_characte...) will probably cause this script to fail.

    Any more experienced (then myself) javascript programmers out there who know how to fix this?
  • Laurie
    Fixed it - looking at the original script I saw the 'escape' function being applied to the link. If the escape function is also applied to the title the script then seems to works perfectly.

    So if the script is modified to:
    javascript:location.href='mailto:?SUBJECT='+escape(document.title)+'&BODY='+escape(location.href);
    it should work on all websites.

    Thanks again Mike for getting me to look in the right place.
  • Jeff Frane
    Couldn't get it work with Gmail despite repeated tries, even with Gmail Notifier. I finally unclicked the option to use Gmail for mailto: requests, it launched Outlook Express, and when I reclicked the box in Notifier, it started working with Gmail.
  • thgolding
    Neat. Thanks, Thomas
  • erbarker
    Great tip
    Thanks
    ERB
  • lavallie
    Totally cool fix. Thanks much for this. Leads me to believe there could be all types of 3rd party buttons that could be added.
  • srcgchs
    Is there a way to alter the send link information so that the GMail service is opened rather than Windows Live Mail?
  • xsaminz
    I do this:

    javascript:location.href='https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&su='+escape(document.title)+'&body='+escape(location.href);

    I dug around in Firefox to get the uri correct and then inserted that instead of the mailto:
  • Jim
    Worked for me. Many thanks
blog comments powered by Disqus