从Firefox扩展记录到控制台? [英] Logging to console from Firefox extension?

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

问题描述

据我所知,当使用带有 cfx run 命令的Firefox扩展时,我可以登录到控制台。

在使用 cfx xpi 打包扩展后,有没有办法登录到控制台?如果可能的话,记录到Firebug是很好的。



我发现了两篇关于这个博客文章(这里这里)。

我使用的是附加SDK和FF15的1.10版本。


a href =https://blog.mozilla.org/addons/2013/03/27/changes-to-console-log-behaviour-in-sdk-1-14/ =noreferrer>启用日志记录功能插件



•在about:config中,添加一个新的选项extensions.sdk.console.logLevel并赋予其值all



•重新启动Firefox 在Firefox中打开浏览器控制台

•工具 - > Web开发人员 - >浏览器控制台
$ b

注意:这与用于调试网页的常用Web控制台不同

现在你应该看到附件登录了。


I understand that I can log to the console when using a Firefox extension with the cfx run command.

Is there a way to log to a console after the extension has been packaged with cfx xpi? Logging to Firebug is fine if possible.

I have found two blog posts about this (here and here). Both are rather old and don't work any more.

I'm using version 1.10 of the add-on SDK and FF15.

解决方案

You need to do 2 things:

  1. enable logging for addons

    • in about:config, add a new option "extensions.sdk.console.logLevel" and give it the value "all"

    • restart Firefox

  2. in Firefox open the Browser Console:

    • Tools -> Web developer -> Browser console

    • NOTE: this is different from the usual Web Console used to debug web pages

You should see addons logs there now.

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

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