5

Now that Firebug has been subsumed into Firefox, how can I configure the browser to bring Javascript errors to my attention without having the console open all the time, as Firebug used to do by showing an error count on its toolbar icon?

stovroz
  • 6,835
  • 2
  • 48
  • 59
  • You could wrap everything in a `try catch` and do `document.write` the error or `alert(error);` Although I think this is less than ideal. – Loaf Jan 12 '17 at 14:26

2 Answers2

1

The Firefox DevTools provide a so-called "Developer Toolbar" aka GCLI (openable via Firefox menu > Developer > Developer Toolbar or Shift + F2), which displays the number of errors on the page (besides providing many useful commands):

Errors shown in GCLI

Update:

The DevTools team obviously plans to remove the Developer Toolbar, because of low usage and because it's unmaintained and for most of it's features are available somewhere else.

There is no replacement yet for the error count, though, but a comment on the related bug report indicates that it will be added back.

Sebastian Zartner
  • 18,808
  • 10
  • 90
  • 132
  • 1
    Thanks, that's interesting but the count is next to useless for spotting Javascript errors unfortunately, as it's both cumulative between pages and seems to have a very broad definition of what constitutes an error (it reports 82 on this page alone for example). – stovroz Jan 12 '17 at 22:34
  • That sounds rather like a bug then, because for me there are no errors displayed on this page and the number changes when I switch between tabs. If that doesn't happen on a [fresh Firefox profile](https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles), I suggest you [file a bug report](https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox&component=Developer%20Tools%3A%20Graphic%20Commandline%20and%20Toolbar). – Sebastian Zartner Jan 13 '17 at 07:25
  • Ah, I could reproduce this on a new Firefox profile. And there is already a [bug report filed for it](https://bugzilla.mozilla.org/show_bug.cgi?id=1228034). A workaround is obviously to disable multi-process Firefox as I [described in another thread](http://stackoverflow.com/questions/40744448/why-got-firebug-removed-after-updating-firefox-to-version-50/40748127#40748127). – Sebastian Zartner Jan 13 '17 at 07:38
  • It shows several hundred errors which impossible. Totally useless – ymakux Jan 29 '17 at 05:51
  • 1
    As I mentioned in my previous comment, disabling multi-process Firefox fixes this until the related bug is fixed. – Sebastian Zartner Jan 29 '17 at 11:08
0

Another options is to use Chrome extension JavaScript Errors Notifier. To install it in Firefox, you'll first have to install another extension Chrome Store Foxified, which enables you to install any Chrome extension from Chrome Web Store to Firefox. You can follow the instructions of Chrome Store Foxified to install the extensions you like. (Note that not all Chrome extensions will work in Firefox.)

If you want to install the Chrome extension permanently, you'll have to sign up with Mozilla to get the extension signed.

If the JavaScript Errors Notifier extension is successfully installed in Firefox, you'll see an icon appearing at the right end of the address bar. enter image description here

And when there's any JavaScript error in the page, the icon will turn red. To see the details of the errors, you can click on the icon. And the extension have quite some options to tune the errors that you want to get alerted.

Henry Luo
  • 354
  • 4
  • 10
  • Note that the icon appears only after you restart Firefox. And for configuration change of this extension to take effect, it seems you also need to restart Firefox. – Henry Luo Apr 28 '17 at 04:29