http://kmext.sourceforge.net/files/foolproof.7z
some media plugins may cause the k-meleon process to linger when the last tab or window with the plugin activated is closed causing problems when relaunching k-meleon, also on some rare occasions k-meleon may fail to exit properly with bad websites after the last window is closed.. foolproof terminator fixes this problem by ensuring k-meleon is closed properly and writing to the prefs file. this plugin will not interfere or become active if several windows are open and will not interfere or activate when k-meleon exits properly and will only activate when it detects that k-meleon has been closed but the process is still running. also foolproof terminator will not execute if all k-meleon windows are closed but with download dialogs still running ensuring not to terminate k-meleon when there are downloads in progress. foolproof terminator does not conflict either with the crash report plugin in case k-meleon does crash and crash reporter can send its dumps normally.
this extension does not work with the symbiotic loader (loader.exe)
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
# ---------- foolproof exit-------------------------------
$_profile_path=getfolder(ProfileFolder);
$_tool_path=getfolder(RootFolder)."\\Tools";
foolproof{
exec($_tool_path."\\foolproof.exe \"".$_profile_path."\"");
}
$OnCloseWindow=$OnCloseWindow."foolproof;";
#-----------------------------------------------------------------
$macroModules=$macroModules."foolproof;";
#notrayicon
$prefspath=($CmdLine[1] & "\prefs.js")
$cleanclose=("user_pref" & "(" &"""" & "kmeleon.plugins.sessions.cleanShutdown" & """" & "," & " true" & ");")
sleep(58)
if WinExists("[CLASS:KMeleon Browser Window]", "") then
exit
elseif WinExists("[REGEXPTITLE:% of]") then
exit
else
processclose("k-meleon.exe")
FileWriteLine($prefspath, $cleanclose)
exit
endif
exit