扩展 Firebug(Firebug/FBL 未定义)
- Firefox 3.6.8
- Firebug 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 也将是未定义的。如果我稍后调用它(比方说,在点击菜单项后)它就会起作用。这绝对是一个加载问题,但我无法弄清楚。
谢谢。
- Firefox 3.6.8
- Firebug 1.5.4
I'm trying to write a Firefox extension that uses Firebug. I've gotten up and running with the Firefox extension part but I just can't seem to access Firebug. I've followed various tutorials and dug into the code of other Firebug extensions (such as FirePHP). From what I can tell, this should work (at it's simplest):
<?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 is always coming back as undefined. If I call "Firebug.Console.log(whatever)", Firebug will also be undefined. If I call it later on (let's say, after a menu item is hit) it will work. It's definitely a loading issue but I can't figure it out.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 Firebug 新闻组上询问。 http://groups.google.com/group/firebug
我猜你没有成功覆盖,尝试在 FBL.ns 之前将 window.alert(window.location.toString()) 添加到你的 JS 中
You can ask on the Firebug newsgroup. http://groups.google.com/group/firebug
I guess you are not overlaying successfully, try adding window.alert(window.location.toString()) to your JS before FBL.ns