News for hackers. Stuff that matters.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by derefr on Friday June 30, 2023 @08:27PM (#36544662)
If the only requirement is "using no JavaScript", you know that you don't need CSS either, right? Dark web chatrooms just use frames — one frame to render the chat transcript (using a forever-loading "Transfer-Encoding: chunked" HTML page); the other with a plain old <form> with an <input type="text"> and a <submit>.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by killingtime74 on Friday June 30, 2023 @08:42PM (#36544842)
Can you talk a bit more about how it works? Is the page reloaded on submit?
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by dvt on Friday June 30, 2023 @08:43PM (#36544855)
This is an old trick, so I understand why people probably haven't seen it these days. But you have a page with two frames: the submission frame (i.e. input form, usually on the bottom of the page) is reloaded on submit, while the chat log (usually the top frame) loads infinitely.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by lelandbatey on Friday June 30, 2023 @09:14PM (#36545147)
Just to be further specific, they're talking about embedding two separate webpages inside of one page, using "iframe" HTML elements. In the bad old days you'd probably use a bare "frame" element, but those aren't valid HTML as of HTML5.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by blackbeans on Saturday July 01, 2023 @07:20AM (#36548930)
I think they used a frameset with frames. It had the advantage that it could be sized to the browser window as a percentage and both frames could be refreshed/loaded independently without affecting the other.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by tester756 on Friday June 30, 2023 @08:44PM (#36544860)
weren't people also implementing live chat with gifs back in the day?
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by jdiff on Friday June 30, 2023 @09:16PM (#36545172)
People were absolutely doing countdowns with gifs that were constructed and delivered to the client a frame at a time. I can't say that I personally ever saw any madman building a live chat feed with that technique but there's unfortunately nobody and nothing that could have stopped them.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by deaddodo on Friday June 30, 2023 @09:12PM (#36545123)
This is essentially what they are doing, minus the form frame.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by kyle-rb on Friday June 30, 2023 @09:16PM (#36545174)
CSS is needed because this app isn't using HTML forms to send the data. That would be easier, but part of the magic here is that in addition to no JavaScript, the page also never reloads.

The readme explains how the CSS :active selector is used to detect button presses.

Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by ComputerGuru on Friday June 30, 2023 @09:36PM (#36545341)
I mentioned multipart/x-mixed-replace above and I think it can work here instead of CSS. You never reload the chat history page, just put that in an iframe and use a separate iframe with a form that submits your newest reply.

Edit: actually this should work even without mixed replace.

Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by remram on Friday June 30, 2023 @09:59PM (#36545531)
When the form submits its frame refreshes ("navigates").
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by ComputerGuru on Friday June 30, 2023 @10:10PM (#36545625)
Right but reloading a static html asset (the reply iframe consisting of just a textbox) is basically free. So long as you separate the chat history window and the reply textbox/form into two separate frames, I don’t see the problem.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by croshan on Friday June 30, 2023 @11:39PM (#36546235)
Using JavaScript is also “basically free”.

There’s no problem with either listed approach, GP just seems to consider a method without page reloads as adhering to a harder constraint.

Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by weird-eye-issue on Saturday July 01, 2023 @06:06AM (#36548499)
Using JS would have broken the threat model of the dark web chatroom. So it is a non starter in that context.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by bawolff on Saturday July 01, 2023 @07:01AM (#36548796)
I thought chrome killed x-mixed-replace (except for jpg images)
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by ComputerGuru on Sunday July 02, 2023 @01:36PM (#36563620)
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by p4bl0 on Saturday July 01, 2023 @04:33AM (#36548044)
> the page also never reloads

Well, that's really only technically correct, since the strategy here is to replace the whole page with a new version of it on each virtual keypress, by using CSS to hide the previous HTML and then receiving the new updated version of the web page's content. The only tricks is to use a chunked content-transfer to have this all happen over a single HTTP request, so yes technically the page does noes reload, but it's pretty much the same thing as if it did.

Really cool trick nonetheless! And more importantly fun trick, and fun read :).

Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by pcthrowaway on Saturday July 01, 2023 @06:19AM (#36548559)
I think it'd at least eliminate some of the overhead with establishing new connections on every request with HTTP/1.1 or HTTP/2, but I'm not sure about HTTP/3
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by elikoga on Friday June 30, 2023 @09:17PM (#36545179)
Implemented here in haskell, didn't even add screenshots back then ^^'

https://github.com/elikoga/jsless-chat

Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by johngalt2600 on Friday June 30, 2023 @10:58PM (#36545959)
very cool!
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by userbinator on Friday June 30, 2023 @09:19PM (#36545191)
This wasn't a "dark web" thing in the late 90s, it was widely used. Unfortunately due to the awfulness of search engines today I can't find it now, but I remember there's a PHP script called "moonchat" which was somewhat common and JS-less.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by creatonez on Friday June 30, 2023 @10:12PM (#36545636)
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by ComputerGuru on Friday June 30, 2023 @09:34PM (#36545326)
There’s also multipart/x-mixed-replace for rendering only the latest update (replacing previous content) but iirc Chrome dropped support for that when content type is HTML [0].

[0]: https://news.ycombinator.com/item?id=7349266

Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by eyegor on Friday June 30, 2023 @09:37PM (#36545345)
I can tell you that it still works in chrome, this method was used by one of my coworkers as a quick and dirty hack until we had time to implement a real solution for data streaming. It worked fine in all major browsers ~2 weeks ago.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by ComputerGuru on Friday June 30, 2023 @09:39PM (#36545364)
I’m not sure what context you were using it in? It still works for non-HTML content types, can be used for mjpeg video streams, etc but you shouldn’t be able to use it to replace the previously rendered HTML contents of a frame.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by eyegor on Friday June 30, 2023 @09:43PM (#36545404)
Hmm I don't remember if we did dom manipulation in there. It was definitely used for video streaming though. There's a good chance we only used it for mjpeg and canvas shenanigans.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by est on Friday June 30, 2023 @11:55PM (#36546371)
<form action="msg.asp" method="post" target="my_iframe">
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by sam0x17 on Saturday July 01, 2023 @03:07AM (#36547530)
When I was at Kagi I implemented their fallback poly-fill for web sockets that way. Worked great!
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by javascript_obso on Saturday July 01, 2023 @03:15AM (#36547581)
Can we please have a code example for this technique or any similar way of not using JavaScript for this feature set? This is very interesting!

Thanks!

Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by savolai on Saturday July 01, 2023 @03:22AM (#36547623)
Chatgpt-4 seems to do fine if you ask it to provide the php.

This tech was used in the nineties by a finnish chat site operated by a radio station. I used to go on dates from the site myself. Thought it would be valuable to have this archived in english too

https://www.iltalehti.fi/fiidifi/a/2015021119172724

”KissFM Chat - do you still remember? For many, KissFM's chat was their first contact with the internet.

This is what it looked like back then. KISSFM

Mari Pudas Thursday, February 12, 2015 at 10:40

In the mid-1990s, not every home had an internet connection, in fact, it was quite a luxury. But fortunately, there were computers with internet connections in libraries. Under the watchful eye of the librarian, you could use the computer for up to an hour, sometimes just half an hour.

There were no Youtubes, not to mention Facebook or Twitter. So what did we do on the internet back then? Of course, we went to KissFM's chat!

Kiss FM's chat was founded in 1996, and was initially known as a hotel. Around 1998, the chat site got a brighter, greenish color scheme and the hotel was abandoned. The chat became Chatropol. There you chose a "room" to chat with like-minded people based on your interests.

The most popular rooms, cafe, disco, erotic house, and singles bars, were always occupied, as they could only accommodate about a dozen chatters at a time. Then you had to be content with the office building or the hairdresser. But regardless of the name, the conversation was often hilariously fun.

Over the years, its popularity waned and Kiss also became Voice. But let's let the former chatters reminisce about Kiss's golden age:

My friend and I used to use the names of Finnish schlager stars as our nicknames in the Kiss FM chat. We didn't intend to deceive anyone, we just thought it was a fun joke. Until "Marita Taavitsainen" received a private message thanking her, saying that the new album is wonderful. We politely thanked and that ended the use of real names due to a bout of bad conscience.

Ilona

I spent time and looked for some company while studying in Tampere at the beginning of the millennium. I enjoyed most in the Tampere section of Kiss FM's chat, where I held a quiz for other chatters - the fastest correct answer gets a point, and ten points to win. My nickname was Joe DiMaggio.

The Tampere department also had a nickname, hilleri, and he always said hrrrrrrr when he joined the channel. Others happily welcomed him. I even went on a couple of dates with a girl I met through the chat, but nothing more serious came out of those.

Joe

-The time when there was no internet at home (even with a modem) and you had to reserve hourly slots from the library for chatting after school... and just when you were having a good conversation with some nice guy, the library lady came to complain and you had to stop.

-Choosing rooms based on names, and then they were full!

-When some guy tested if I was old enough by asking when my period starts... younger ones wouldn't probably have known how to crack the code ;)

Jepa

The greatest amusement for teenage girls was to find a boy from the Kiss chat, and we would all respond together. Back then we just exchanged harmless messages, asked about each other's well-being and hobbies. We had no idea if the boy on the other side of the internet existed or not. In middle school, we would sneak into the computer room during breaks to chat or visit that friend who had a computer. Then of course we were nervous that a landline phone call would interrupt the internet connection.

Anna

I participated in discussions, but unfortunately I don't remember any of the topics. I just thought of the most popular internet fashion words of that time such as "peelo" which described an idiot/troublemaker who doesn't follow netiquette (:D).

Oh boy! In middle school (around 1997), I chose ICT as an optional subject. The school had a new fancy computer room, where everyone had their own computers with internet. First, we had to learn touch typing, then we could do what we wanted, i.e., create restless gif animations for our homepages or surf the internet. There wasn't much content on the internet yet - or we didn't know how to find it. But the gates of Kiss FM's chat city were wide open! Initially, I remember the coloring of the site being black-neon green, then the site was renewed and diversified, and the graphic image became city-like. Usernames were of course something like "FlowerGirl82" and the conversation was quite innocent flirting. I guess I learned something from that, but I still wish I had learned that HTML.

FlowerGirl82

Late

Around the age of 12, we pretended to be a bit older and played like we were looking for company. We sweet-talked for a while until we managed to coax out phone numbers. Then we made prank calls to those numbers. This pattern was repeated numerous times.

I'm not proud, but I don't regret it either”

Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by 411111111111111 on Saturday July 01, 2023 @04:06AM (#36547868)
classic HN comment. do note the name of the project and ask yourself again, was the only constraint to not use javascript?
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by Mizza on Saturday July 01, 2023 @04:37AM (#36548061)
I remember implementing this a long, long time ago for that purpose. It was a novelty then, didn't know it was still being used.

https://github.com/Miserlou/OnionChat

Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by hnlmorg on Saturday July 01, 2023 @05:04AM (#36548208)
In the 90s we used to just call them “chat rooms” (or “HTML chat” if we wanted to differentiate for stand alone clients like IRC).

I even wrote one myself.

Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by ykonstant on Saturday July 01, 2023 @10:19AM (#36550395)
I loved them; probably nostalgia, but I was having much more fun with those than today's chatrooms. I also preferred them to IRC for some reason.
Re:GitHub – kkuchta/CSS-only-chat: A monstrous async web cha... by buzzier on Saturday July 01, 2023 @08:25AM (#36549348)
iframe + meta refresh 10s