John Nagle
John Nagle

Reputation: 1578

For Mozilla WebExtensions, how do I get Javascript errors to show up in the console log?

For Mozilla WebExtensions, how do I get Javascript errors to show up in the console log?

I'm opening the developer tools for the appropriate tab. I run the code below in a WebExtension content script.

"use strict"
console.log("Load start."); 
foofoofoo; // ***TEMP*** force error

The message "Load start." appears in the console for that tab, but there's no message for the error from the next line. I never seem to get any Javascript error messages from add-ons in the console. I can see them if I step through in the debugger, but can't just get an ordinary Javascript error message.

Upvotes: 1

Views: 959

Answers (2)

the8472
the8472

Reputation: 43150

In addition to the browser console that you already discovered and the browser toolbox you can find addon-specific debuggers under about:debugging.

Which debugger to use for which context is documented on the MDN article WebExtensions/Debugging

Upvotes: 0

John Nagle
John Nagle

Reputation: 1578

The "Browser console" (CTL-SHIFT-J) shows the Javascript error messages from a content script, but the Developer Tools console, even though it will show log messages from an add-on content script, does not.

This does not appear to be documented.

Upvotes: 1

Related Questions