Avant de décharger
addEventListener('beforeunload', event => { });
Travis C
addEventListener('beforeunload', event => { });