我想在工具栏图标单击时切换侧边栏。我在 ff-sidebar.js 文件中定义我的工具栏:
var mainWindow = null;
function startup() {
mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindow);
// Sidebar is loaded and mainwindow is ready
}
function shutdown() {
// Sidebar is unloading
}
window.addEventListener("load", startup, false);
window.addEventListener("unload", shutdown, false);
知道怎么做吗?我找不到任何参考。