electrobun 0.3.0-beta.0 → 0.3.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/bun/core/Socket.ts +12 -1
- package/package.json +1 -1
|
@@ -97,14 +97,25 @@ const startRPCServer = () => {
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
close(ws, code, reason) {
|
|
100
|
+
if (!ws?.data) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
100
103
|
const { webviewId } = ws.data;
|
|
101
104
|
console.log("Closed:", webviewId, code, reason);
|
|
102
|
-
socketMap[webviewId]
|
|
105
|
+
if (socketMap[webviewId]) {
|
|
106
|
+
socketMap[webviewId].socket = null;
|
|
107
|
+
}
|
|
103
108
|
},
|
|
104
109
|
|
|
105
110
|
message(ws, message) {
|
|
111
|
+
if (!ws?.data) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
106
114
|
const { webviewId } = ws.data;
|
|
107
115
|
const browserView = BrowserView.getById(webviewId);
|
|
116
|
+
if (!browserView) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
108
119
|
|
|
109
120
|
if (browserView.rpcHandler) {
|
|
110
121
|
if (typeof message === "string") {
|
package/package.json
CHANGED