はてなとなかよしCustomizable Toolbar Buttons
posted by nano on September 17, 2005 20:23

前回のエントリではてなブックマーク追加ボタンを追加できる設定を書いたのですが、おなじようにRSSだとかアンテナの追加ボタンも実現可能なので、はてな関連のボタンの追加方法をメモしておきます。(ちなみに、この小技が役に立つのは、NoScriptなどの一部の拡張を使用していてBookmarkletが不便な時などに限定されると思われます)
まずやること
Customizable Toolbar Buttons 0.1.5をインストールする。
Hatenabarをインストールする(画像を利用するため)。
ボタン追加の基本操作
- Customizable Toolbar Buttons Settingsのオプション画面で
New button
を押す localname(button or toolbarbutton)
にtoolbarbutton
と入力- Textタブの
label =
とtooltiptext =
に ボタンのなまえ を入力 - Viewタブの
image =
に 画像の場所 を入力 - Event 1タブの
oncommand =
にスクリプト を入力
ボタンのなまえ, 画像の場所, スクリプトはそれぞれ違うので以下に示します。画像の場所はHatenabarをインストールしてる場合のものを書いていますが、インストールしてない場合はWeb上の画像のURLを入力してもかまいません。ボタンのなまえは表示されてるのと別のモノでもたぶんOKです。スクリプトは現在のタブにそのまま開くものと新しいタブを開くものがあるので、お好きな方を選んでください。
「含むアンテナ」を表示
ボタンのなまえ:HatenaAntennaInclude
画像の場所:chrome://hatenabar/content/skin/include.png
スクリプト(現在のタブに開く場合):
window._content.document.location='http://a.hatena.ne.jp/include?'+(window._content.document.location.href);
スクリプト(新しいタブを開く場合):
gBrowser.selectedTab=gBrowser.addTab('http://a.hatena.ne.jp/include?'+(window._content.document.location.href));
はてなアンテナに追加
ボタンのなまえ:AddHatenaAntenna
画像の場所:chrome://hatenabar/content/skin/a!.png
スクリプト(現在のタブに開く場合):
window._content.document.location='http://a.hatena.ne.jp/append?'+escape(window._content.document.location.href);
スクリプト(新しいタブを開く場合):
gBrowser.selectedTab=gBrowser.addTab('http://a.hatena.ne.jp/append?'+escape(window._content.document.location.href));
「ブックマークしているユーザーの一覧」を表示
ボタンのなまえ:HatenaBDtails
画像の場所: chrome://hatenabar/content/skin/entry.gif
スクリプト(現在のタブに開く場合):
window._content.document.location='http://b.hatena.ne.jp/entry/'+(window._content.document.location.href);
スクリプト(新しいタブを開く場合):
gBrowser.selectedTab=gBrowser.addTab('http://b.hatena.ne.jp/entry/'+(window._content.document.location.href));
はてなブックマークに追加
ボタンのなまえ:Hateboo
画像の場所: chrome://hatenabar/content/skin/b!.gif
スクリプト(現在のタブに開く場合):
window._content.document.location='http://b.hatena.ne.jp/add?mode=confirm&title='+escape(window._content.document.title)+'&url='+escape(window._content.document.location.href);
スクリプト(新しいタブを開く場合):
gBrowser.selectedTab=gBrowser.addTab('http://b.hatena.ne.jp/add?mode=confirm&title='+escape(window._content.document.title)+'&url='+escape(window._content.document.location.href));
はてなRSSに追加
ボタンのなまえ: AddHatenaRSS
画像の場所: chrome://hatenabar/content/skin/r_add.gif
スクリプト(現在のタブに開く場合):
window._content.document.location='http://r.hatena.ne.jp/append/'+(window._content.document.location.href);
スクリプト(新しいタブを開く場合):
gBrowser.selectedTab=gBrowser.addTab('http://r.hatena.ne.jp/append/'+(window._content.document.location.href));
同じような要領でほかにも追加できると思います。