如何从扩展名登录到Firebug? [英] How do you log to Firebug from an extension?

查看:148
本文介绍了如何从扩展名登录到Firebug?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Firefox编写一个扩展,我需要将一些数据记录到Firebug的控制台。在我的插件的范围内,控制台未定义,并且window.content.console也未定义。

I'm writing an extension for Firefox, and I need to log some data to Firebug's console. Within the scope of my addon, "console" is undefined, and "window.content.console" is also undefined. So how do I log to the console?

推荐答案

因为你不是在一个窗口中执行Javascript,所以 console 未定义。

Since you're not writing Javascript that executes within a window, console is not defined.

因此,您需要首先引用Firebug扩展:

So you need to reference the Firebug extension first:

Firebug.Console.log(str);

这篇关于如何从扩展名登录到Firebug?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