browser close not triggering the visibilityChange on safari
问题 I am trying to save some statistics when the user closes the browser, below is the code if (typeof document.hidden !== 'undefined') { // Opera 12.10 and Firefox 18 and later support hidden = 'hidden'; visibilityChange = 'visibilitychange'; } else if (typeof document.mozHidden !== 'undefined') { hidden = 'mozHidden'; visibilityChange = 'mozvisibilitychange'; } else if (typeof document.msHidden !== "undefined") { hidden = 'msHidden'; visibilityChange = 'msvisibilitychange'; } else if (typeof