diff options
author | 2021-09-05 15:14:28 +0530 | |
---|---|---|
committer | 2021-09-05 18:00:26 +0530 | |
commit | a57a4edcb648d025254ede4d18d267b887ad0b8b (patch) | |
tree | c8b75e58cf108a55608f729218885abdb07fd42d /recipes/lastpass/webview.js | |
parent | Add ability to use self-hosted option for 'youtrack' service (fixes #671) (diff) | |
download | ferdium-recipes-a57a4edcb648d025254ede4d18d267b887ad0b8b.tar.gz ferdium-recipes-a57a4edcb648d025254ede4d18d267b887ad0b8b.tar.zst ferdium-recipes-a57a4edcb648d025254ede4d18d267b887ad0b8b.zip |
Remove dependency on 'require' of 'electron' and 'electron/remote' modules.
Instead, use the exposed content from the recipe model in main ferdi.
Diffstat (limited to 'recipes/lastpass/webview.js')
-rw-r--r-- | recipes/lastpass/webview.js | 7 |
1 files changed, 1 insertions, 6 deletions
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')); | |||
2 | 2 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
4 | 4 | ||
5 | const { remote } = require('electron'); | ||
6 | |||
7 | const webContents = remote.getCurrentWebContents(); | ||
8 | |||
9 | const { session } = webContents; | ||
10 | |||
11 | setTimeout(() => { | 5 | setTimeout(() => { |
12 | if (document.querySelector('body').innerHTML.includes('Google Chrome 36+')) { | 6 | if (document.querySelector('body').innerHTML.includes('Google Chrome 36+')) { |
13 | window.location.reload(); | 7 | window.location.reload(); |
@@ -15,6 +9,7 @@ setTimeout(() => { | |||
15 | }, 1000); | 9 | }, 1000); |
16 | window.addEventListener('beforeunload', async () => { | 10 | window.addEventListener('beforeunload', async () => { |
17 | try { | 11 | try { |
12 | const { session } = Ferdi.getCurrentWebContents(); | ||
18 | session.flushStorageData(); | 13 | session.flushStorageData(); |
19 | session.clearStorageData({ | 14 | session.clearStorageData({ |
20 | storages: ['appcache', 'serviceworkers', 'cachestorage', 'websql', 'indexdb'], | 15 | storages: ['appcache', 'serviceworkers', 'cachestorage', 'websql', 'indexdb'], |