when chrom close alert code example Example: js ask before close chrome window.onbeforeunload = function() { return ""; }