diff options
author | 2021-09-19 00:41:52 +0200 | |
---|---|---|
committer | 2021-09-19 00:57:47 +0200 | |
commit | c5d2a889d4cb44f995d74051f83628b505383093 (patch) | |
tree | b1bab2b6d7f99ab00b0ca9860079f71472ac79ae /recipes/devRant | |
parent | Fix images opening in browser instead of in Discord (#712) (diff) | |
download | ferdium-recipes-c5d2a889d4cb44f995d74051f83628b505383093.tar.gz ferdium-recipes-c5d2a889d4cb44f995d74051f83628b505383093.tar.zst ferdium-recipes-c5d2a889d4cb44f995d74051f83628b505383093.zip |
fix: privileged API access
Privileged browser APIs should be accessed from webview.js via the Ferdi
parameter to the exported function.
If any service is broken (e.g., screen sharing), then most likely we
have to fix recipe.js or screenshare.js
Diffstat (limited to 'recipes/devRant')
-rw-r--r-- | recipes/devRant/package.json | 2 | ||||
-rw-r--r-- | recipes/devRant/webview.js | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/recipes/devRant/package.json b/recipes/devRant/package.json index 4aa3517..6dee2d6 100644 --- a/recipes/devRant/package.json +++ b/recipes/devRant/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "devRant", | 2 | "id": "devRant", |
3 | "name": "devRant", | 3 | "name": "devRant", |
4 | "version": "1.0.0", | 4 | "version": "1.0.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/emamut/recipe-devrant", | 6 | "repository": "https://github.com/emamut/recipe-devrant", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/devRant/webview.js b/recipes/devRant/webview.js index e7e41a5..62a47e6 100644 --- a/recipes/devRant/webview.js +++ b/recipes/devRant/webview.js | |||
@@ -9,11 +9,6 @@ setTimeout(() => { | |||
9 | } | 9 | } |
10 | }, 1000); | 10 | }, 1000); |
11 | 11 | ||
12 | window.addEventListener('beforeunload', async () => { | ||
13 | Ferdi.clearStorageData(['appcache', 'serviceworkers', 'cachestorage', 'websql', 'indexdb']); | ||
14 | Ferdi.releaseServiceWorkers(); | ||
15 | }); | ||
16 | |||
17 | module.exports = (Ferdi) => { | 12 | module.exports = (Ferdi) => { |
18 | const getMessages = function getMessages() { | 13 | const getMessages = function getMessages() { |
19 | const elements = document.querySelectorAll('.CxUIE, .unread, ._0LqQ'); | 14 | const elements = document.querySelectorAll('.CxUIE, .unread, ._0LqQ'); |
@@ -27,6 +22,11 @@ module.exports = (Ferdi) => { | |||
27 | Ferdi.setBadge(count); | 22 | Ferdi.setBadge(count); |
28 | }; | 23 | }; |
29 | 24 | ||
25 | window.addEventListener('beforeunload', async () => { | ||
26 | Ferdi.clearStorageData(['appcache', 'serviceworkers', 'cachestorage', 'websql', 'indexdb']); | ||
27 | Ferdi.releaseServiceWorkers(); | ||
28 | }); | ||
29 | |||
30 | Ferdi.loop(getMessages); | 30 | Ferdi.loop(getMessages); |
31 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | 31 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); |
32 | }; | 32 | }; |