Skip to content
Permalink
Browse files

toolbaritem省いて#PlacesToolbarItemの下に追加するようにした

  • Loading branch information...
oflow
oflow committed May 16, 2014
1 parent d46f278 commit 2994094081ca0ed8e88e68624eb94ddc19f349e9
Showing with 6 additions and 5 deletions.
  1. +6 −5 gmarks_menu_in_bookmark_toolbar.uc.js
@@ -3,14 +3,13 @@
// @description GMarksのメニューをブックマークツールバーの先頭に移動させるやつ
// @version 1.0
// @author oflow
// @compatibility Firefox 6, 11.0
// @compatibility Firefox 24.5
// @namespace http://oflow.me/
// ==/UserScript==

(function() {
var menupopup = document.getElementById('gmarksMenuPopup');
var toolbaritem = document.createElement('toolbaritem');
var toolbarbutton = toolbaritem.appendChild(document.createElement('toolbarbutton'));
var toolbarbutton = document.createElement('toolbarbutton');
toolbarbutton.id = 'ucjs-gmarks-toolbarbutton';
toolbarbutton.className = 'bookmark-item';
toolbarbutton.setAttribute('type', 'menu');
@@ -19,11 +18,13 @@
// 他と区別しやすいように★のマークに変える
toolbarbutton.setAttribute('image', 'chrome://browser/skin/places/allBookmarks.png');
toolbarbutton.appendChild(menupopup);
var personalBookmarks = document.getElementById('personal-bookmarks');
var personalBookmarks = document.getElementById('PlacesToolbarItems');
if (personalBookmarks) {
var bookmarkItem = personalBookmarks.getElementsByClassName('bookmark-item');
if (bookmarkItem) {
bookmarkItem[0].parentNode.insertBefore(toolbaritem, bookmarkItem[0]);
personalBookmarks.insertBefore(toolbarbutton, bookmarkItem[0]);
} else {
personalBookmarks.appendChild(toolbarbutton);
}
}
})();

0 comments on commit 2994094

Please sign in to comment.
You can’t perform that action at this time.