After much consternation and debugging I think I have come up with a code fix for the issues we are having with not being warned on closing windows with multiple tabs open. As it has been noted, when you have multiple windows open it works as it used to but this is due to the window merging code being a separate implementation of the "Warn on Close" dialog. There has been a major design change by the Mozilla team, namely that with the built-in session restore enabled, when closing a window with multiple tabs, there will be no warning by default because the session is assumed to be saved. In light of this they have modified the structure of how things are done when shutting down the browser. This prompted a code change in TMP. onemen et. al. did a great job of reimplementing the previous functionality with one small hitch, which I will show one way of correcting. As has been previously mentioned in this thread, one workaround is to disable TMP, enable "browser.warnOnQuit" and "browser.warnOnRestart" in about:config, and then reenable TMP, but there is actually a good reason why these are disabled by TMP when enabling TMP Session Restore, namely that it fully disables the mozilla session restore so there are no conflicts.
Without further ado, here are my instructions for fixing the current dev build 0.3.6.1.080406:
original Line 227-246 of the file tabmixplus.jar\content\tabmixplus\minit\tablib.js
Code:
function TMP_closeWindow(){
var _close = closeWindow(false,
function () {
var pref = "extensions.tabmix.warnAboutClosingTabs.timeout";
var startTime = new Date().valueOf();
var oldTime = gPref.prefHasUserValue(pref) ? gPref.getCharPref(pref) : 0;
var _canClose = getBrowser().warnAboutClosingTabs("All_onExit");
gPref.setCharPref(pref, oldTime*1 + (new Date().valueOf() - startTime));
return _canClose;
});
if (_close) {
var isRestartApp = TMP_closeWindow.caller.caller.name == "restartApp";
SessionManager.deinit(numberOfWindows() == 1, !isRestartApp);
}
return _close;
}
}
modified line 227-249
Code:
function TMP_closeWindow(){
var _close = warnOnClose();
if (_close) {
var isRestartApp = TMP_closeWindow.caller.caller.name == "restartApp";
SessionManager.deinit(numberOfWindows() == 1, !isRestartApp);
}
return _close;
}
function warnOnClose(){
var pref = "extensions.tabmix.warnAboutClosingTabs.timeout";
var startTime = new Date().valueOf();
var oldTime = gPref.prefHasUserValue(pref) ? gPref.getCharPref(pref) : 0;
var _canClose = getBrowser().warnAboutClosingTabs("All_onExit");
gPref.setCharPref(pref, oldTime*1 + (new Date().valueOf() - startTime));
return _canClose;
}
}
The best technical explanation I can come up with for why this fix works is that for whatever reason, passing the second parameter to the closeWindow() function as an anonymous function instead of a named one doesn't work.
edit: i have made the further modification of bypassing the built in FF function closewindow as it allows no way for a prompting function when there is only one window open.
Also, the easiest way I have found to modify the file without having to uncompress/recompress the jar file is the following:
1) Install the free trial of WinRAR (
http://www.rarlabs.com/download.htm)
2) Go into Options, Settings, Viewer and set the following two items:
3) open the tabmixplus.jar file that can be found in the extensions folder of your profile e.g. on Windows XP this would be :
C:\Documents and Settings\<Username>\Application Data\Mozilla\Firefox\Profiles\<Profile>\extensions\<Extension>\chrome\tabmixplus.jar
4) navigate to the file tabmixplus.jar\content\tabmixplus\minit\tablib.js and double click it
5) this should open the file in Windows Notepad
6) Just do a search for "function TMP_closeWindow(){" and carefully replace the above lines with the ones provided.
7) Go to File, Save and then you should get a dialog asking if you want to update the file in the archive with WinRAR

Just say yes and you're done
PS - oneman, i've noticed a slight typo in my digging as well that would prevent someone from disabling Warn on Close in the dialog for Window Merging:
line 252 in tabmixplus.jar\content\tabmixplus\flst\flst.js
Code:
gPref.setBoolPref("exetnsions.tabmix.warnOnClose", false);