How to Check Whether a Browser Supports WebSockets or Not?

by Venkat eswarlu on June 2, 2011

in How to,tips and tricks

WebSockets used to create interactive communication between a browser and a server and this technology is used to build Multiplayer Games, HTML5 chats and much more, Mozilla dropped WebSockets support for Firefox 4 (Opera also dropped support for their  browser due to security concerns) and recently added back to Firefox 6 Aurora channel currently Chrome and Safari supports WebSockets  if you’re wondering how to know whether a Browser supports WebSockets you can use simple JavaScript code in the address bar of browser to find out and here is how.

Find any Browser’s Support for WebSockets

Firefox 4 not supports websockets thumb How to Check Whether a Browser Supports WebSockets or Not?

Open the Browser and paste the below code in the address bar and press enter.

javascript:alert("WebSockets are " + (window.WebSocket ? "" : "not ") + "supported");

websockets are supported thumb How to Check Whether a Browser Supports WebSockets or Not?

WebSockets not supported browser thumb How to Check Whether a Browser Supports WebSockets or Not?

Here above screenshots shows Opera and Firefox browsers doesn’t support WebSockets dialog box where as Chrome supports WebSockets .

SHARE

{ 2 comments… read them below or add one }

Marko June 3, 2011 at 6:48 am

Nice tip. I just wanted to point out that Opera does support WebSockets (both latest stable and development snapshots), but they are disabled by default. To enable simply type “opera:config” (without the quotes) into the address bar. Then search for “sockets” and tick the checkbox to enable WebSockets. Click Save and restart the browser.

Reply

Venkat June 3, 2011 at 10:00 am

You’re right. I knew it and covered already here http://techdows.com/2010/12/enable-websockets-in-opera-11.html I should’ve mentioned about that in this post. Anyway thanks for observation.

Reply

Leave a Comment

Previous post:

Next post: