WebSocket properties

This commit is contained in:
Jason 2022-02-26 21:06:06 -05:00
parent 16aecc05f6
commit aedac70b63

View file

@ -37985,6 +37985,10 @@ class WebSocketApi extends _events_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
this.protocol = ctx.nativeMethods.getOwnPropertyDescriptor(this.wsProto, 'protocol');
this.send = this.wsProto.send;
this.close = this.wsProto.close;
this.CONNECTING = 0;
this.OPEN = 1;
this.CLOSING = 2;
this.CLOSED = 3;
};
overrideWebSocket() {
this.ctx.override(this.window, 'WebSocket', (target, that, args) => {
@ -37998,6 +38002,11 @@ class WebSocketApi extends _events_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
if (event.intercepted) return event.returnValue;
return new event.target(event.data.url, event.data.protocols);
}, true);
this.window.WebSocket.CONNECTING = this.CONNECTING;
this.window.WebSocket.OPEN = this.OPEN;
this.window.WebSocket.CLOSING = this.CLOSING;
this.window.WebSocket.CLOSED = this.CLOSED;
};
overrideUrl() {
this.ctx.overrideDescriptor(this.wsProto, 'url', {