Add setting for WebRTCIPHandlingPolicy (#1283)
Co-authored-by: Zylanx <32674125+Zylanx@users.noreply.github.com>
This commit is contained in:
@@ -158,3 +158,15 @@ app.on("open-url", (_, url) => {
|
||||
app.on("window-all-closed", () => {
|
||||
if (process.platform !== "darwin") app.quit();
|
||||
});
|
||||
|
||||
// Sets the WebRTC IP handling policy for all current and future windows.
|
||||
// Switching to "default_public_and_private_interfaces" may fix calls stuck at "DTLS Connecting" when using VPNs, Tailscale, etc.
|
||||
// https://github.com/Vencord/Vesktop/issues/876
|
||||
app.on("web-contents-created", (_event, contents) => {
|
||||
contents.setWebRTCIPHandlingPolicy(Settings.store.webRTCIPHandlingPolicy ?? "default");
|
||||
});
|
||||
Settings.addChangeListener("webRTCIPHandlingPolicy", () => {
|
||||
for (const win of BrowserWindow.getAllWindows()) {
|
||||
win.webContents.setWebRTCIPHandlingPolicy(Settings.store.webRTCIPHandlingPolicy ?? "default");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user