Skip to content

Instantly share code, notes, and snippets.

@zuzu
Created August 28, 2010 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zuzu/554910 to your computer and use it in GitHub Desktop.
Save zuzu/554910 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name STrSM(SidebarTitle replace SidebarMenu)
// @include main
// @include chrome://browser/content/browser.xul
// @version 1.0.0
// @create zuzu(http://zuzu-service.net/)
// @description サイドバーのタイトル部分を切り替えようメニューにします。
// ==/UserScript==
// @version 2010/08/22 制作。
(function(){
var SidebarSwitch = {
menu: "",
init: function(){
var element = document.getElementById("viewSidebarMenu");
var sidebarTitle = document.getElementById("sidebar-title");
this.menu = element.cloneNode(true); // サイドバー切り替えメニューをコピー。
this.menu.setAttribute("ID","sidebarSwitchMenu");
document.getElementById('mainPopupSet').appendChild(this.menu);
sidebarTitle.addEventListener('click', function(){
SidebarSwitch.menu.openPopup(this, 'after_start', 0, 0, false, true);
}, false);
},
}
SidebarSwitch.init();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment