Paste and Go 3の貼り付けて移動ボタンをロケーションバーに格納する

FirefoxPaste and Go 3をインストールするとツールバーに「貼り付けて移動」ボタンを追加できるようになりますが、大きくてダサいのでロケーションバーに入れるuserChrome.jsスクリプトを書きました。

拡張の要素の調べ方はいつものようにDOM Inspector(chrome://browser/content/browser.xulを開く)と userChromeお試し用スクリプト - Griever を使ってグリグリやりました。

画像右の#pg2-pasteandgo-toolbar-buttonをそのままロケーションバーにいれると大きいまま、widthは変えられるがheightが無理。style.listStyleImage = 'url(chrome://pasteandgo2/skin/go-button-16.png)'しても具合がわるいので、移動ボタンと同じようにimage要素にonclickで作成。

// ==UserScript==
// @name           PasteAndGo3p.uc.js
// @namespace      http://d.hatena.ne.jp/Cherenkov/
// @description    貼り付けて移動ボタンをロケーションバーに格納する
// @include        chrome://browser/content/browser.xul
// ==/UserScript==

(function() {

var pg = document.createElement('image');
pg.setAttribute("onclick", "pg2_PasteAndGo()");
pg.style.listStyleImage = 'url(chrome://pasteandgo2/skin/go-button-16.png)';
document.getElementById('urlbar-icons').appendChild(pg);

})();