Re:Show HN: Host a Website in the URL
by rpastuszak on Wednesday September 06, 2023 @06:37PM
(#37412393)
I'm using Base64 + gzip (IIRC) which allows me to store ca 5kb of text in a single Tweet: https://sonnet.io/projects#:~:text=Laconic!%20(a%20Twitter%2...
Re:Show HN: Host a Website in the URL
by rpastuszak on Thursday September 07, 2023 @04:45AM
(#37416303)
This is amazing, thanks
Shameless self-promotion: https://github.com/gvx/base116676
Re:Show HN: Host a Website in the URL
by pcthrowaway on Thursday September 07, 2023 @12:33AM
(#37414799)
> Some JS APIs would work on a smolsite url, but wouldn't work in a data uri
In before someone writes a smolsite to install a service worker on the domain that sends analytics for all other smolsites to their own server
Re:Show HN: Host a Website in the URL
by account42 on Friday September 08, 2023 @06:33AM
(#37431879)
Just another reason why service workers were a mistake and should be removed.
Re:Show HN: Host a Website in the URL
by maxbond on Thursday September 07, 2023 @02:10AM
(#37415315)
You can use this trick to get a handy notepad.
data:text/html,<html contenteditable>
I keep it on my bookmarks toolbar.
Re:Show HN: Host a Website in the URL
by undebuggable on Thursday September 07, 2023 @02:30AM
(#37415426)
Duh, one can load preconfigured ACE editor with syntax highlighting with it.
I also have a bookmarklet for quick notes.
> data:text/html,<html contenteditable><body style="margin: 10vh auto; max-width: 720px; font-family: system-ui"><h1>New Note
I added some basic styles so I can screenshare :D
Also in most browsers, CTRL + B, I and U work in contenteditable divs.
Re:Show HN: Host a Website in the URL
by petabytes on Sunday September 10, 2023 @01:17AM
(#37453111)
Reminds me of what I did with ChromeOS in middle school, built a whole code editor in the URL bar.
Re:Show HN: Host a Website in the URL
by undebuggable on Thursday September 07, 2023 @02:28AM
(#37415416)
(Un)fortunately web browsers [1] and URL shorteners block opening and redirecting to data URLs so they are useful mostly as bookmarks in the web browser.
[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_...
data:text/html,<h1>My%20small%20website</h1><p>Look,%20it's%20real!</p>
You can use a data uri generator to base64-encode it, if you want.
Advantages of smolsite:
- Zip might let you fit a bit more than a data uri
- Some JS APIs would work on a smolsite url, but wouldn't work in a data uri