by PowerfulWizard · 2y ago · 0 comments
data:text/html,<body contenteditable style="line-height:1.5;font-size:20px;">
No save function obviously but this lets me open a new tab and dump some text.So I use Zim wiki instead: https://zim-wiki.org/
Because the browser is the operating system.
I might be only half joking.
It's like that saying "The difference between a boat and a ship is that a ship can carry a boat, but a boat can't carry a ship." And I know there is jslinux but at that point we're in a Turing tarpit where you can say that the Lua VM or wasm is "an OS" and the term is just a five-dollar word for "abstraction layer". Is a function call an OS? Come on.
Except when you brainfart on the OS shutdown and choose the wrong answer.
But yes, I even do the culling every couple of months.
It doesn't! At least when I Alt+F4 it.
> everything’s unsaved and some notes have survived dozens of reboots
Yep, this is exactly how I use it.
But somehow that one time (note: it was on the shutdown) something went terribly wrong.
For a quick and dirty save, you can press Ctrl+P to open the print window/dialog and select "Save as PDF", or you can press Ctrl+S and save as a single HTML file.
Edit: to make the text cursor focus automatically when the page loads, you can add the autofocus attribute to the body tag.
data:text/html,<html contenteditable onload="document.body.innerHTML = localStorage['text']" oninput="localStorage['text'] = document.body.innerHTML" style="line-height:1.5;font-size:20px;">I code-golfed greyface-'s code and made the text cursor autofocus on page load:
data:text/html,<body contenteditable autofocus oninput="history.replaceState(0,0,'%23'+btoa(this.outerHTML))" onload="location.hash&& document.write(atob(location.hash.slice(1)))">#> Webstorage is tied to an origin. 'data:' URLs have unique origins in Blink (that is, they match no other origins, not even themselves). even if we decided that 'data:' URLs should be able to access localStorage, the data wouldn't be available next time you visited the URL, as the origins wouldn't match.
Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs. data:text/html,<body contenteditable style="line-height:1.5;font-size:20px;color:lightgray;background-color:black">