Hacker News new | ask | show | jobs
by kevindamm 451 days ago
EDIT: mm, localStorage API is disabled inside data URLs, understandably

There are local-first file based solutions (like classic TiddlyWiki) that could work for you,.. but at that point maybe you meant to open your favorite text editor or IDE.

I kind of like that this simple solution always opens a scratch buffer and I have to put it somewhere else to save it (never saved accidentally).

It also keeps the source formatting (or with ctrl-shift-V ignores it), which can be useful aside from the note taking itself.

1 comments

Yeah it's what I use as a scratch buffer too. I'm just so used to being able to reopen a tab if I close it by mistake. Thanks for the info!
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>

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