diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-09-19 00:41:52 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-09-19 00:57:47 +0200 |
commit | c5d2a889d4cb44f995d74051f83628b505383093 (patch) | |
tree | b1bab2b6d7f99ab00b0ca9860079f71472ac79ae /recipes/whatsapp/webview.js | |
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/whatsapp/webview.js')
-rw-r--r-- | recipes/whatsapp/webview.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/recipes/whatsapp/webview.js b/recipes/whatsapp/webview.js index 3df34e3..fb1a20b 100644 --- a/recipes/whatsapp/webview.js +++ b/recipes/whatsapp/webview.js | |||
@@ -2,11 +2,6 @@ const _path = _interopRequireDefault(require('path')); | |||
2 | 2 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
4 | 4 | ||
5 | window.addEventListener('beforeunload', async () => { | ||
6 | Ferdi.clearStorageData(['appcache', 'serviceworkers', 'cachestorage', 'websql', 'indexdb']); | ||
7 | Ferdi.releaseServiceWorkers(); | ||
8 | }); | ||
9 | |||
10 | module.exports = Ferdi => { | 5 | module.exports = Ferdi => { |
11 | const getMessages = function getMessages() { | 6 | const getMessages = function getMessages() { |
12 | let count = 0; | 7 | let count = 0; |
@@ -34,6 +29,11 @@ module.exports = Ferdi => { | |||
34 | Ferdi.setBadge(count, indirectCount); | 29 | Ferdi.setBadge(count, indirectCount); |
35 | }; | 30 | }; |
36 | 31 | ||
32 | window.addEventListener('beforeunload', async () => { | ||
33 | Ferdi.clearStorageData(['appcache', 'serviceworkers', 'cachestorage', 'websql', 'indexdb']); | ||
34 | Ferdi.releaseServiceWorkers(); | ||
35 | }); | ||
36 | |||
37 | Ferdi.loop(getMessages); | 37 | Ferdi.loop(getMessages); |
38 | 38 | ||
39 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | 39 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); |