From a57a4edcb648d025254ede4d18d267b887ad0b8b Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sun, 5 Sep 2021 15:14:28 +0530 Subject: Remove dependency on 'require' of 'electron' and 'electron/remote' modules. Instead, use the exposed content from the recipe model in main ferdi. --- recipes/lastpass/webview.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'recipes/lastpass/webview.js') diff --git a/recipes/lastpass/webview.js b/recipes/lastpass/webview.js index d4090b3..878fa5e 100644 --- a/recipes/lastpass/webview.js +++ b/recipes/lastpass/webview.js @@ -2,12 +2,6 @@ const _path = _interopRequireDefault(require('path')); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const { remote } = require('electron'); - -const webContents = remote.getCurrentWebContents(); - -const { session } = webContents; - setTimeout(() => { if (document.querySelector('body').innerHTML.includes('Google Chrome 36+')) { window.location.reload(); @@ -15,6 +9,7 @@ setTimeout(() => { }, 1000); window.addEventListener('beforeunload', async () => { try { + const { session } = Ferdi.getCurrentWebContents(); session.flushStorageData(); session.clearStorageData({ storages: ['appcache', 'serviceworkers', 'cachestorage', 'websql', 'indexdb'], -- cgit v1.2.3-70-g09d2