2012-06-16 52 views

回答

0

下載這個包: https://github.com/voldsoftware/toolbarbutton-jplib

添加toolbarbutton.js到您的lib文件夾。您也可以添加listen.jsunload+.js。 (該依賴關係)

添加在exports.main函數以下代碼:

// create toolbarbutton 
var tbb = toolbar.ToolbarButton({ 
    id: "TBB-TEST", 
    label: "TBB TEST", 
    onCommand: function() { 
     tbb.destroy(); // kills the toolbar button 
    } 
}); 

if (require('self').loadReason == "install") { 
    tbb.moveTo({ 
     toolbarID: "nav-bar", 
     forceMove: false // only move from palette 
    }); 
} 

此默認添加的新圖標的導航工具欄的陣列。去圖:)