diff options
Diffstat (limited to 'recipes/lastpass/webview.js')
-rw-r--r-- | recipes/lastpass/webview.js | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/recipes/lastpass/webview.js b/recipes/lastpass/webview.js index 8bcf058..df3bd77 100644 --- a/recipes/lastpass/webview.js +++ b/recipes/lastpass/webview.js | |||
@@ -1,9 +1,13 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | const _path = _interopRequireDefault(require('path')); |
2 | 2 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 3 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | ||
5 | } | ||
4 | 6 | ||
5 | setTimeout(() => { | 7 | setTimeout(() => { |
6 | if (document.querySelector('body').innerHTML.includes('Google Chrome 36+')) { | 8 | if ( |
9 | document.querySelector('body').textContent.includes('Google Chrome 36+') | ||
10 | ) { | ||
7 | window.location.reload(); | 11 | window.location.reload(); |
8 | } | 12 | } |
9 | }, 1000); | 13 | }, 1000); |
@@ -13,8 +17,8 @@ module.exports = (Ferdi, settings) => { | |||
13 | const elements = document.querySelectorAll('.CxUIE, .unread'); | 17 | const elements = document.querySelectorAll('.CxUIE, .unread'); |
14 | let count = 0; | 18 | let count = 0; |
15 | 19 | ||
16 | for (let i = 0; i < elements.length; i += 1) { | 20 | for (const element of elements) { |
17 | if (elements[i].querySelectorAll('*[data-icon="muted"]').length === 0) { | 21 | if (element.querySelectorAll('*[data-icon="muted"]').length === 0) { |
18 | count += 1; | 22 | count += 1; |
19 | } | 23 | } |
20 | } | 24 | } |
@@ -23,7 +27,15 @@ module.exports = (Ferdi, settings) => { | |||
23 | }; | 27 | }; |
24 | 28 | ||
25 | window.addEventListener('beforeunload', async () => { | 29 | window.addEventListener('beforeunload', async () => { |
26 | Ferdi.clearStorageData(settings.id, { storages: ['appcache', 'serviceworkers', 'cachestorage', 'websql', 'indexdb'] }); | 30 | Ferdi.clearStorageData(settings.id, { |
31 | storages: [ | ||
32 | 'appcache', | ||
33 | 'serviceworkers', | ||
34 | 'cachestorage', | ||
35 | 'websql', | ||
36 | 'indexdb', | ||
37 | ], | ||
38 | }); | ||
27 | Ferdi.releaseServiceWorkers(); | 39 | Ferdi.releaseServiceWorkers(); |
28 | }); | 40 | }); |
29 | 41 | ||