diff options
author | 2020-03-06 12:27:00 +0100 | |
---|---|---|
committer | 2020-03-06 12:27:00 +0100 | |
commit | f4a81fefe28c15bddba15a0a38a8bfb8019638a5 (patch) | |
tree | f193c26b839d6adebd423f3c53f6461d44de5bab /uncompressed/googlemeet/webview.js | |
parent | Add verify-all script (diff) | |
download | ferdium-recipes-f4a81fefe28c15bddba15a0a38a8bfb8019638a5.tar.gz ferdium-recipes-f4a81fefe28c15bddba15a0a38a8bfb8019638a5.tar.zst ferdium-recipes-f4a81fefe28c15bddba15a0a38a8bfb8019638a5.zip |
Fix recipe differences
This will make no functional changes - it will only remove any differences that existed between the recipe archives and uncompressed versions in order to make the verify-all script work.
Diffstat (limited to 'uncompressed/googlemeet/webview.js')
-rw-r--r-- | uncompressed/googlemeet/webview.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/uncompressed/googlemeet/webview.js b/uncompressed/googlemeet/webview.js new file mode 100644 index 0000000..8e91418 --- /dev/null +++ b/uncompressed/googlemeet/webview.js | |||
@@ -0,0 +1,43 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const { | ||
4 | remote | ||
5 | } = require('electron'); | ||
6 | |||
7 | const path = require('path'); | ||
8 | |||
9 | const webContents = remote.getCurrentWebContents(); | ||
10 | const { | ||
11 | session | ||
12 | } = webContents; | ||
13 | |||
14 | window.onload = () => { | ||
15 | const title = document.querySelector('.window-title').innerHTML; | ||
16 | |||
17 | if (title && title.includes('Google Chrome 36+')) { | ||
18 | window.location.reload(); | ||
19 | } | ||
20 | }; | ||
21 | |||
22 | module.exports = Franz => { | ||
23 | session.flushStorageData(); | ||
24 | session.clearStorageData({ | ||
25 | storages: ['serviceworkers'] | ||
26 | }); | ||
27 | |||
28 | const getMessages = function getMessages() { | ||
29 | const elements = document.querySelectorAll('.CxUIE, .unread'); | ||
30 | let count = 0; | ||
31 | |||
32 | for (let i = 0; i < elements.length; i += 1) { | ||
33 | if (elements[i].querySelectorAll('*[data-icon="muted"]').length === 0) { | ||
34 | count += 1; | ||
35 | } | ||
36 | } | ||
37 | |||
38 | Franz.setBadge(count); | ||
39 | }; | ||
40 | |||
41 | Franz.injectCSS(path.join(__dirname, 'service.css')); | ||
42 | Franz.loop(getMessages); | ||
43 | }; | ||