Reputation: 1221
Many times I've faced this problem when a code will generate exception( eg. method not defined in object) it will not show up in the Firefox console. Firefox will simply skip that part of code.
After unable to figure the problem out, I'd need to use Chrome console to see the exception. Or I can wrap code in try-catch
to see exception when run in Firefox console
Any solution so that Firefox only will show the exception code without wrapping the code within try-catch
where it is happening?
Upvotes: 6
Views: 144
Reputation: 13479
You can visit the debug console directly by opening about:devtools-toolbox?type=extension&id=<extension id>
in a new tab, then click the Console tab in the debug console. Any console log (console.log
, console.info
, etc) will appear there if no filter is specified. Uncaught exceptions will also appear here.
You can find your extension id in the overview of addons, or by supplying one manually in your manifest:
"browser_specific_settings": {
"gecko": {
"id": "[email protected]",
}
}
This is what it looks like for an addon of mine:
You could also use the web-ext tool developed by Mozilla to debug your addons, which will also show console logs, however it is less useful than about:devtools-toolbox because it cannot expand nested objects.
npm install --global web-ext
cd /path/to/your/extension
web-ext run --verbose
Upvotes: 0