docs: function apply(api, _global) {
      var WS = _global.WebSocket;
      // On Safari window.EventTarget doesn't exist so need to patch WS add/removeEventListener
      // On older Chrome, no need since EventTarget was already patched
      if (!_global.EventTarget) {
          patchEventTarget(_global, [WS.prototype]);
      }
      _global.WebSocket = function (x, y) {
          var socket = arguments.length > 1 ? new WS(x, y) : new WS(x);
          var proxySocket;
          var proxySocketProto;
          // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance
          var onmessageDesc = ObjectGetOwnPropertyDescriptor(socket, 'onmessage');
          if (onmessageDesc && onmessageDesc.configurable === false) {
              proxySocket = ObjectCreate(socket);
              // socket have own property descriptor 'onopen', 'onmessage', 'onclose', 'onerror'
              // but proxySocket not, so we will keep socket as prototype and pass it to
              // patchOnProperties method
              proxySocketProto = socket;
              [ADD_EVENT_LISTENER_STR, REMOVE_EVENT_LISTENER_STR, 'send', 'close'].forEach(function (propName) {
                  proxySocket[propName] = function () {
                      var args = ArraySlice.call(arguments);
                      if (propName === ADD_EVENT_LISTENER_STR || propName === REMOVE_EVENT_LISTENER_STR) {
                          var eventName = args.length > 0 ? args[0] : undefined;
                          if (eventName) {
                              var propertySymbol = Zone.__symbol__('ON_PROPERTY' + eventName);
                              socket[propertySymbol] = proxySocket[propertySymbol];
                          }
                      }
                      return socket[propName].apply(socket, args);
                  };
              });
          }
          else {
              // we can patch the real socket
              proxySocket = socket;
          }
          patchOnProperties(proxySocket, ['close', 'error', 'message', 'open'], proxySocketProto);
          return proxySocket;
      };
      var globalWebSocket = _global['WebSocket'];
      for (var prop in WS) {
          globalWebSocket[prop] = WS[prop];
      }
  }