mirror of
https://github.com/titaniumnetwork-dev/Ultraviolet.git
synced 2025-05-17 05:20:01 -04:00
WebSocket properties
This commit is contained in:
parent
16aecc05f6
commit
aedac70b63
1 changed files with 9 additions and 0 deletions
|
@ -37985,6 +37985,10 @@ class WebSocketApi extends _events_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
||||||
this.protocol = ctx.nativeMethods.getOwnPropertyDescriptor(this.wsProto, 'protocol');
|
this.protocol = ctx.nativeMethods.getOwnPropertyDescriptor(this.wsProto, 'protocol');
|
||||||
this.send = this.wsProto.send;
|
this.send = this.wsProto.send;
|
||||||
this.close = this.wsProto.close;
|
this.close = this.wsProto.close;
|
||||||
|
this.CONNECTING = 0;
|
||||||
|
this.OPEN = 1;
|
||||||
|
this.CLOSING = 2;
|
||||||
|
this.CLOSED = 3;
|
||||||
};
|
};
|
||||||
overrideWebSocket() {
|
overrideWebSocket() {
|
||||||
this.ctx.override(this.window, 'WebSocket', (target, that, args) => {
|
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;
|
if (event.intercepted) return event.returnValue;
|
||||||
return new event.target(event.data.url, event.data.protocols);
|
return new event.target(event.data.url, event.data.protocols);
|
||||||
}, true);
|
}, 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() {
|
overrideUrl() {
|
||||||
this.ctx.overrideDescriptor(this.wsProto, 'url', {
|
this.ctx.overrideDescriptor(this.wsProto, 'url', {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue