3 ms·
Ask HN: Can websocket make javascript safer?
XSS protection has been around for quite a while and still, there's XSS breach every now and then.
I've been playing with Websocket lately and one thing that stood out for me is how WS is protected by the Same Origin Policy. Wouldn't loading javascript and subsequent "AJAX" call through websocket neutralize any XSS possibility?
I believe if every single Javascript snippet use on a website is passed through the same websocket, everything would match the same origin policy. Therefore, it would be impossible for a third party to load any code from your site.
What do you think?