Hacker News new | ask | show | jobs
by kevindamm 451 days ago
If you're looking to save yourself from accidental deletion, I tested the following, it adds a confirm dialog when closing the tab.

data:text/html,<div contenteditable style="height:100%"><script>addEventListener("beforeunload", (e) => {e.returnValue = "?";})</script>

1 comments

I love that! It never occurred to me. So simple. Thank you!