diff options
Diffstat (limited to 'src/models/Service.js')
-rw-r--r-- | src/models/Service.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/models/Service.js b/src/models/Service.js index a980ca4a3..b76e92a53 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -1,5 +1,6 @@ | |||
1 | import { autorun, computed, observable } from 'mobx'; | 1 | import { autorun, computed, observable } from 'mobx'; |
2 | import { ipcRenderer, remote } from 'electron'; | 2 | import { ipcRenderer } from 'electron'; |
3 | import { webContents } from '@electron/remote'; | ||
3 | import normalizeUrl from 'normalize-url'; | 4 | import normalizeUrl from 'normalize-url'; |
4 | import path from 'path'; | 5 | import path from 'path'; |
5 | 6 | ||
@@ -246,7 +247,7 @@ export default class Service { | |||
246 | 247 | ||
247 | 248 | ||
248 | initializeWebViewEvents({ handleIPCMessage, openWindow, stores }) { | 249 | initializeWebViewEvents({ handleIPCMessage, openWindow, stores }) { |
249 | const webContents = remote.webContents.fromId(this.webview.getWebContentsId()); | 250 | const webviewWebContents = webContents.fromId(this.webview.getWebContentsId()); |
250 | 251 | ||
251 | // If the recipe has implemented modifyRequestHeaders, | 252 | // If the recipe has implemented modifyRequestHeaders, |
252 | // Send those headers to ipcMain so that it can be set in session | 253 | // Send those headers to ipcMain so that it can be set in session |
@@ -337,14 +338,14 @@ export default class Service { | |||
337 | this.hasCrashed = true; | 338 | this.hasCrashed = true; |
338 | }); | 339 | }); |
339 | 340 | ||
340 | webContents.on('login', (event, request, authInfo, callback) => { | 341 | webviewWebContents.on('login', (event, request, authInfo, callback) => { |
341 | // const authCallback = callback; | 342 | // const authCallback = callback; |
342 | debug('browser login event', authInfo); | 343 | debug('browser login event', authInfo); |
343 | event.preventDefault(); | 344 | event.preventDefault(); |
344 | 345 | ||
345 | if (authInfo.isProxy && authInfo.scheme === 'basic') { | 346 | if (authInfo.isProxy && authInfo.scheme === 'basic') { |
346 | debug('Sending service echo ping'); | 347 | debug('Sending service echo ping'); |
347 | webContents.send('get-service-id'); | 348 | webviewWebContents.send('get-service-id'); |
348 | 349 | ||
349 | debug('Received service id', this.id); | 350 | debug('Received service id', this.id); |
350 | 351 | ||