aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/lastpass/webview.js
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-09-05 15:14:28 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-09-05 18:00:26 +0530
commita57a4edcb648d025254ede4d18d267b887ad0b8b (patch)
treec8b75e58cf108a55608f729218885abdb07fd42d /recipes/lastpass/webview.js
parentAdd ability to use self-hosted option for 'youtrack' service (fixes #671) (diff)
downloadferdium-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.js7
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
3function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 3function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4 4
5const { remote } = require('electron');
6
7const webContents = remote.getCurrentWebContents();
8
9const { session } = webContents;
10
11setTimeout(() => { 5setTimeout(() => {
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);
16window.addEventListener('beforeunload', async () => { 10window.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'],