How to debug a background script that doesn't show up? (solved)

I’ve created an add-on with a background script using this manifest:

{
    "manifest_version": 2,
    "name": "foo",
    "version": "1.0",

    "description": "foo",

    "icons": {
	"48": "icons/foo-48.png"
    },

    "applications": {
	"gecko": {
	    "id": "foo@bar",
	    "strict_min_version": "71.0"
	}
    },

    "browser_action": {
	"default_icon": {
            "48": "icons/foo-48.png"
        },
	"default_title": "Foo"
    },

    "commands": {
	"run-nsaver": {
	    "suggested_key": {
		"default": "Ctrl+Foo"
	    },
	    "description": "Foo"
	}
    },

    "background": {
	"scripts": ["foo.js"]
    },

    "permissions": ["tabs", "activeTab", "nativeMessaging"]
}

When I load the add-on, the icon shows in the toolbar, but that’s it. When I click on the Inspect button, Firefox says that “this page has no sources”. Also, the JS debugger (on any web page) doesn’t show my add-on at all.

How can I further debug this? Could there be a parse error in one of my add-on files, e.g., my JS files (not that I found any)?

Note that for various reasons, I’m using Private Browsing, but enabled the add-on for it. Could Private Browsing contribute to my problems?

(Also, do I remember correctly that console.log doesn’t work in extension/background script contexts?)

console.log should work. You might want to try adding a debugger; statement to your background script and then trigger that (for example by reloading the extension) while having the extension debugger (https://extensionworkshop.com/documentation/develop/debugging/) open.

Thanks for your remark about console.log, which caused by to examine my code closer, and I did find an error (not syntax, but one undefined function). I guess I’d expected some sort of error in that case, but at least my question is answered.

Also thanks for the suggestions of debugger;, I’m sure that’ll come very handy in the future!