From 10f60e45b3f146cf7a9a7948bd451e9c45c6acaa Mon Sep 17 00:00:00 2001 From: kwent Date: Sun, 22 Apr 2018 15:24:30 -0700 Subject: [PATCH 1/3] clearCache --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3221e00..a232dcf 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ var generateRandomString = function (length) { return text; }; -module.exports = function (config, windowParams) { +module.exports = function (config, windowParams, clearCache = false) { function getAuthorizationCode(opts) { opts = opts || {}; @@ -49,6 +49,10 @@ module.exports = function (config, windowParams) { return new Promise(function (resolve, reject) { const authWindow = new BrowserWindow(windowParams || {'use-content-size': true}); + if (clearCache) { + authWindow.webContents.session.clearCache(); + } + authWindow.loadURL(url); authWindow.show(); From 4e5c562af3d4c8169464c67b539240a8488836e1 Mon Sep 17 00:00:00 2001 From: kwent Date: Sun, 22 Apr 2018 15:39:58 -0700 Subject: [PATCH 2/3] clearStorageData --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index a232dcf..ae82729 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ var generateRandomString = function (length) { return text; }; -module.exports = function (config, windowParams, clearCache = false) { +module.exports = function (config, windowParams, clearStorageData = false) { function getAuthorizationCode(opts) { opts = opts || {}; @@ -49,8 +49,8 @@ module.exports = function (config, windowParams, clearCache = false) { return new Promise(function (resolve, reject) { const authWindow = new BrowserWindow(windowParams || {'use-content-size': true}); - if (clearCache) { - authWindow.webContents.session.clearCache(); + if (clearStorageData) { + authWindow.webContents.session.clearStorageData() } authWindow.loadURL(url); From 5f37a0aa927bf2cf621147d03479bdc64ded64a4 Mon Sep 17 00:00:00 2001 From: kwent Date: Sun, 22 Apr 2018 18:44:57 -0700 Subject: [PATCH 3/3] eslint --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index ae82729..de8b0c9 100644 --- a/index.js +++ b/index.js @@ -50,7 +50,7 @@ module.exports = function (config, windowParams, clearStorageData = false) { const authWindow = new BrowserWindow(windowParams || {'use-content-size': true}); if (clearStorageData) { - authWindow.webContents.session.clearStorageData() + authWindow.webContents.session.clearStorageData(); } authWindow.loadURL(url);