From 6b471815723099521195c62feb82e7930949e0c2 Mon Sep 17 00:00:00 2001 From: Administrator Date: Thu, 12 Mar 2026 08:40:57 +0100 Subject: [PATCH] fix: serialize WebRTC objects before IPC transfer RTCSessionDescription and RTCIceCandidate objects lose their properties when sent through Electron's contextBridge IPC. Convert to plain objects with explicit property extraction before sending. Co-Authored-By: Claude Opus 4.6 --- lib/remote-capture.html | 12 +++++++++--- package.json | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/remote-capture.html b/lib/remote-capture.html index f048559..89cd076 100644 --- a/lib/remote-capture.html +++ b/lib/remote-capture.html @@ -58,13 +58,18 @@ async function handleOffer(clientId, offer, role) { }; }; - // ICE candidates + // ICE candidates — serialize to plain object (WebRTC objects don't survive IPC) pc.onicecandidate = (event) => { if (event.candidate) { window.capture.sendSignaling({ type: 'ice-candidate', clientId, - candidate: event.candidate + candidate: { + candidate: event.candidate.candidate, + sdpMid: event.candidate.sdpMid, + sdpMLineIndex: event.candidate.sdpMLineIndex, + usernameFragment: event.candidate.usernameFragment + } }); } }; @@ -79,10 +84,11 @@ async function handleOffer(clientId, offer, role) { const answer = await pc.createAnswer(); await pc.setLocalDescription(answer); + // Serialize to plain object (RTCSessionDescription doesn't survive IPC) window.capture.sendSignaling({ type: 'answer', clientId, - answer: pc.localDescription + answer: { type: pc.localDescription.type, sdp: pc.localDescription.sdp } }); window.capture.notifyClientCount(clients.size); diff --git a/package.json b/package.json index 7f5c7eb..7075e7d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "multi-hoster-uploader", - "version": "2.1.3", + "version": "2.1.4", "description": "Upload files to doodstream, voe, vidmoly, byse simultaneously", "main": "main.js", "scripts": {