Share your repls and programming experiences

← Back to all posts
CyberChat Chatroom
RohilPatel (807)

Well, I made another chat, like the one, except better! This one, instead of having those bogus alert prompts, we made a second page. We used localStorage too! Have fun people!

PDanielY (981)

Not to hate, but this is really unsafe. Anyone could enter HTML in the chat input and it will render it as html

Edit: The owner fixed it I think

RohilPatel (807)

Oh crap, forgot to change that @PDanielY

RohilPatel (807)

Also, then, how would I use html to add styles? @PDanielY

RohilPatel (807)

Now I'm using text. How can I still use html tho? @PDanielY

PDanielY (981)

@RohilPatel you can use document.createElement then set attributes with document.setAttributes and append to body or div with the append function



also nice youtube channel

Geotale (4)

If you don't mind, this is still very vulnerable to XSS, and I'm still a beginner at it! I simply set my name to some HTML, then tried writing HTML in the messages. It seemed sometimes writing <script>alert(1)</script> Would sometimes work, but <img src=x onerror=alert(1)> always works. Overall though, this thing looks great, is very fast, and has a good way to use it. 10/10 Would make marquees again.

MesyetiIsTaken (54)

Enjoying putting HTML code in chat >:)

Spodormon (2)

my score is to make a really good chatroom like discord.

RohilPatel (807)

Cool! Let me know when ur done! @Spodormon

hazelpy (7)

aaaand its broken lol

RohilPatel (807)

What the heck are u talking about? @hazelpy

hazelpy (7)

@hazelpy the messages show inline.

Theboys619 (13)

he means that there are no line breaks between each message

RohilPatel (807)

Thank you! Pl3ase upvote if u like! @thejoeman24