diff options
Diffstat (limited to 'src/models/Service.js')
-rw-r--r-- | src/models/Service.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/models/Service.js b/src/models/Service.js index ee6fe8b6e..4ee054b2b 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -245,7 +245,7 @@ export default class Service { | |||
245 | 245 | ||
246 | this.userAgentModel.setWebviewReference(this.webview); | 246 | this.userAgentModel.setWebviewReference(this.webview); |
247 | 247 | ||
248 | // If the recipe has implemented modifyRequestHeaders, | 248 | // If the recipe has implemented 'modifyRequestHeaders', |
249 | // Send those headers to ipcMain so that it can be set in session | 249 | // Send those headers to ipcMain so that it can be set in session |
250 | if (typeof this.recipe.modifyRequestHeaders === 'function') { | 250 | if (typeof this.recipe.modifyRequestHeaders === 'function') { |
251 | const modifiedRequestHeaders = this.recipe.modifyRequestHeaders(); | 251 | const modifiedRequestHeaders = this.recipe.modifyRequestHeaders(); |
@@ -258,6 +258,18 @@ export default class Service { | |||
258 | debug(this.name, 'modifyRequestHeaders is not defined in the recipe'); | 258 | debug(this.name, 'modifyRequestHeaders is not defined in the recipe'); |
259 | } | 259 | } |
260 | 260 | ||
261 | // if the recipe has implemented 'knownCertificateHosts' | ||
262 | if (typeof this.recipe.knownCertificateHosts === 'function') { | ||
263 | const knownHosts = this.recipe.knownCertificateHosts(); | ||
264 | debug(this.name, 'knownCertificateHosts', knownHosts); | ||
265 | ipcRenderer.send('knownCertificateHosts', { | ||
266 | knownHosts, | ||
267 | serviceId: this.id, | ||
268 | }); | ||
269 | } else { | ||
270 | debug(this.name, 'knownCertificateHosts is not defined in the recipe'); | ||
271 | } | ||
272 | |||
261 | this.webview.addEventListener('ipc-message', async (e) => { | 273 | this.webview.addEventListener('ipc-message', async (e) => { |
262 | if (e.channel === 'inject-js-unsafe') { | 274 | if (e.channel === 'inject-js-unsafe') { |
263 | await Promise.all(e.args.map((script) => this.webview.executeJavaScript(`"use strict"; (() => { ${script} })();`))); | 275 | await Promise.all(e.args.map((script) => this.webview.executeJavaScript(`"use strict"; (() => { ${script} })();`))); |