News for hackers. Stuff that matters.
Re:A chat room inside the browser console by aur09 on Sunday July 28, 2019 @03:03AM (#20546216)
You got my hopes up, thinking you’d discovered some esoteric way of overloading the console to behave as a chat box itself. Manually calling a global function from the console and having messages logged to it… I guess it is clever, but I hate to admit it’s a bit of a letdown.

Also, long polling when websockets exist? Reeeeeeeeeeeeee

Edit: It’s even worse than that! You pull in the entire chat history every 5 seconds! Reminder to everyone on limited bandwidth not to leave this open lol

Re:A chat room inside the browser console by 1mbsite on Saturday July 27, 2019 @08:35PM (#20545181)
Hey it’s Dalton Edwards the creator of Console.Chat! To whoever shared my project - thank you! And to everybody enjoying it - thank you!! I know it’s silly and could be improved upon (that’s why it’s open source)! I code silly stuff like this all the time just to experiment.
Re:A chat room inside the browser console by freakynit on Sunday July 28, 2019 @03:18AM (#20546262)
That is what is required. Great work! Keep experimenting. Never get discouraged no matter what anybody says. And keep collaborating :)
Re:A chat room inside the browser console by jamestimmins on Sunday July 28, 2019 @01:48AM (#20546048)
This is super cool! I love when people make fun projects that use standard tools in clever ways. Well done!
Re:A chat room inside the browser console by VvR-Ox on Sunday July 28, 2019 @03:23AM (#20546271)
It's not silly. It proves you are a very creative person and I love it :-)
Re:A chat room inside the browser console by mhh__ on Saturday July 27, 2019 @08:59PM (#20545258)
Cheers for a few hours of fun
Re:A chat room inside the browser console by ed on Sunday July 28, 2019 @01:28PM (#20548717)
Hey Dalton, submitter here. Saw this on 1kprojects and thought it was a clever idea!
Re:A chat room inside the browser console by 1mbsite on Saturday July 27, 2019 @10:36PM (#20545551)
Anybody claiming to be me (Dalton) or an admin/moderator is lying. Anybody can set their username to anything and I advise everybody to exercise caution as impersonation is very easy. Thanks
Re:A chat room inside the browser console by skunkworker on Sunday July 28, 2019 @01:57AM (#20546078)
Your censor doesn't work on unicode fonts.
Re:A chat room inside the browser console by rmetzler on Sunday July 28, 2019 @03:52AM (#20546349)
and I wonder how easy it is to make people type the British slang for cigarettes.
Re:A chat room inside the browser console by giancarlostoro on Saturday July 27, 2019 @05:59PM (#20544475)
Reminds me of hackmud, which is annoying as hell because you gotta use programming language styled commands to do anything, instead of a more shell friendly typing language... This isn't as annoying as Hackmud at least, since it's just username("") and send("") you use to talk / set your username.
Re:A chat room inside the browser console by jimbo1qaz on Saturday July 27, 2019 @06:41PM (#20544704)
After typing cc(), nothing I type works:

Firefox: Uncaught SyntaxError: Invalid or unexpected token

Chrome: Uncaught SyntaxError: Invalid or unexpected token

Re:A chat room inside the browser console by D_B_Koopa on Saturday July 27, 2019 @08:51PM (#20545240)
type "send("message","color in hex"(optional))
Re:A chat room inside the browser console by bhl on Saturday July 27, 2019 @11:27PM (#20545683)
Does anyone know if you can exploit the CodeMirror instance that's installed with every download of the Chrome browser? Fun fact: you can inspect the web inspector if you have it in a separate window to confirm that it does indeed use CodeMirror. Very meta.
Re:A chat room inside the browser console by nanomonkey on Saturday July 27, 2019 @11:29PM (#20545693)
I really enjoy Cabal (https://github.com/cabal-club/cabal-cli), which is a decentralized chat client at the terminal (built on DAT/Hypercore).
Re:A chat room inside the browser console by MrStonedOne on Saturday July 27, 2019 @07:58PM (#20545004)
Fixed it in my fork: https://github.com/MrStonedOne/console.chat

Swearword filtering removed.

Re:A chat room inside the browser console by grenoire on Saturday July 27, 2019 @06:49PM (#20544734)
Oefh, this apparently doesn't page the messages, and instead loads all of them for the given domain at once at an interval—over and over again. Besides that, cool!
Re:A chat room inside the browser console by shkkmo on Saturday July 27, 2019 @07:52PM (#20544969)
Re:A chat room inside the browser console by z3t4 on Sunday July 28, 2019 @06:01AM (#20546713)
Make it a habit to always filter user input. Eg. Variables put into paths and SQL.
Re:A chat room inside the browser console by 1mbsite on Sunday July 28, 2019 @01:25PM (#20548695)
I have patched the path traversal security bug in production, just haven’t pushed to GitHub. This project was coded upwards of 6 months ago I’ve learned a lot since then.
Re:A chat room inside the browser console by shkkmo on Sunday July 28, 2019 @04:41PM (#20549738)
I would recommend never running code in production that you haven't commited into git.
Re:A chat room inside the browser console by freakynit on Sunday July 28, 2019 @03:17AM (#20546258)
4 things: 1. It doesn't use p2p discovery 2. It uses php 3. It polls 4. We have to call functions

Nonetheless, this is a good idea and the first version works! That matters :)

Re:A chat room inside the browser console by 1mbsite on Sunday July 28, 2019 @05:02AM (#20546546)
Yeah it’s not really possible for it to work without calling functions, as that’s how the developer console functions. Thanks for the feedback! I coded this ages ago and was surprised to see it on Hacker News!
Re:A chat room inside the browser console by duiker101 on Sunday July 28, 2019 @06:42AM (#20546839)
PHP has been great lately, every person that bashes PHP and hasn't tried it in the last couple years should really give it a shot.
Re:A chat room inside the browser console by zamadatix on Saturday July 27, 2019 @09:41PM (#20545378)
Should set background color to something that contrasts with the text color as not all browser consoles are a solid white.
Re:A chat room inside the browser console by godelski on Saturday July 27, 2019 @07:31PM (#20544888)
Is there a demo? I turned off UBlock and HTTPs everywhere. Still nothing. (FF67 on Linux)
Re:A chat room inside the browser console by theemathas on Saturday July 27, 2019 @11:51PM (#20545752)
It's in the browser console. In chrome, that can be accessed by menu->more tools->developer tools
Re:A chat room inside the browser console by z3t4 on Sunday July 28, 2019 @02:47AM (#20546185)
Ctrl+Shift+I should work in most browsers.
Re:A chat room inside the browser console by parksy on Sunday July 28, 2019 @03:07AM (#20546229)
I'm a bit disappointed, I did domain = "news.ycombinator.com" and no one showed up to the party.
Re:A chat room inside the browser console by t0astbread on Saturday July 27, 2019 @09:00PM (#20545261)
This is cursed since the mods are totally overwhelmed right now but it's super funny
Re:A chat room inside the browser console by arkitaip on Saturday July 27, 2019 @07:35PM (#20544905)
I love everything about this.
Re:A chat room inside the browser console by jesuisuncaillou on Monday July 29, 2019 @09:21AM (#20554304)
Why the swearword filter ? Already got some toxic conversations here ?
Re:A chat room inside the browser console by NilsIRL on Sunday July 28, 2019 @04:39AM (#20546477)
Is there a way to get the browser console on mobile?
Re:A chat room inside the browser console by phinnaeus on Saturday July 27, 2019 @07:19PM (#20544847)
I'm not really sure what's special about this. Instead of showing chat messages in an element on the page, they are emitted via console.log().
Re:A chat room inside the browser console by Waterluvian on Saturday July 27, 2019 @07:35PM (#20544904)
I think there's a cuteness of it being hidden in the console. Who knows what site might have secret chat!

I think it's also an attempt at early web nostalgia.

Re:A chat room inside the browser console by sergiomattei on Saturday July 27, 2019 @08:33PM (#20545172)
It's nothing fascinating engineering wise. It's just clever and interesting to see.

It's a cool toy project people can play with. I'm surprised nobody ever did it before. It's so clever.

Re:A chat room inside the browser console by molmalo on Sunday July 28, 2019 @05:17AM (#20546579)
I wouldn't say nobody ever did it before... as it's not something incredibly novel... but it's still fun.

For example, while playing Airmash (an web game posted here around Dec 2017, now dead but another implementation still exists in starma.sh ), some of us were using a private chat (it used websocket though)... and this chat could be loaded and used via the console from any site....

Re:A chat room inside the browser console by mhh__ on Saturday July 27, 2019 @07:50PM (#20544959)
It's not special but I did have quite a lot of fun pretending to be osama bin laden (and richard stallman)