日記
マウスでドラッグした部分をTwitterに引用するブックマークレット - 頭ん中Edit

マウスでドラッグした部分をTwitterに引用するブックマークレット - 頭ん中.

のbookmarkletをベースに、最終的には、

javascript:(function(){var d=document;var s='';if(d.selection)s=d.selection.createRange().text;else{if(d.getSelection)s=d.getSelection();else{if(window.getSelection)s=window.getSelection();}}var t=d.title;var h=location.href;window.open('http://twitter.com/home?status='+encodeURIComponent(h+'%20"'+s+'" %C2%BB '+t), null)})();
といった感じにした。Firefoxだとbookmarkを編集するときに半角スペースとかが自動的に%20に展開されてしまうんだっけ? なんかその辺で無駄に悩まされた。

Published At2010-05-11 08:35Updated At2010-05-11 08:35