【问题标题】:Extending Firebug (Firebug/FBL is undefined)扩展 Firebug(Firebug/FBL 未定义)
【发布时间】:2010-08-17 22:07:50
【问题描述】:
  • 火狐3.6.8
  • 萤火虫 1.5.4

我正在尝试编写一个使用 Firebug 的 Firefox 扩展。我已经启动并运行了 Firefox 扩展部分,但我似乎无法访问 Firebug。我遵循了各种教程并深入研究了其他 Firebug 扩展(例如 FirePHP)的代码。据我所知,这应该可行(最简单):

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://implementor/skin/overlay.css" type="text/css"?>

<overlay id="implementor-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script>
    FBL.ns(function() { with (FBL) {

    HelloWorldPanel = function() {}

    HelloWorldPanel.prototype = extend(Firebug.Panel,
    {
        name: "HelloWorld",
        title: "Hello World!",

        initialize: function() {
          Firebug.Panel.initialize.apply(this, arguments);
        },
    });

    Firebug.registerPanel(HelloWorldPanel);

    }});
</script>


</overlay>

FBL 总是以未定义的形式返回。如果我调用“Firebug.Console.log(whatever)”,Firebug 也将是未定义的。如果我稍后调用它(比方说,在点击菜单项之后)它将起作用。这绝对是加载问题,但我无法弄清楚。

谢谢。

【问题讨论】:

    标签: javascript firefox firebug xul


    【解决方案1】:

    您可以在 Firebug 新闻组上提问。 http://groups.google.com/group/firebug 我猜你没有成功覆盖,尝试在 FBL.ns 之前将 window.alert(window.location.toString()) 添加到你的 JS 中

    【讨论】:

    • 谢谢约翰。你是 FireDiff 背后的人吗?我决定使用来源来了解为什么我的不工作,我认出了你的名字。无论如何,我感谢您的帮助!
    猜你喜欢
    • 2014-05-31
    • 2014-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多