cdp: don't try to send with ws when closed

This commit is contained in:
CanadaHonk 2023-01-28 12:11:15 +00:00
parent efff1770e5
commit 870b6e5b40

View File

@ -90,8 +90,7 @@ export default async ({ pipe: { pipeWrite, pipeRead } = {}, port }) => {
ws.on('message', data => onMessage(data));
_send = data => ws.send(data);
_send = data => !closed && ws.send(data);
_close = () => ws.close();
} else {
let pending = '';