ブックマークレット紹介

こういうBookmarkletよくできてるなあと思う。かっこいいし。
http://www.westciv.com/xray/


ついでにおいらがFirefoxのPersonal Toolbar Folderに登録してるBookmarklet紹介します。
半分くらいは自分で作ったやつだけど、あと半分はどっかのサイトからもらってきたものです。
以下よく使う順です。
はてなダイアリーって javascript: から始まるリンク不可なんすよね・・


Google検索結果を英語版に切り替え

javascript:var url=location.href;if(url.indexOf('hl=')!=-1){url=url.replace(/hl=../,'hl=en');}else{if(url.indexOf('?')==-1){url+='?';}url+='&hl=en';}location.href=url;

Google検索結果を日本語版に切り替え

javascript:var url=location.href;if(url.indexOf('hl=')!=-1){url=url.replace(/hl=../,'hl=ja');}else{if(url.indexOf('?')==-1){url+='?';}url+='&hl=ja';}location.href=url;

今見てるページをGoogle Readerに登録(Google Readerの設定ページかなんかにあった)

javascript:var%20b=document.body;if(b&&!document.xmlVersion){void(z=document.createElement('script'));void(z.src='http://www.google.com/reader/ui/subscribe-bookmarklet.js');void(b.appendChild(z));}else{location='http://www.google.com/reader/view/feed/'+encodeURIComponent(location.href)}

今見てるページのGoogle Cacheを表示

javascript:location.href='http://www.google.com/search?hl=en&q=cache:'+location.href.replace('http://','');

