Partly this is doable because although RFC 2616 (HTTP/1.1) specifies a max URL length of 2048 bytes, all the major browsers will process URLs which are much longer, with Safari allowing URL strings up to 2GB in size![1]
In 2021 probably one of the bigger blockers of giant URLs is CDNs, which impose various limits on URL size. e.g. Cloudflare limits URLs to 16kb.
flems.io (lightweight online html, js,css editor) does this also. i was very impressed, when i first encountered this. Everything is encoded in the url to share.
It's called a "fragment", and it's never sent to the server in HTTP requests. It was originally intended to have an HTML anchor as its value. Like when you click on a section or paragraph and you see the URL in the location bar gets "#<anchor>".
I looked it up: "#" is the location.hash and sets the anchor part of a URL. And is probably perfect for client side parameters, which is what I need. Such a discussion on HN is really often very helpful. There was a comment here that unfortunately got deleted again before I could reply that mentioned that.
THe URL is 1548 character long, which is below the "safe" length limit for URLs of 2058 characters. With Internet Explorer gone, URLs of up to 8192 chars length should work on all browsers.
Wow, very friendly and welcoming UI/UX that quickly makes me try out stuff. It looks simple but the flow is very polished. Good job!
P.S. Do you have more plans for this app? I see there's tutorials on programming.
Thanks. The main motivation was to develop a programming language for beginners. The code runner, the web apps, and the various tutorials were created kind of on the side.
In 2021 probably one of the bigger blockers of giant URLs is CDNs, which impose various limits on URL size. e.g. Cloudflare limits URLs to 16kb.
[1] https://github.com/apple/swift-corelibs-foundation/blob/b23d...