aboutsummaryrefslogtreecommitdiffstats
path: root/recipes
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2021-09-12 18:37:25 +0530
committerLibravatar GitHub <noreply@github.com>2021-09-12 13:07:25 +0000
commit9897921a8f0340d95198a9eea597a7c368557506 (patch)
tree0f02029655399bad70a1e69583ea4ab62d661495 /recipes
parentNew recipe: 'devRant' (#706) (diff)
downloadferdium-recipes-9897921a8f0340d95198a9eea597a7c368557506.tar.gz
ferdium-recipes-9897921a8f0340d95198a9eea597a7c368557506.tar.zst
ferdium-recipes-9897921a8f0340d95198a9eea597a7c368557506.zip
New recipe: 'stackoverflow' (#707)
Diffstat (limited to 'recipes')
-rw-r--r--recipes/stackoverflow/icon.svg1
-rw-r--r--recipes/stackoverflow/index.js1
-rw-r--r--recipes/stackoverflow/package.json11
-rw-r--r--recipes/stackoverflow/service.css5
-rw-r--r--recipes/stackoverflow/webview.js20
5 files changed, 38 insertions, 0 deletions
diff --git a/recipes/stackoverflow/icon.svg b/recipes/stackoverflow/icon.svg
new file mode 100644
index 0000000..5298d4c
--- /dev/null
+++ b/recipes/stackoverflow/icon.svg
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120"><style>.st0{fill:#bcbbbb}.st1{fill:#f48023}</style><path class="st0" d="M84.4 93.8V70.6h7.7v30.9H22.6V70.6h7.7v23.2z"/><path class="st1" d="M38.8 68.4l37.8 7.9 1.6-7.6-37.8-7.9-1.6 7.6zm5-18l35 16.3 3.2-7-35-16.4-3.2 7.1zm9.7-17.2l29.7 24.7 4.9-5.9-29.7-24.7-4.9 5.9zm19.2-18.3l-6.2 4.6 23 31 6.2-4.6-23-31zM38 86h38.6v-7.7H38V86z"/></svg> \ No newline at end of file
diff --git a/recipes/stackoverflow/index.js b/recipes/stackoverflow/index.js
new file mode 100644
index 0000000..23607bd
--- /dev/null
+++ b/recipes/stackoverflow/index.js
@@ -0,0 +1 @@
module.exports = Ferdi => Ferdi;
diff --git a/recipes/stackoverflow/package.json b/recipes/stackoverflow/package.json
new file mode 100644
index 0000000..6b41dd5
--- /dev/null
+++ b/recipes/stackoverflow/package.json
@@ -0,0 +1,11 @@
1{
2 "id": "stackoverflow",
3 "name": "Stackoverflow",
4 "version": "0.0.1",
5 "license": "MIT",
6 "repository": "https://github.com/christianascone/franz-recipe-stackoverflow",
7 "config": {
8 "serviceURL": "https://stackoverflow.com",
9 "hasNotificationSound": true
10 }
11}
diff --git a/recipes/stackoverflow/service.css b/recipes/stackoverflow/service.css
new file mode 100644
index 0000000..b453fd4
--- /dev/null
+++ b/recipes/stackoverflow/service.css
@@ -0,0 +1,5 @@
1.app-wrapper-web .app {
2 width: 100% !important;
3 height: 100% !important;
4 top: 0 !important;
5}
diff --git a/recipes/stackoverflow/webview.js b/recipes/stackoverflow/webview.js
new file mode 100644
index 0000000..4d20768
--- /dev/null
+++ b/recipes/stackoverflow/webview.js
@@ -0,0 +1,20 @@
1const _path = _interopRequireDefault(require('path'));
2
3function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4
5module.exports = (Ferdi) => {
6 const getMessages = function getMessages() {
7 const elements = document.querySelectorAll('.CxUIE, .unread');
8 let count = 0;
9 for (let i = 0; i < elements.length; i += 1) {
10 if (elements[i].querySelectorAll('*[data-icon="muted"]').length === 0) {
11 count += 1;
12 }
13 }
14
15 Ferdi.setBadge(count);
16 };
17
18 Ferdi.loop(getMessages);
19 Ferdi.injectCSS(_path.default.join(__dirname, 'service.css'));
20};