Firefox has had support for raw sockets in web applications since its inception. Unfortunately, it's platform specific, it's ugly as hell and, from what I can tell, a pain to give it permissions.
Those aren't pure TCP sockets, though, since the server needs to support WS handshaking. You can't, e.g. write an IRC client that connects directly to IRC servers.