code: public static WebSocket newWebSocketIfSupported()
    {
      if ( null == g_factory && GWT.isClient() && getSupportDetector().isSupported() )
      {
        register( getSupportDetector().newFactory() );
        return g_factory.newWebSocket();
      }
      return ( null != g_factory ) ? g_factory.newWebSocket() : null;
    }
docs: Create a WebSocket if supported by the platform.
  
  This method will use the registered factory to create the WebSocket instance.
  
  @return a WebSocket instance, if supported by the platform, null otherwise.