Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any code on /playground is lost on browser reload #1

Open
javiergarza opened this issue Aug 18, 2017 · 0 comments
Open

Any code on /playground is lost on browser reload #1

javiergarza opened this issue Aug 18, 2017 · 0 comments

Comments

@javiergarza
Copy link

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.

});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants