From c4280612c12bae2aad75dbb748af7c816388a1b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Herrmann?= Date: Wed, 22 Feb 2017 11:49:14 +0100 Subject: [PATCH 1/2] update setCertificateVerifyProc example setCertificateVerifyProc example should reflect new api --- docs/api/session.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/api/session.md b/docs/api/session.md index f04d45195f92..aeda16d38b0c 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -274,8 +274,13 @@ verify proc. const {BrowserWindow} = require('electron') let win = new BrowserWindow() -win.webContents.session.setCertificateVerifyProc((hostname, cert, callback) => { - callback(hostname === 'github.com') +win.webContents.session.setCertificateVerifyProc((request, callback) => { + const {hostname} = request + if(hostname === 'github.com') { + callback(0) + } else { + callback(-2) + } }) ``` From 91bd95a0b2dd2e18d71b2557fb46970202539f4e Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Feb 2017 08:11:21 -0800 Subject: [PATCH 2/2] Add space after if --- docs/api/session.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/session.md b/docs/api/session.md index aeda16d38b0c..029b18787cc0 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -276,7 +276,7 @@ let win = new BrowserWindow() win.webContents.session.setCertificateVerifyProc((request, callback) => { const {hostname} = request - if(hostname === 'github.com') { + if (hostname === 'github.com') { callback(0) } else { callback(-2)