diff options
Diffstat (limited to 'recipes/googlemeet/webview.js')
-rw-r--r-- | recipes/googlemeet/webview.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/recipes/googlemeet/webview.js b/recipes/googlemeet/webview.js index 7a97505..6ea36f3 100644 --- a/recipes/googlemeet/webview.js +++ b/recipes/googlemeet/webview.js | |||
@@ -1,22 +1,24 @@ | |||
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 | window.onload = () => { | 7 | window.addEventListener('load', () => { |
6 | const title = document.querySelector('.window-title').innerHTML; | 8 | const title = document.querySelector('.window-title').textContent; |
7 | 9 | ||
8 | if (title && title.includes('Google Chrome 36+')) { | 10 | if (title && title.includes('Google Chrome 36+')) { |
9 | window.location.reload(); | 11 | window.location.reload(); |
10 | } | 12 | } |
11 | }; | 13 | }); |
12 | 14 | ||
13 | module.exports = (Ferdi, settings) => { | 15 | module.exports = (Ferdi, settings) => { |
14 | const getMessages = () => { | 16 | const getMessages = () => { |
15 | const elements = document.querySelectorAll('.CxUIE, .unread'); | 17 | const elements = document.querySelectorAll('.CxUIE, .unread'); |
16 | let count = 0; | 18 | let count = 0; |
17 | 19 | ||
18 | for (let i = 0; i < elements.length; i += 1) { | 20 | for (const element of elements) { |
19 | if (elements[i].querySelectorAll('*[data-icon="muted"]').length === 0) { | 21 | if (element.querySelectorAll('*[data-icon="muted"]').length === 0) { |
20 | count += 1; | 22 | count += 1; |
21 | } | 23 | } |
22 | } | 24 | } |