今見てるページのInternet Archiveを表示(Wayback Machine

javascript:location.href='http://web.archive.org/web/*/'+location.href;

URLEncodeするプロンプト(引用元

javascript:void(prompt('%',(function(s){return s.replace(/./g,function(m){return '%'+m.charCodeAt(0).toString(16)})})(prompt('C', ''))))

URLDecodeするプロンプト(引用元

javascript:void(prompt('C',decodeURIComponent(prompt('%', ''))))

今見てるサイトのBugMeNot(フリーのユーザー名/パスワードを表示)

javascript:(function(){window.open('http://www.bugmenot.com/view/'+location.href.replace('http://',''));})();

今見てるサイトのCSSを小窓で表示・その場で編集(FireBugで十分な気も。。引用元忘れた)

javascript:(function(){function init(){var newline=unescape(%22%%22+%220A%22),importCount=0,L=[];dead=false;oldCSS=null;x=opener;ta=document.f.ta;ta.select();if(x.editStyles){ta.value=x.editStyles.innerHTML;update();return;}ta.value=%22/* Type CSS rules here and they will be applied%22+newline+%22to pages from '%22+location.host+%22'%22+newline+%22immediately as long as you keep this window open. */%22+newline+newline;function add(s){if(!s.disabled){var y={sheet:s,readable:true,label:%22Imported%22,inline:false,shorturl:%22%22,fulltext:%22%22};try{for(var k=0,m;m=s.cssRules[k];++k)if(m.type==3)add(m.styleSheet);}catch(er){y.readable=false;}L.push(y);if(s.ownerNode){y.label=s.ownerNode.tagName.toUpperCase()+%22-tag%22;if(!s.ownerNode.getAttribute(%22src%22)&&!s.ownerNode.href)y.inline=true;}if(y.inline){y.label=%22Inline %22+y.label;y.fulltext=fix(s.ownerNode.innerHTML);}else if(s.href.substr(0,13)==%22data:text/css%22){y.shorturl=%22 contained in a data: URL%22;y.fulltext=fix(unescape(s.href.slice(14)));}else{++importCount;y.importtext=%22@import \%22%22+s.href+%22\%22;%22;y.shorturl=%22 %22+s.href.split('/').reverse()[0];if(!y.readable){y.fulltext=%22/* Out-of-domain; imported above. */%22;}else if(s.href.substr(0,5)!=%22http:%22){y.fulltext=%22/* Non-http; imported above. */%22;}else{var loadingText=%22/* Loading (%22+(L.length-1)+%22) */%22;y.fulltext=loadingText;var p=new XMLHttpRequest();p.onload=function(e){ta.value=ta.value.replace(y.importtext+newline,%22%22);y.fulltext=p.responseText;ta.value=ta.value.replace(loadingText,fix(y.fulltext));ta.value=ta.value.replace(firstNote+newline,%22%22);};p.open(%22GET%22,s.href);p.send(null);}}}}function fix(s){while((s[0]==newline)&&s.length>1)s=s.slice(1);while((s[s.length-1]==newline)&&s.length>1)s=s.substr(0,s.length-1);s=s.replace(/@import.*;/ig,function(){return %22/* %22+RegExp.lastMatch+%22 */%22;});return s;}for(var i=0,ss;ss=x.document.styleSheets[i];++i)add(ss);var imports=%22%22,main=%22%22;var firstNote=%22/**** Style sheets whose contents could be loaded were ****/%22+newline+%22/**** imported instead.  Rule order may be incorrect   ****/%22+newline+%22/**** as a result. ****/%22+newline;if(importCount){ta.value+=firstNote;}for(var i=0;ss=L[i];++i){if(ss.importtext){imports+=ss.importtext+newline;}main+=%22/**** %22+ss.label+%22 style sheet%22+ss.shorturl+%22 ****/%22+newline;main+=newline;main+=ss.fulltext;main+=newline;main+=newline;main+=newline;}ta.value+=imports+newline+main;update();}function update(){try{if(!x||x.closed){ta.style.backgroundColor=%22#ddd%22;return;}x.editStyles;}catch(er){ta.style.backgroundColor=%22#fdc%22;setTimeout(update,150);dead=true;return;}if(dead){dead=false;ta.style.backgroundColor=%22%22;oldCSS=null;}if(!x.editStyles){var newSS;newSS=x.document.createElement(%22style%22);newSS.type=%22text/css%22;x.document.getElementsByTagName(%22head%22)[0].appendChild(newSS);x.editStyles=newSS;oldCSS=null;for(var i=0,ss;ss=x.document.styleSheets[i];++i)ss.disabled=true;}if(oldCSS!=ta.value){oldCSS=ta.value;x.editStyles.innerHTML=ta.value;}setTimeout(update,150);}y=open('','','resizable,scrollbars=yes,width=550,height=520');y.document.write('<title>Edit Styles</title><style>.ec { width: 100%; height: 100%; border: none; margin: 0px; padding: 0px; }</style><body class=%22ec%22><form name=%22f%22 style=%22margin: 0px;%22 class=%22ec%22><textarea name=%22ta%22 wrap=%22soft%22 style=%22margin: 0px; border: 0px; width:100%; height:100%;%22 class=%22ec%22></textarea><script>'+update+init+'init();<'+'/script>');y.document.close();})()

今見てるサイトを解析(WebSiteOptimization.com)

javascript:void(location.href='http://www.websiteoptimization.com/cgi-bin/wso/wso.pl?url='+location.href)

選択中のテキストをgoo辞書全体検索(引用元

javascript:if (document.selection){selTxt=document.selection.createRange().text;}else if (document.getSelection){selTxt=document.getSelection();}if(!selTxt){selTxt='';}selTxt=unescape(selTxt);location.href='http://dictionary.goo.ne.jp/search.php?MT='+selTxt;

選択中のテキストを英辞郎で検索(引用元

javascript:var d=document;var tx=d.selection?d.selection.createRange().text:d.getSelection();location.href='http://www2.alc.co.jp/ejr/index.php?word_in='+tx+'&word_in2=reedeirrf&word_in3=zJPa7DCxJ15687987t';


あーまた間違えてはてなスター押しちったよ・・orz
[2007年10月14日追記] スター消しましたw