This page uses netscape.security.PrivilegeManager JS calls to cleanly and completely exit the browser under Mac OSX.
netscape.security.PrivilegeManager