diff options
Diffstat (limited to 'src/index.ts')
-rw-r--r-- | src/index.ts | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/index.ts b/src/index.ts index 7c80ca955..97c77d185 100644 --- a/src/index.ts +++ b/src/index.ts | |||
@@ -90,8 +90,8 @@ if (isWindows) { | |||
90 | const settings = new Settings('app', DEFAULT_APP_SETTINGS); | 90 | const settings = new Settings('app', DEFAULT_APP_SETTINGS); |
91 | const proxySettings = new Settings('proxy'); | 91 | const proxySettings = new Settings('proxy'); |
92 | 92 | ||
93 | const retrieveSettingValue = (key: string, defaultValue: boolean) => | 93 | const retrieveSettingValue = (key: string, defaultValue: boolean | string) => |
94 | ifUndefined<boolean>(settings.get(key), defaultValue); | 94 | ifUndefined<boolean | string>(settings.get(key), defaultValue); |
95 | 95 | ||
96 | const liftSingleInstanceLock = retrieveSettingValue( | 96 | const liftSingleInstanceLock = retrieveSettingValue( |
97 | 'liftSingleInstanceLock', | 97 | 'liftSingleInstanceLock', |
@@ -164,6 +164,15 @@ if (!retrieveSettingValue('enableGPUAcceleration', false)) { | |||
164 | app.disableHardwareAcceleration(); | 164 | app.disableHardwareAcceleration(); |
165 | } | 165 | } |
166 | 166 | ||
167 | const webRTCIPHandlingPolicy = retrieveSettingValue( | ||
168 | 'webRTCIPHandlingPolicy', | ||
169 | DEFAULT_APP_SETTINGS.webRTCIPHandlingPolicy, | ||
170 | ) as | ||
171 | | 'disable_non_proxied_udp' | ||
172 | | 'default' | ||
173 | | 'default_public_interface_only' | ||
174 | | 'default_public_and_private_interfaces'; | ||
175 | |||
167 | const createWindow = () => { | 176 | const createWindow = () => { |
168 | // Remember window size | 177 | // Remember window size |
169 | const mainWindowState = windowStateKeeper({ | 178 | const mainWindowState = windowStateKeeper({ |
@@ -202,7 +211,7 @@ const createWindow = () => { | |||
202 | spellcheck: retrieveSettingValue( | 211 | spellcheck: retrieveSettingValue( |
203 | 'enableSpellchecking', | 212 | 'enableSpellchecking', |
204 | DEFAULT_APP_SETTINGS.enableSpellchecking, | 213 | DEFAULT_APP_SETTINGS.enableSpellchecking, |
205 | ), | 214 | ) as boolean | undefined, |
206 | nodeIntegration: true, | 215 | nodeIntegration: true, |
207 | contextIsolation: false, | 216 | contextIsolation: false, |
208 | webviewTag: true, | 217 | webviewTag: true, |
@@ -210,6 +219,7 @@ const createWindow = () => { | |||
210 | }); | 219 | }); |
211 | 220 | ||
212 | enableWebContents(mainWindow.webContents); | 221 | enableWebContents(mainWindow.webContents); |
222 | mainWindow.webContents.setWebRTCIPHandlingPolicy(webRTCIPHandlingPolicy); | ||
213 | 223 | ||
214 | app.on('browser-window-created', (_, window) => { | 224 | app.on('browser-window-created', (_, window) => { |
215 | enableWebContents(window.webContents); | 225 | enableWebContents(window.webContents); |
@@ -532,6 +542,7 @@ ipcMain.on('open-browser-window', (_e, { url, serviceId }) => { | |||
532 | }, | 542 | }, |
533 | }); | 543 | }); |
534 | enableWebContents(child.webContents); | 544 | enableWebContents(child.webContents); |
545 | child.webContents.setWebRTCIPHandlingPolicy(webRTCIPHandlingPolicy); | ||
535 | child.show(); | 546 | child.show(); |
536 | child.loadURL(url); | 547 | child.loadURL(url); |
537 | debug('Received open-browser-window', url); | 548 | debug('Received open-browser-window', url); |