Strict JavaScript Warnings

A great Firefox tip at gemal.dk shows how to turn on the display of JavaScript warning messages which are disabled by default. When enabled, you will see messages that look like these:

warning messages

Warning errors don’t cause your JavaScript programs to crash, but they will slow down their execution, so periodically looking at the warning messges can certainly benefit your development.

To enable these messages follow these steps:

  1. Type about:config in your address bar
  2. Find javascript.options.strict by filtering on strict
  3. Doubleclick on the item to toggle between true and false
  4. Restart Firefox

Don’t forget that you can filter the messages by clicking on the type of error that you want to view in the JavaScript Console toolbar (ie. click Warning to see only warning messages).

3 Responses to “Strict JavaScript Warnings”

  1. Bill Rawlinson said on April 12th, 2005 at 8:41 am

    another option is to install the javascript debugber plugin. It will show an icon in the toolbar when a javascript error occurs.

  2. Andrew said on April 12th, 2005 at 11:09 pm

    Wow, the first thing I saw when I opened up the JS Console after setting that option was a bunch of warnings from the Firefox Extension Manager JavaScript code. Doesn’t instill much confidence…

    Still, nice tip, thanks. It will certainly help my code.