Show HN: Selfedit – A Hacky Editor
github.com
github.com
Terrible ideas are always among the most fun. I ran into a lot of issues trying to put this together, as what JS APIs you can/can't run on a data-uri aren't altogether well documented.
(Modifying location doesn't seem to work, but I didn't see that documented. Modifying the history API doesn't, but that does seem to be documented. These are _very good things_ overall, but aren't really blockers to a bad idea like this one.)
The browser is surprisingly secure about it, which is great. Like opening a data-uri in a new tab doesn't always load/parse it, and often arbitrarily cuts the payload.
Firefox and Chrome also heavily restrict what can run in a Data URI, and that changes whether its embedded in a page, or opened by a link, or opened by pasting into the URL bar. However, they are still, occasionally, the source of CVEs.
An itty bitty link isn't self-contained. It does include a base64 string, but that contains some compressed text, which means you'll need a few more tools to actually get the content back if you don't have the site available.
Itty bitty is also just a plain-text editor. No messing around to create HTML.
On the other hand, the URLs it generates don't break the limits of some browser implementations, because it isn't a terrible idea to begin with, like mine.