Keijir Blog

やっぱハワイ行きたいよね

追加すると便利なボタンをいろいろ StatusBar に追加

久しぶりです。


Starボタンをステータスバーに移動 - keijir blog
Read It Later ボタンを ステータスバーに移動する - keijir blog


の記事で紹介した通り Firefox で Vimperator を使用しています。


そこで!


http://www.hatena.ne.jp/tool/bookmarklet
http://www.amazon.co.jp/wishlist/universal/ref=wl_eywl_uwl
http://booklog.jp/bookmarklet


の3つの Bookmarklet を StatusBar に表示する方法!を紹介します。

こうなります!

はてなブックマークに追加ボタンと
アマゾンの欲しいものリストに追加するボタンと
Booklogに追加するボタンが増えます!


以下 .vimperatorrc

" Hatena Bookmarklet Button
:javascript << EOF
(function(){
    const icon = "data:image/png;base64,"
    +"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA"
    +"hklEQVQ4EWNgoBAwgvS3Lv31n1Rzzl55y7CuXZKRBaYRJEAKuPHsEVg5EymasKmFuwBZcm2bBDIX"
    +"zA6ueoEhBhLA6wKQJphGbIYSNACrlWiCWL0AU4PLVpg8iCbKC/i8gdcAZJtwsSk2gKQwgHkF2TVY"
    +"DcCmEFkTMps6XgDlA1jaRjadLmwAUo0lo6WCVh0AAAAASUVORK5CYII="

    var bookmarklet = "javascript:(function(){var d=(new Date);var s=document.createElement('script');"s.charset='UTF-8';s.src='http://b.hatena.ne.jp/js/Hatena/Bookmark/let.js?'+d.getFullYear()+d.getMonth()+d.getDate();(document.getElementsByTagName('head')[0]||document.body).appendChild(s);})();";

    var listener = function(){
        liberator.open(bookmarklet);
    }
    var StatusBarPanel = document.createElement('statusbarpanel');
    StatusBarPanel.setAttribute('id','hatena-button-clone');
    StatusBarPanel.setAttribute('class','statusbarpanel-iconic');
    StatusBarPanel.setAttribute('src',icon);
    StatusBarPanel.addEventListener('click',listener,true);
    document.getElementById('status-bar').insertBefore(StatusBarPanel,
        document.getElementById('security-button'));
})();
EOF

" Amazon Bookmarklet Button
:javascript << EOF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+"12VLFrOZVWLpdtiZ0x1uHKE5QvfEp0plk/qv8RGw/bBS+fmsUtl+ThrWgZf6b8C8/UXAeIuJAAAA"
+"CXBIWXMAAAsTAAALEwEAmpwYAAACDElEQVQoFV1Rz4sSURx/b2ZWW1HWgtkcs1p2DxEsCoZ4KJNk"
+"K3AOee3o37CBR/0DvMgevHkS2ZDNQOqaeTJYooNESDpYglkkzW5as715r+/zmcz2Dm8+3+/7fObz"
+"/YEZY+j8sW3bsizIeTye8y88UpwpQkij0Wg2mx/7/QtudzgczmazkUgEfooxXjIhWJ1SqeTUC2wY"
+"BhAopYKG4AM1wN3r9QSjWCyenJ7W63UR1mo1p4CXJOxUVW2329PpNJVK+bzeaDQaCoVGo5FpmkIp"
+"bkkIwNHv9ycSCU3TyuVyOp1OJpOKwn8H/v8LwFGSJOi4UCjE4/FcLhcIBKBdWZad1CVe9dBqtUSq"
+"UqlAcjwegxtkwJBzKO8TzrIkeOh2u0IQi8UAwAxAA0DsBCPHWG1CQFqtVoUgn893Oh1oHUItGNzc"
+"VI1BHwiCthgrt2KfPw13draFBu69vfv7+08AZDKZyfcfQFgsgmIGxc2+Ie9lsBwOhy9fNOezWUAL"
+"6roOyz46epbW9YvuX5Zx7Lp6C2+EMEjJ4BX9+kG++UjeCK4cHMA+e3fIJm/lrYfKjQdcAG/24PXZ"
+"8QFbvyJfvydf2kIuF4K0NSeT93TUWrt2F/tURYsin7YUgIbNp3+6z0nvKfv5BiGTT0UJS+rttd3H"
+"yvYdhChCfC3/BNRG0mJNjNCTL+y3iSUFQ2PrfkdtHP4FLeYvvy6EmmoAAAAASUVORK5CYII="

    var bookmarklet = "javascript:(function(){var w=window,l=w.location,d=w.document,s=d.createElement('script'),e=encodeURIComponent,o='object',n='AUWLBookjaJP',u='http://www.amazon.co.jp/wishlist/add',r='readyState',T=setTimeout,a='setAttribute',g=function(){d[r]&&d[r]!='complete'?T(g,200):!w[n]?(s[a]('charset','UTF-8'),s[a]('src',u+'.js?loc='+e(l)+'&b='+n),d.body.appendChild(s),f()):f()},f=function(){!w[n]?T(f,200):w[n].showPopover()};typeof s!=o?l.href=u+'?u='+e(l)+'&t='+e(d.title):g()}())";

    var listener = function(){
        liberator.open(bookmarklet);
    }
    var StatusBarPanel = document.createElement('statusbarpanel');
    StatusBarPanel.setAttribute('id','amazon-button-clone');
    StatusBarPanel.setAttribute('class','statusbarpanel-iconic');
    StatusBarPanel.setAttribute('src',icon);
    StatusBarPanel.addEventListener('click',listener,true);
    document.getElementById('status-bar').insertBefore(StatusBarPanel,
        document.getElementById('security-button'));
})();
EOF

" Booklog Bookmarklet Button
:javascript << EOF
(function(){
    const icon = "data:image/png;base64,"
+"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA"
+"bklEQVQoFWM0NDRkIAWw8PPzk6KegQmo2sshFYiAjPxdTkAEZGi6FAERkJGQ6gBEQEaRpj8QARkg"
+"DSSBQaiBkS7BmmErAETAsNrlFAdEQIZFlDkQARmaiUVABGSsXqQLREDGIAwlkp1EcrCSbAMAxHAX"
+"IR1v1PsAAAAASUVORK5CYII="

    var bookmarklet = "javascript:var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://booklog.jp/blet',l=d.location,g=d.getElementById('ASIN'),a=(g?g.value:''),e=encodeURIComponent,p='?v=2&u='+e(l.href)+'&s='+e(s)+'&a='+e(a),u=f+p,a=function(){w.open(u,'_blank')};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0); else a(); void(0);";

    var listener = function(){
        liberator.open(bookmarklet);
    }
    var StatusBarPanel = document.createElement('statusbarpanel');
    StatusBarPanel.setAttribute('id','booklog-button-clone');
    StatusBarPanel.setAttribute('class','statusbarpanel-iconic');
    StatusBarPanel.setAttribute('src',icon);
    StatusBarPanel.addEventListener('click',listener,true);
    document.getElementById('status-bar').insertBefore(StatusBarPanel,
        document.getElementById('security-button'));
})();
EOF
広告を非表示にする