便利な Google ブックマークレット10種類

gmarklet.jpg Google Blogoscoped [via Lifehacker] の記事で便利な Google ブックマークレットの一覧が紹介されていました。このうちいくつかは使ってましたが、この際ですので便利そうなものをまとめてツールバーに入れてしまいました。そんな10個のブックマークレットをご紹介。

ブックマークレットは一見普通のブックマークのように見えますが実はその場で Javascript 使って「今のページを Google Reader に追加」とか「このページの内容を翻訳」といった機能を呼び出すものです。

記事には10種類が紹介されていましたが、その中でも一番使いそうだなというものだけ選んでご紹介して、さらに別の場所で紹介されていたものを好みで選んでみました。

以下のリンクをツールバーにドラッグするだけでブックマークレットを導入することが可能ですが、RSS でこの記事を読んでいる方は、なかには Javascript を削除して表示する RSS リーダーもありますので、ページを実際に開いてからリンクをブックマークしてください。

  1. [Google Reader で開く](javascript:var%20f=false;var%20ls=document.getElementsByTagName(’link’);for(var%20i=0,l;l=ls[i];i++){var%20t=l.getAttribute(’type’);var%20r=l.getAttribute(‘rel’);if(t&&(t==‘application/rss+xml’||t==‘application/atom+xml’)&&r&&r==‘alternate’){var%20h= l.getAttribute(‘href’);if(h.indexOf(‘http’)!=0){var%20p=(h.indexOf(’/’)!=0)?’/’:location.pathname;h=‘http://’+location.hostname+p+h;}location=’ http://google.com/reader/preview/*/feed/’+h;f=true;break;}}if(!f)alert(‘Oops.%20Can't%20find%20a%20feed.’);): 開いた後で右上の方の Subscribe ボタンを押せば購読できます

  2. [英語から日本語へ翻訳](javascript:var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection &&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=’’){location.href=‘http://translate.google.com/translate_t?text='+t+'&hl=ja&langpair=en|ja&tbb=1&ie=’+e;}else{location.href=‘http://translate.google.com/translate?u='+escape(location.href)+'&hl=ja&langpair=en|ja&tbb=1&ie=’+e;};)

  3. [日本語から英語へ翻訳](javascript:var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection &&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=’’){location.href=‘http://translate.google.com/translate_t?text='+t+'&hl=ja&langpair=ja|en&tbb=1&ie=’+e;}else{location.href=‘http://translate.google.com/translate?u='+escape(location.href)+'&hl=ja&langpair=ja|en&tbb=1&ie=’+e;};)

  4. [このドメインを検索](javascript:(function(){ p=prompt(’%E6%A4%9C%E7%B4%A2%E3%83%AF%E3%83%BC%E3%83%89%E3%82%92%E5%85%A5%E5%8A%9B:’,’’); if(p){ document.location.href=‘http://www.google.com/search?q=site:'+document.location.href.split('/')[2]+' ‘+encodeURIComponent(p)} })();)

  5. [類似したページを検索](javascript:(function(){ document.location.href=‘http://www.google.com/search?q=related:'+escape(document.location.href) })();)

  6. [リンク元を検索](javascript:(function(){ document.location.href=‘http://www.google.com/search?q=link:'+escape(document.location.href) })();)

  7. [GMail で送信する](javascript:(function(){ document.location.href=‘http://mail.google.com/mail/?view=cm&fs=1&su='+escape(document.title)+'%20(link)&body='+escape(document.location.href) })();)

  8. [ページランクを表示: ](javascript:(function(){ var pg_popup = window.open(’’,‘window’,‘width=150,height=80’); pg_popup.document.write(’

    <a mce_thref='http://www.prchecker.info/' target='_blank'><img mce_tsrc='http://www.prchecker.info/’+document.location.href.split(’/’)[2]+’-pagerank-1.gif' alt='Checking Page Ranking' border='0' />

    <a mce_thref='javascript:window.close()'>Close’); })();)Google Bookmark に追加: 紹介元、bluedot.net, via Going my way

  9. Google Map で座標を取得: 紹介元、AUSGANG SOFT

とりあえず Mac OS X 版 Firefox 2 で動作を確認しています。

堀 E. 正岳(Masatake E. Hori)
2011年アルファブロガー・アワード受賞。ScanSnapアンバサダー。ブログLifehacking.jp管理人。著書に「ライフハック大全」「知的生活の設計」「リストの魔法」(KADOKAWA)など多数。理学博士。