ccapp test

var formSubmitting = false;
var setFormSubmitting = function() { formSubmitting = true; };

window.onload = function() {
window.addEventListener(“beforeunload”, function (e) {
if (formSubmitting) {
return undefined;
}

var confirmationMessage = ‘It looks like you have been editing something. ‘
+ ‘If you leave before saving, your changes will be lost.’;

(e || window.event).returnValue = confirmationMessage; //Gecko + IE
return confirmationMessage; //Gecko + Webkit, Safari, Chrome etc.
});
};
window.onpageshow = function() {
window.addEventListener(“pagehide”, function (e) {
if (formSubmitting) {
return undefined;
}
console.log(‘hello test 3’);
var confirmationMessage = ‘It looks like you have been editing something. ‘
+ ‘If you leave before saving, your changes will be lost.’;

(e || window.event).returnValue = confirmationMessage; //Gecko + IE
return confirmationMessage; //Gecko + Webkit, Safari, Chrome etc.
});
};

window.addEventListener(“pagehide”, event => {
if (event.persisted) {
/* the page isn’t being discarded, so it can be reused later */
}
alert(‘yo2’);
console.log(‘hello you fiend’);
}, false);

hello world