【问题标题】:Using the Toolbar Buttons library in Firefox在 Firefox 中使用工具栏按钮库
【发布时间】:2013-04-22 19:50:11
【问题描述】:

我想将弹出框图标添加到 URL 栏旁边的区域,就像 Firebug 图标所在的位置一样。这样做的库,(由以前的答案推荐:Firefox extension icon on the navigation bar using the Add-on builder

如何在我的 Firefox 扩展程序中使用该库?该图标现在位于 FF 窗口的右下方,而且非常小。

谢谢!

【问题讨论】:

    标签: javascript html firefox firefox-addon


    【解决方案1】:

    下载这个包: 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
        });
    }
    

    默认情况下,这会将一组新图标添加到导航工具栏。去图:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多