WebExtension - Debugging background-script and browser-action?

Hello!

I’m porting a Chrome extension to the new Firefox Web Extension API and have some trouble debugging errors and glitches.
How can I see the console-log of the background-script and popup-page (aka browser action)?
The content-script is accessible by the browser content toolbox, but I just can’t find the correspondig way to the other parts of the extension. I tried the browser toolbox and starting the debugger from the addon-tab but neither way shows me the javascripts of my extension.

I feel like I’m missing something embarrassingly simple here…

1 Like

@billm might be able to help. Thanks!

Hmm, I’m not sure what the problem is. I just installed a WebExtension and I see console.log messages from background.js in the browser console. I can also see the source for background.js in the browser toolbox.

Perhaps if you post a link to the extension? Also, are you using Nightly or Aurora?

I’m using the nightly-build. The extension is a product in development and not yet published so I’m not allowed to post any sourcecode or delicate details. I’ll provide as much information as possible to resolve the issue without violating any company policy :slight_smile:

Here’s the contents of the browser console after startup and browsing to blank.org WITH the extension: http://pastebin.com/GurxCvwd
The same procedure without the extension: http://pastebin.com/hiy7TgAX

Aside from some warnings about jquery-ui css rules multiple errors were logged. Their origin is unclear for me as they either stem from “unknown” or the internals of firefox.
Since some errors refer to insufficient permissions I have also attached the manifest (name/description etc. were replaced with placeholders): http://pastebin.com/TCH4viq3

Here is the debugger window for the extension. I exptected to see the background.js the list but its as empty as the console-window.

I moved 2 posts to a new topic: Console logging

Any progress on this?
For a browser action I can see the background script in the debugger after I click on the browser action once.

I use the Debug button of the extension in about:addons

What I don’t know yet is how to stop in content scripts.

Is that even possible yet in nightly desktop firefox (preferably ubuntu)?

I found the answer, see https://discourse.mozilla-community.org/t/console-logging/3692/7?u=anaran
I guess there is a better way to link to the other post, I just don’t know how yet.

1 Like

I’m using FirefoxDeveloper Edition.
Click on “Debug” against extension in “about:debugging” opens up a dev box.
Even if we put breakpoints in background.js, there is no reload button such that those breakpoints are actually hit.

  1. How to debug background.js ?
  2. How to reload extension ?