Console logging

I have a similar problem. I’ve installed my Chrome extension in FF nightly. The only modification I’ve made so far is to add the applications->gecko key to my manifest.json.

I’ve added console log statements in some of my content scripts, but I don’t see them appearing anywhere. Also in the debugger pane, I only see the sources of the page, I don’t see any of my content or background scripts.

I guess I’ll try stripping things out until it shows up?

Okay quick update, I do see the console log statements appearing. But I still don’t see any of my content scripts or background scripts in the debugger->sources view. Nor do I see any error that would explain why things aren’t working!

Just to be clear, I see the console logs of my scripts.

What I’d like to see is where are the scripts in the debug pane?

I am having this same issues.

Making a chrome extension work with Firefox required me to add an applications->gecko key to the manifest.json. I also noticed that the id had to be in an email format ("name@domain.com") or I would get a file is corrupt message while trying to load extension.

Secondly, the extension isn’t working as expected, but I have not found any way to troubleshoot the problem - In Chrome, I could right click on the extension popup and open the development tools for the popup. Not so in Firefox.

So did you find a solution? Or does anyone know how to troubleshoot extension code? The extension works perfectly in Chrome & Opera.

I did not find a solution, no. But also I stopped working on the extension I was working on.

Actually, I just found these instructions on how to enable the addon debugger

1 Like

Did you get this all working as intended?

I found when I also break in background scripts in the add-on debugger, the breakpoints in the content script never get hit.

When I quit the add-on debugger I can break and step through the content script in the browser content toolbox.

A browser content toolbox is only available in multiprocess (e10s) firefox.

No, it’s still not working for me, and I just tested my extension in Firefox Developer Editiion v43.0a2 (2015-10-24)… The implementation of WebExtensions is not yet complete.

It’s sure not complete being before its first official release.

I use Firefox nightly and it is stated as a requirement for getting the latest functionality in
https://wiki.mozilla.org/WebExtensions#Testing_out_the_WebExtensions_API

SE SO How do I see the console.log output of a background script in a Firefox WebExtension?

Open Browser Console and check " Show Content Messages ".

11-10-_2019_11-28-28
(firefox version 70)

//* For testing, open the Browser Console
try {
    //alert() is not actually supported in Firefox WebExtension background scripts.
    //This forces the Browser Console open.
    //This abuse of a misfeature works in FF49.0b+, not in FF48.
    alert('Open the Browser Console.');
} catch(e) {
    //alert() throws an error in Firefox versions below 49.
    console.log('alert() threw an error. Probably Firefox version < 49.');
}
//*