2
votes

I've created an addon using the addon SDK and installed it in Firefox (version 35.0.1). The addon has the following files -

  • data/login.js (content script file)
  • lib/main.js (main addon code)
  • test/test-main.js (auto-generated)
  • package.json

In the main addon code I'm creating a panel, and the content script file is loaded using the contentScriptFile property of the panel. However when I launch the addon debugger, I'm able to see only the main.js script and not the content script. I've checked that the xpi file actually contains the content script file. So why isn't the debugger showing it?

3
Can you add your code? Do you see errors? You may, for example, have a syntax error in your content script. - therealjeffg
I have the same problem. Not only is the content script not showing, the content style file is also not showing, nor in Debugger, nor in Inspector styles, both neither in Brower Toolbox as the normal developer tools. Note though: Both script ánd stylesheet are working fine, I just can't debug/fiddle with them. (Using Firefox Developer edition.) I am guessing towards a configuration setting or bug. - e-motiv
you have to use the Web developer Tool see post below by e-motiv - ejectamenta

3 Answers

2
votes

I think I found it (using Firefox Developer Edition 42.0a2 though).

  1. Open the Default Web developer Tools (Ctrl+shift+I)
  2. Go to Settings (cog wheel top right)
  3. Enable "Advanced Settings" > "Enable worker debugging (in development)"
  4. Enable "Inspector" > "Show Browser styles" (for seeing your content style (files))
  5. Reload the page Screenshot
2
votes

Try using the browser toolbox or the browser content toolbox which is not scoped to a single addon.

Afaik the addon debugger only shows scripts running in the same compartment as the addon main, which may miss scripts running in sandboxes/other compartments.

1
votes

Its probably an error in your content script code that prevents the file from appearing in the debugger file list. I had this problem and it's difficult to find these errors as the Firefox error log often doesn't refer to the which file is in error or the line number. Check for unpaired braces that kind of thing