diff options
-rw-r--r-- | recipes/tiktok/icon.svg | 1 | ||||
-rw-r--r-- | recipes/tiktok/index.js | 1 | ||||
-rw-r--r-- | recipes/tiktok/package.json | 9 | ||||
-rw-r--r-- | recipes/tiktok/webview.js | 22 | ||||
-rw-r--r-- | recipes/whatsapp/package.json | 2 | ||||
-rw-r--r-- | recipes/whatsapp/webview-unsafe.js | 2 |
6 files changed, 35 insertions, 2 deletions
diff --git a/recipes/tiktok/icon.svg b/recipes/tiktok/icon.svg new file mode 100644 index 0000000..c043135 --- /dev/null +++ b/recipes/tiktok/icon.svg | |||
@@ -0,0 +1 @@ | |||
<svg width="512px" height="512px" viewBox="0 0 512 512" id="icons" xmlns="http://www.w3.org/2000/svg"><path d="M412.19,118.66a109.27,109.27,0,0,1-9.45-5.5,132.87,132.87,0,0,1-24.27-20.62c-18.1-20.71-24.86-41.72-27.35-56.43h.1C349.14,23.9,350,16,350.13,16H267.69V334.78c0,4.28,0,8.51-.18,12.69,0,.52-.05,1-.08,1.56,0,.23,0,.47-.05.71,0,.06,0,.12,0,.18a70,70,0,0,1-35.22,55.56,68.8,68.8,0,0,1-34.11,9c-38.41,0-69.54-31.32-69.54-70s31.13-70,69.54-70a68.9,68.9,0,0,1,21.41,3.39l.1-83.94a153.14,153.14,0,0,0-118,34.52,161.79,161.79,0,0,0-35.3,43.53c-3.48,6-16.61,30.11-18.2,69.24-1,22.21,5.67,45.22,8.85,54.73v.2c2,5.6,9.75,24.71,22.38,40.82A167.53,167.53,0,0,0,115,470.66v-.2l.2.2C155.11,497.78,199.36,496,199.36,496c7.66-.31,33.32,0,62.46-13.81,32.32-15.31,50.72-38.12,50.72-38.12a158.46,158.46,0,0,0,27.64-45.93c7.46-19.61,9.95-43.13,9.95-52.53V176.49c1,.6,14.32,9.41,14.32,9.41s19.19,12.3,49.13,20.31c21.48,5.7,50.42,6.9,50.42,6.9V131.27C453.86,132.37,433.27,129.17,412.19,118.66Z"/></svg> \ No newline at end of file | |||
diff --git a/recipes/tiktok/index.js b/recipes/tiktok/index.js new file mode 100644 index 0000000..dd41f72 --- /dev/null +++ b/recipes/tiktok/index.js | |||
@@ -0,0 +1 @@ | |||
module.exports = Ferdium => Ferdium; | |||
diff --git a/recipes/tiktok/package.json b/recipes/tiktok/package.json new file mode 100644 index 0000000..5d8e794 --- /dev/null +++ b/recipes/tiktok/package.json | |||
@@ -0,0 +1,9 @@ | |||
1 | { | ||
2 | "id": "tiktok", | ||
3 | "name": "Tiktok", | ||
4 | "version": "1.0.0", | ||
5 | "license": "MIT", | ||
6 | "config": { | ||
7 | "serviceURL": "https://tiktok.com" | ||
8 | } | ||
9 | } | ||
diff --git a/recipes/tiktok/webview.js b/recipes/tiktok/webview.js new file mode 100644 index 0000000..6f78019 --- /dev/null +++ b/recipes/tiktok/webview.js | |||
@@ -0,0 +1,22 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | ||
4 | return obj && obj.__esModule ? obj : { default: obj }; | ||
5 | } | ||
6 | |||
7 | module.exports = Ferdium => { | ||
8 | const getMessages = () => { | ||
9 | const selNotifications = document.querySelector("div.tiktok-1b4xcc5-DivHeaderInboxContainer.e18kkhh40 > sup"); | ||
10 | const selDM = document.querySelector("div.tiktok-1ibfxbr-DivMessageIconContainer.e1nx07zo0 > sup"); | ||
11 | |||
12 | const countNotifications = (selNotifications != null) ? Ferdium.safeParseInt(selNotifications.outerText) : 0; | ||
13 | const countDM = (selDM != null) ? Ferdium.safeParseInt(selDM.outerText) : 0; | ||
14 | |||
15 | const count = countNotifications + countDM; | ||
16 | |||
17 | Ferdium.setBadge(count); | ||
18 | }; | ||
19 | Ferdium.loop(getMessages); | ||
20 | |||
21 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
22 | }; | ||
diff --git a/recipes/whatsapp/package.json b/recipes/whatsapp/package.json index 3693582..8ddccfe 100644 --- a/recipes/whatsapp/package.json +++ b/recipes/whatsapp/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "whatsapp", | 2 | "id": "whatsapp", |
3 | "name": "WhatsApp", | 3 | "name": "WhatsApp", |
4 | "version": "3.4.2", | 4 | "version": "3.4.3", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://web.whatsapp.com", | 7 | "serviceURL": "https://web.whatsapp.com", |
diff --git a/recipes/whatsapp/webview-unsafe.js b/recipes/whatsapp/webview-unsafe.js index 726014f..b6b365b 100644 --- a/recipes/whatsapp/webview-unsafe.js +++ b/recipes/whatsapp/webview-unsafe.js | |||
@@ -1,6 +1,6 @@ | |||
1 | const PUSHSTATE_NORMAL = 0; | 1 | const PUSHSTATE_NORMAL = 0; |
2 | const PUSHSTATE_THROTTLE = 1; | 2 | const PUSHSTATE_THROTTLE = 1; |
3 | const PUSHSTATE_DISABLE = 2; | 3 | // const PUSHSTATE_DISABLE = 2; |
4 | 4 | ||
5 | const PUSHSTATE_THROTTLE_THRESHOLD = 1; | 5 | const PUSHSTATE_THROTTLE_THRESHOLD = 1; |
6 | 6 | ||