# Console logging

**URL:** <https://discourse.mozilla.org/t/console-logging/3692>\
**Category:** Development\
**Created:** [August 30, 2015, 4:52pm UTC](https://discourse.mozilla.org/t/console-logging/3692 "2015-08-30T16:52:32Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![audiodude](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/audiodude/32/31029_2.png) [@audiodude](https://discourse.mozilla.org/u/audiodude)\
**Post date:** [August 30, 2015, 3:52pm UTC](https://discourse.mozilla.org/t/console-logging/3692/1 "2015-08-30T15:52:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![audiodude](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/audiodude/32/31029_2.png) [@audiodude](https://discourse.mozilla.org/u/audiodude)\
**Post date:** [August 30, 2015, 3:54pm UTC](https://discourse.mozilla.org/t/console-logging/3692/2 "2015-08-30T15:54:35Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![audiodude](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/audiodude/32/31029_2.png) [@audiodude](https://discourse.mozilla.org/u/audiodude)\
**Post date:** [August 31, 2015, 2:32am UTC](https://discourse.mozilla.org/t/console-logging/3692/3 "2015-08-31T02:32:53Z")

</div>

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?**

---

<div class="post-metadata">

**Author:** ![Mottie](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/mottie/32/21218_2.png) [@Mottie](https://discourse.mozilla.org/u/Mottie)\
**Post date:** [October 4, 2015, 2:24am UTC](https://discourse.mozilla.org/t/console-logging/3692/4 "2015-10-04T02:24:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![audiodude](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/audiodude/32/31029_2.png) [@audiodude](https://discourse.mozilla.org/u/audiodude)\
**Post date:** [October 4, 2015, 3:16am UTC](https://discourse.mozilla.org/t/console-logging/3692/5 "2015-10-04T03:16:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mottie](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/mottie/32/21218_2.png) [@Mottie](https://discourse.mozilla.org/u/Mottie)\
**Post date:** [October 4, 2015, 3:30am UTC](https://discourse.mozilla.org/t/console-logging/3692/6 "2015-10-04T03:30:22Z")

</div>

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

[https://developer.mozilla.org/en-US/docs/Tools/Browser\_Toolbox](https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox)

---

<div class="post-metadata">

**Author:** ![anaran](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/anaran/32/21217_2.png) [@anaran](https://discourse.mozilla.org/u/anaran)\
**Post date:** [October 24, 2015, 4:34pm UTC](https://discourse.mozilla.org/t/console-logging/3692/7 "2015-10-24T16:34:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mottie](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/mottie/32/21218_2.png) [@Mottie](https://discourse.mozilla.org/u/Mottie)\
**Post date:** [October 24, 2015, 6:15pm UTC](https://discourse.mozilla.org/t/console-logging/3692/8 "2015-10-24T18:15:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anaran](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/anaran/32/21217_2.png) [@anaran](https://discourse.mozilla.org/u/anaran)\
**Post date:** [October 24, 2015, 7:04pm UTC](https://discourse.mozilla.org/t/console-logging/3692/9 "2015-10-24T19:04:35Z")

</div>

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](https://wiki.mozilla.org/WebExtensions#Testing_out_the_WebExtensions_API)

---

<div class="post-metadata">

**Author:** ![Cd.K](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@Cd.K](https://discourse.mozilla.org/u/Cd.K)\
**Post date:** [October 11, 2019, 9:31am UTC](https://discourse.mozilla.org/t/console-logging/3692/10 "2019-10-11T09:31:10Z")

</div>

[SE SO How do I see the console.log output of a background script in a Firefox WebExtension?](https://stackoverflow.com/a/39084633/8373141)

Open [Browser Console](https://developer.mozilla.org/en-US/docs/Tools/Browser_Console) and check " **Show Content Messages**".

 ![11-10-_2019_11-28-28](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/8/e/8e4e8e2411dc7fe31bf37ec533ca361928b9e8f8.png)  
(firefox version 70)

> ```auto
> //* 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.');
> }
> //*
> 
> ```
