aboutsummaryrefslogtreecommitdiffstats
path: root/uncompressed/googlemeet/webview.js
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2020-03-06 12:27:00 +0100
committerLibravatar vantezzen <hello@vantezzen.io>2020-03-06 12:27:00 +0100
commitf4a81fefe28c15bddba15a0a38a8bfb8019638a5 (patch)
treef193c26b839d6adebd423f3c53f6461d44de5bab /uncompressed/googlemeet/webview.js
parentAdd verify-all script (diff)
downloadferdium-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.js43
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
3const {
4 remote
5} = require('electron');
6
7const path = require('path');
8
9const webContents = remote.getCurrentWebContents();
10const {
11 session
12} = webContents;
13
14window.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
22module.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};