Debugging Silverlight in Firefox 3.6.4 (and newer)

While they chug along to Firefox 4, Mozilla just released Firefox 3.6.4 (and quickly followed up with 3.6.6) on the world, sporting a new feature - plugin isolation. By isolating plugins to a different process, Firefox catches up to Chrome in stability, by ensuring that a rogue plugin that crashes does not bring down the whole browser, instead you get the sad face informing you that something has happened. This is a great end-user feature which will increase the general reliability of a user's browsing experience - but we aren't just users, are we?

Firefox will shut down a plugin when it is deemed to be either dead, or frozen. Unfortunately frozen is the state that the plugin will enter when you try to debug it (say, through Visual Studio), causing Firefox to kill the plugin and continue on its merry way. There have a been a number of proposed solutions, mainly around disabling the plugin container for Silverlight (see this forum post). Unfortunately, while this works for debugging, this is not a real user situation that you are debugging (since you're no longer locked in the container, which is the expected state for any user running your app). In order to get Firefox to still run Silverlight in the container, but not kill it when it detects a Freeze, do the following:

  1. type about:config
  2. find dom.ipc.plugins.timeoutSecs (you can start typing it in the filter)
  3. change the value to -1

This effectively cancels the timeout so that even though the plugin is no longer responding to Firefox's NSAPI messages, it will not be killed.

Happy bug hunting!