Gmailするブックマークレット/楽

ワンクリックでGmail送信ウィンドウを呼び出すブックマークレット(Bookmarklet)のご紹介。
しかも、任意のあて先や任意の件名や本文を記入した状態で。
基本形。
javascript:(function(){m='http://mail.google.com/mail/?view=cm&fs=1&tf=1&su='+encodeURIComponent(document.title)+'&to='+encodeURIComponent('someone@example.com')+'&body='+encodeURIComponent(document.location);w=window.open(m,'addwindow','status=no,toolbar=no,width=575,height=545,resizable=yes');setTimeout(function(){w.focus();},%20250);})();
現在、閲覧中のページのタイトルをメール件名にして、本文にページURLを記入する。
あて先は、任意に設定しておく(上の場合は someone@example.com)。

    • -

ページのテキストを選択していると、そのテキストを本文に追加するタイプ。
javascript:(function(){x=document;y=window;if(x.selection){Q=x.selection.createRange().text;}else if(y.getSelection){Q=y.getSelection();}else if(x.getSelection){Q=x.getSelection();};m='https://mail.google.com/mail/?view=cm&fs=1&tf=1&cc=&bcc=&to='+encodeURIComponent('someone@example.com')+'&su='+encodeURIComponent(x.title)+'&body='+encodeURIComponent(x.location)+encodeURIComponent('\n\n')+encodeURIComponent(Q);y.open(m,'addwindow','status=no,toolbar=no,width=575,height=545,resizable=yes');})();
メモ代わりにGmailを使えてすげー便利です。