aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/lastpass
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-09-19 00:41:52 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-09-19 00:57:47 +0200
commitc5d2a889d4cb44f995d74051f83628b505383093 (patch)
treeb1bab2b6d7f99ab00b0ca9860079f71472ac79ae /recipes/lastpass
parentFix images opening in browser instead of in Discord (#712) (diff)
downloadferdium-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/lastpass')
-rw-r--r--recipes/lastpass/package.json2
-rw-r--r--recipes/lastpass/webview.js10
2 files changed, 6 insertions, 6 deletions
diff --git a/recipes/lastpass/package.json b/recipes/lastpass/package.json
index 75632bd..eed8f9e 100644
--- a/recipes/lastpass/package.json
+++ b/recipes/lastpass/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "lastpass", 2 "id": "lastpass",
3 "name": "LastPass", 3 "name": "LastPass",
4 "version": "2.2.1", 4 "version": "2.2.2",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://lastpass.com/?ac=1&lpnorefresh=1", 7 "serviceURL": "https://lastpass.com/?ac=1&lpnorefresh=1",
diff --git a/recipes/lastpass/webview.js b/recipes/lastpass/webview.js
index 4a92e0c..96e92ff 100644
--- a/recipes/lastpass/webview.js
+++ b/recipes/lastpass/webview.js
@@ -8,11 +8,6 @@ setTimeout(() => {
8 } 8 }
9}, 1000); 9}, 1000);
10 10
11window.addEventListener('beforeunload', async () => {
12 Ferdi.clearStorageData(['appcache', 'serviceworkers', 'cachestorage', 'websql', 'indexdb']);
13 Ferdi.releaseServiceWorkers();
14});
15
16module.exports = Ferdi => { 11module.exports = Ferdi => {
17 const getMessages = function getMessages() { 12 const getMessages = function getMessages() {
18 const elements = document.querySelectorAll('.CxUIE, .unread'); 13 const elements = document.querySelectorAll('.CxUIE, .unread');
@@ -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 31
32 Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); 32 Ferdi.injectCSS(_path.default.join(__dirname, 'service.css'));