esi-test-server-docker icon indicating copy to clipboard operation
esi-test-server-docker copied to clipboard

Any code on /playground is lost on browser reload

Open javiergarza opened this issue 7 years ago • 0 comments

Reloading the browser (CTRL+R) causes any custom code in the left panel of http://localhost:8080/playground to disappear.

It would be great if we could use local storage, or at least add a warning so people have to click to leave the page.

Something like this using JS: window.addEventListener("beforeunload", function (e) { 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.

});

javiergarza avatar Aug 18 '17 18:08 javiergarza