I guess they didn't want browsers to annoy users with popups like: "Do you want to allow a TCP connection to host.com:234?" The average user would have no idea what this means and would just accept anything. Maybe they could have elided the check if the destination uses the same host than where the HTML/JS was delivered from, but that would still leave some questions unanswered.
The entire websocket code should have never existed in the first place — just use standard TCP with standard TLS, like any other system, too.
Maybe require a browser permission for that, and that issue is solved, too.