Skip to content

Commit

Permalink
bump bare-mux
Browse files Browse the repository at this point in the history
  • Loading branch information
Percslol committed Sep 4, 2024
1 parent f0ffe5c commit 6dc991a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 67 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"prepare": "npm run build"
},
"devDependencies": {
"@mercuryworkshop/bare-mux": "^2.0.6",
"@mercuryworkshop/bare-mux": "2.0.7",
"astring": "^1.8.6",
"esbuild": "^0.18.11",
"eslint": "^8.28.0",
Expand Down
61 changes: 0 additions & 61 deletions src/client/requests/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,6 @@ class WebSocketApi extends EventEmitter {
this.ctx = ctx;
this.window = ctx.window;
this.WebSocket = this.window.WebSocket || {};
this.wsProto = this.WebSocket.prototype || {};
this.url = ctx.nativeMethods.getOwnPropertyDescriptor(
this.wsProto,
'url'
);
this.protocol = ctx.nativeMethods.getOwnPropertyDescriptor(
this.wsProto,
'protocol'
);
this.readyState = ctx.nativeMethods.getOwnPropertyDescriptor(
this.wsProto,
'readyState'
);
this.send = this.wsProto.send;
this.CONNECTING = WebSocket.CONNECTING;
this.OPEN = WebSocket.OPEN;
this.CLOSING = WebSocket.CLOSING;
Expand Down Expand Up @@ -56,53 +42,6 @@ class WebSocketApi extends EventEmitter {
this.window.WebSocket.CLOSING = this.CLOSING;
this.window.WebSocket.CLOSED = this.CLOSED;
}
overrideURL() {
this.ctx.overrideDescriptor(this.wsProto, 'url', {
get: (target, that) => {
const event = new HookEvent(
{ value: target.call(that) },
target,
that
);
this.emit('url', event);
return event.data.value;
},
});
}
overrideProtocol() {
this.ctx.overrideDescriptor(this.wsProto, 'protocol', {
get: (target, that) => {
const event = new HookEvent(
{ value: target.call(that) },
target,
that
);
this.emit('protocol', event);
return event.data.value;
},
});
}
overrideReadyState() {
this.ctx.overrideDescriptor(this.wsProto, 'readyState', {
get: (target, that) => {
const event = new HookEvent(
{ value: target.call(that) },
target,
that
);
this.emit('readyState', event);
return event.data.value;
},
});
}
overrideSend() {
this.ctx.override(this.wsProto, 'send', (target, that, args) => {
const event = new HookEvent({ args }, target, that);
this.emit('send', event);
if (event.intercepted) return event.returnValue;
return event.target.call(event.that, event.data.args);
});
}
}

export default WebSocketApi;
5 changes: 0 additions & 5 deletions src/uv.handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1240,11 +1240,6 @@ function __uvHook(window) {
client.eventSource.overrideConstruct();
client.eventSource.overrideUrl();
client.websocket.overrideWebSocket();
client.websocket.overrideProtocol();
client.websocket.overrideURL();
client.websocket.overrideReadyState();
client.websocket.overrideProtocol();
client.websocket.overrideSend();
client.url.overrideObjectURL();
client.document.overrideCookie();
client.message.overridePostMessage();
Expand Down

0 comments on commit 6dc991a

Please sign in to comment.