This Firefox add-on is a work-around to prevent...
Error: preview is undefined
...messages that litter the Error Console in Firefox 3/4/5 + Windows 7 when the last tab is closed (and closing last tab is enabled in the settings). Be aware that this disables Firefox's AeroPeek features.
Again, this is a work-around, not a real fix. I assume it will be fixed in Firefox 6.