Skip to content

Instantly share code, notes, and snippets.

@dsaiztc
Forked from rondevera/gmail_bookmarklet.js
Created June 13, 2022 11:48
Show Gist options
  • Select an option

  • Save dsaiztc/29e4c7e9e8e95558a12e43f05a251ff3 to your computer and use it in GitHub Desktop.

Select an option

Save dsaiztc/29e4c7e9e8e95558a12e43f05a251ff3 to your computer and use it in GitHub Desktop.

Revisions

  1. @rondevera rondevera revised this gist Aug 15, 2010. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions gmail_bookmarklet.js
    Original file line number Diff line number Diff line change
    @@ -6,19 +6,19 @@ For quickly e-mailing the current page's URL (and the selected text, if any)
    via Gmail.
    Usage:
    - Create a new item in your bookmark bar with "Gmail" (or just "Gm") as the
    name, and the code below as the location.
    - Create a new item in your bookmark bar with the name "Gmail" (or just "Gm",
    or your favorite Unicode character), and the code below as the location.
    - Activate it (by click or keyboard shortcut), and a small Compose window
    opens with the page's title and URL, and a couple of line breaks for you to
    opens with the page's title, URL, and a couple of line breaks for you to
    add a note. If you selected any text, it'll automatically be added with
    quotation marks.
    - Tested by daily use in Safari, but not perfect. Might be too long
    - Tested by daily use in Safari and Firefox. Might be too long
    for less capable browsers (you know which one -- oh snap!).
    Credit:
    - Adapted from somewhere, though I can't remember the source. Please let me
    know if you do!
    - Adapted from the GmailThis! bookmarklet:
    http://contrapants.org/blog/2005/07/gmailthis.html
    - MIT license
    */

    javascript:(function(){popw='';Q='';x=document;y=window;if(x.selection)%20{Q=x.selection.createRange().text;}%20else%20if%20(y.getSelection)%20{Q=y.getSelection();}%20else%20if%20(x.getSelection)%20{Q=x.getSelection();}popw%20=%20y.open('https://mail.google.com/mail?ui=2&view=cm&tf=0&to=&su='%20+%20escape(document.title.replace(/^\s+|\s+$/g,''))%20+%20'&body='%20+%20escape(location.href)+%20escape('\n\n'+(Q&&Q!=''?'"'+Q+'"':''))%20,'gmailForm','scrollbars=yes,width=500,height=400,top=50,left=50,status=no,resizable=yes');if%20(!document.all)%20T%20=%20setTimeout(function(){popw.focus()},50);void(0);})();
    javascript:(function(){popw='';Q='';x=document;y=window;if(x.selection){Q=x.selection.createRange().text;}else%20if(y.getSelection){Q=y.getSelection();}else%20if(x.getSelection){Q=x.getSelection();}popw=y.open('https://mail.google.com/mail?ui=2&view=cm&tf=0&to=&su='+escape(document.title.replace(/^\s+|\s+$/g,''))+'&body='+escape(location.href)+escape('\n\n'+(Q&&Q!=''?'"'+Q+'"':'')),'gmailForm','scrollbars=yes,width=500,height=400,top=50,left=50,status=no,resizable=yes');if(!document.all)T=setTimeout(function(){popw.focus()},50);void(0);})();
  2. @rondevera rondevera revised this gist Jun 26, 2009. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gmail_bookmarklet.js
    Original file line number Diff line number Diff line change
    @@ -21,4 +21,4 @@ Credit:
    - MIT license
    */

    javascript:(function(){popw='';Q='';x=document;y=window;if(x.selection)%20{Q=x.selection.createRange().text;}%20else%20if%20(y.getSelection)%20{Q=y.getSelection();}%20else%20if%20(x.getSelection)%20{Q=x.getSelection();}popw%20=%20y.open('https://mail.google.com/mail?ui=2&view=cm&tf=0&to=&su='%20+%20escape(document.title.replace(/^\s+|\s+$/g,''))%20+%20'&body='%20+%20escape(location.href)+%20escape('\n\n'+(Q&&Q!=''?'"'+Q+'"':''))%20,'gmailForm','scrollbars=yes,width=500,height=400,top=50,left=50,status=no,resizable=yes');if%20(!document.all)%20T%20=%20setTimeout('popw.focus()',50);void(0);})();
    javascript:(function(){popw='';Q='';x=document;y=window;if(x.selection)%20{Q=x.selection.createRange().text;}%20else%20if%20(y.getSelection)%20{Q=y.getSelection();}%20else%20if%20(x.getSelection)%20{Q=x.getSelection();}popw%20=%20y.open('https://mail.google.com/mail?ui=2&view=cm&tf=0&to=&su='%20+%20escape(document.title.replace(/^\s+|\s+$/g,''))%20+%20'&body='%20+%20escape(location.href)+%20escape('\n\n'+(Q&&Q!=''?'"'+Q+'"':''))%20,'gmailForm','scrollbars=yes,width=500,height=400,top=50,left=50,status=no,resizable=yes');if%20(!document.all)%20T%20=%20setTimeout(function(){popw.focus()},50);void(0);})();
  3. @rondevera rondevera renamed this gist Jun 26, 2009. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. @rondevera rondevera created this gist Jun 26, 2009.
    24 changes: 24 additions & 0 deletions Gmail bookmarklet
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    /*
    Gmail bookmarklet
    rondevera.com

    For quickly e-mailing the current page's URL (and the selected text, if any)
    via Gmail.

    Usage:
    - Create a new item in your bookmark bar with "Gmail" (or just "Gm") as the
    name, and the code below as the location.
    - Activate it (by click or keyboard shortcut), and a small Compose window
    opens with the page's title and URL, and a couple of line breaks for you to
    add a note. If you selected any text, it'll automatically be added with
    quotation marks.
    - Tested by daily use in Safari, but not perfect. Might be too long
    for less capable browsers (you know which one -- oh snap!).

    Credit:
    - Adapted from somewhere, though I can't remember the source. Please let me
    know if you do!
    - MIT license
    */

    javascript:(function(){popw='';Q='';x=document;y=window;if(x.selection)%20{Q=x.selection.createRange().text;}%20else%20if%20(y.getSelection)%20{Q=y.getSelection();}%20else%20if%20(x.getSelection)%20{Q=x.getSelection();}popw%20=%20y.open('https://mail.google.com/mail?ui=2&view=cm&tf=0&to=&su='%20+%20escape(document.title.replace(/^\s+|\s+$/g,''))%20+%20'&body='%20+%20escape(location.href)+%20escape('\n\n'+(Q&&Q!=''?'"'+Q+'"':''))%20,'gmailForm','scrollbars=yes,width=500,height=400,top=50,left=50,status=no,resizable=yes');if%20(!document.all)%20T%20=%20setTimeout('popw.focus()',50);void(0);})();