in te redi

はてなとなかよしCustomizable Toolbar Buttons

posted by nano on September 17, 2005 20:23

to

20050917a.png

前回のエントリではてなブックマーク追加ボタンを追加できる設定を書いたのですが、おなじようにRSSだとかアンテナの追加ボタンも実現可能なので、はてな関連のボタンの追加方法をメモしておきます。(ちなみに、この小技が役に立つのは、NoScriptなどの一部の拡張を使用していてBookmarkletが不便な時などに限定されると思われます)

まずやること

Customizable Toolbar Buttons 0.1.5をインストールする。
Hatenabarをインストールする(画像を利用するため)。


ボタン追加の基本操作

  1. Customizable Toolbar Buttons Settingsのオプション画面で New buttonを押す
  2. localname(button or toolbarbutton)toolbarbutton と入力
  3. Textタブの label =tooltiptext =ボタンのなまえ を入力
  4. Viewタブの image =画像の場所 を入力
  5. 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));

同じような要領でほかにも追加できると思います。

コメント



コメント:

関連記事