Logging to console from Firefox extension?

前端 未结 4 947
无人及你
无人及你 2021-01-02 02:02

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 extens

4条回答
  •  天涯浪人
    2021-01-02 02:12

    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.

提交回复
热议问题