3 ms·
I use a variation of this as a bookmarklet, perhaps you'll find it useful: data:text/html,<html contenteditable> You could probably set that as the URL of you
by kevindamm 2y ago
I use a variation of this as a bookmarklet, perhaps you'll find it useful:
data:text/html,<html contenteditable>
You could probably set that as the URL of your home page to get the behavior you described.
I add a style="height:100%" in the HTML tag so that clicking anywhere puts focus on it for editing. You could add other styling and initial content as desired.
- jdshaffer 2y agoWow! That's really cool. Thanks for sharing!
- bakje 2y agoLove the simplicity of this
- Aicy 2y agoOh wow that's cool! How do you use this since I presume the tab will forget everything once its closed? Just temporary notes?
- kevindamm 2y agoYeah, I operate it like I would a dry-erase board. Ctrl-S doesn't work unless you add some scripting, but I usually copy-paste it if I'm drafting a note, or close it without saving if it was meant like a sticky note. It's good as a longer-term clipboard or a place to privately note down something before deciding whether to keep it. For notes that I've refined and want to hold on to, I tend to use a physical notebook. I enjoy the kinesthetic process of writing by hand so I still use that for more permanent notes.
- crazygringo 2y agoI do too. I've been wondering if there's some short JavaScript I could add to retrieve text from local storage when loaded, and update local storage after every change. Not so it persists for months, but just so it survives a tab close or a browser restart.
- kevindamm 2y agoEDIT: 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.
- crazygringo 2y agoYeah 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!
- kevindamm 2y agoIf 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>
- crazygringo 2y agoI love that! It never occurred to me. So simple. Thank you!