Skip to content

Instantly share code, notes, and snippets.

@mayosuke
Created August 13, 2012 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayosuke/3336836 to your computer and use it in GitHub Desktop.
Save mayosuke/3336836 to your computer and use it in GitHub Desktop.
本文欄にWebサイトのタイトル、URLをセットしてGMail作成画面を起動するブックマークレット。
javascript:(function(){
d = document;
w = window;
if (d.selection) {
s = d.selection.createRange().text;
} else if (w.getSelection) {
s = w.getSelection();
} else if (d.getSelection) {
s = d.getSelection();
};
e = encodeURIComponent;
u = 'https://mail.google.com/mail/?view=cm&fs=1&tf=1&cc=&bcc=&to='+e('to@address')+'&body='+e(d.title)+e('\n')+e(d.location)+e('\n\n')+e(s);
w.open(u, 'addwindow', 'status=no,toolbar=no,width=575,height=545,resizable=yes');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment