aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/lastpass
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/lastpass')
-rw-r--r--recipes/lastpass/.gitignore40
-rw-r--r--recipes/lastpass/README.md17
-rw-r--r--recipes/lastpass/darkmode.css6
-rw-r--r--recipes/lastpass/icon.pngbin0 -> 56568 bytes
-rw-r--r--recipes/lastpass/icon.svg1
-rw-r--r--recipes/lastpass/index.js8
-rw-r--r--recipes/lastpass/package.json14
-rw-r--r--recipes/lastpass/service.css5
-rw-r--r--recipes/lastpass/webview.js50
9 files changed, 141 insertions, 0 deletions
diff --git a/recipes/lastpass/.gitignore b/recipes/lastpass/.gitignore
new file mode 100644
index 0000000..3c678cc
--- /dev/null
+++ b/recipes/lastpass/.gitignore
@@ -0,0 +1,40 @@
1# https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore
2# General
3.DS_Store
4.AppleDouble
5.LSOverride
6
7# Icon must end with two \r
8Icon
9
10
11# Thumbnails
12._*
13
14# Files that might appear in the root of a volume
15.DocumentRevisions-V100
16.fseventsd
17.Spotlight-V100
18.TemporaryItems
19.Trashes
20.VolumeIcon.icns
21.com.apple.timemachine.donotpresent
22
23# Directories potentially created on remote AFP share
24.AppleDB
25.AppleDesktop
26Network Trash Folder
27Temporary Items
28.apdisk
29
30
31# https://raw.githubusercontent.com/github/gitignore/master/Global/VisualStudioCode.gitignore
32.vscode/*
33!.vscode/settings.json
34!.vscode/tasks.json
35!.vscode/launch.json
36!.vscode/extensions.json
37*.code-workspace
38
39# Local History for Visual Studio Code
40.history/
diff --git a/recipes/lastpass/README.md b/recipes/lastpass/README.md
new file mode 100644
index 0000000..171592c
--- /dev/null
+++ b/recipes/lastpass/README.md
@@ -0,0 +1,17 @@
1# meetfranz-lastpass
2This recipe allows you to use your lastpass vault in Franz.
3
4# How do I install this recipe?
5To install this new integration create the follow directory:
6Mac: ~/Library/Application Support/Franz/recipes/dev/meetfranz-lastpass
7Windows: %appdata%/Franz/recipes/dev/meetfranz-lastpass
8Linux: ~/.config/Franz/recipes/dev/meetfranz-lastpass
9
10Clone the repo in the /recipes/ directory (not in dev).
11
12That's all.
13
14# Check my-new.me
15
16# Notice
17Unfortunately, on windows can't see the caret. :( \ No newline at end of file
diff --git a/recipes/lastpass/darkmode.css b/recipes/lastpass/darkmode.css
new file mode 100644
index 0000000..342b01b
--- /dev/null
+++ b/recipes/lastpass/darkmode.css
@@ -0,0 +1,6 @@
1html {
2 -webkit-filter: invert(100%);
3 -moz-filter: invert(100%);
4 -o-filter: invert(100%);
5 -ms-filter: invert(100%);
6}
diff --git a/recipes/lastpass/icon.png b/recipes/lastpass/icon.png
new file mode 100644
index 0000000..ae3a9e3
--- /dev/null
+++ b/recipes/lastpass/icon.png
Binary files differ
diff --git a/recipes/lastpass/icon.svg b/recipes/lastpass/icon.svg
new file mode 100644
index 0000000..7248497
--- /dev/null
+++ b/recipes/lastpass/icon.svg
@@ -0,0 +1 @@
<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><rect fill="#d32d27" height="512" rx="15%" width="512"/><g fill="#fff"><circle cx="108" cy="256" r="44"/><circle cx="227" cy="256" r="44"/><circle cx="347" cy="256" r="44"/><rect height="192" rx="2%" width="20" x="428" y="160"/></g></svg> \ No newline at end of file
diff --git a/recipes/lastpass/index.js b/recipes/lastpass/index.js
new file mode 100644
index 0000000..dd10055
--- /dev/null
+++ b/recipes/lastpass/index.js
@@ -0,0 +1,8 @@
1"use strict";
2
3module.exports = Franz => class Messenger extends Franz {
4 overrideUserAgent() {
5 return window.navigator.userAgent.replace(/(Franz|Electron)([^\s]+\s)/g, '');
6 }
7
8}; \ No newline at end of file
diff --git a/recipes/lastpass/package.json b/recipes/lastpass/package.json
new file mode 100644
index 0000000..a551edf
--- /dev/null
+++ b/recipes/lastpass/package.json
@@ -0,0 +1,14 @@
1{
2 "id": "lastpass",
3 "name": "LastPass",
4 "version": "1.0.0",
5 "description": "LastPass integration",
6 "main": "index.js",
7 "author": "Janis Hau <janis@my-new.me>, Jonathan Winter <jonathanhwinter@gmail.com>",
8 "license": "MIT",
9 "config": {
10 "serviceURL": "https://lastpass.com/?ac=1&lpnorefresh=1",
11 "hasNotificationSound": true,
12 "message": "LastPass"
13 }
14} \ No newline at end of file
diff --git a/recipes/lastpass/service.css b/recipes/lastpass/service.css
new file mode 100644
index 0000000..2d8c1a6
--- /dev/null
+++ b/recipes/lastpass/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/lastpass/webview.js b/recipes/lastpass/webview.js
new file mode 100644
index 0000000..4fdd007
--- /dev/null
+++ b/recipes/lastpass/webview.js
@@ -0,0 +1,50 @@
1"use strict";
2
3const {
4 remote
5} = require('electron');
6
7const path = require('path');
8
9const webContents = remote.getCurrentWebContents();
10const {
11 session
12} = webContents;
13setTimeout(() => {
14 if (document.querySelector('body').innerHTML.includes('Google Chrome 36+')) {
15 window.location.reload();
16 }
17}, 1000);
18window.addEventListener('beforeunload', async () => {
19 try {
20 session.flushStorageData();
21 session.clearStorageData({
22 storages: ['appcache', 'serviceworkers', 'cachestorage', 'websql', 'indexdb']
23 });
24 const registrations = await window.navigator.serviceWorker.getRegistrations();
25 registrations.forEach(r => {
26 r.unregister();
27 console.log('ServiceWorker unregistered');
28 });
29 } catch (err) {
30 console.err(err);
31 }
32});
33
34module.exports = Franz => {
35 const getMessages = function getMessages() {
36 const elements = document.querySelectorAll('.CxUIE, .unread');
37 let count = 0;
38
39 for (let i = 0; i < elements.length; i += 1) {
40 if (elements[i].querySelectorAll('*[data-icon="muted"]').length === 0) {
41 count += 1;
42 }
43 }
44
45 Franz.setBadge(count);
46 };
47
48 Franz.injectCSS(path.join(__dirname, 'service.css'));
49 Franz.loop(getMessages);
50}; \ No newline at end of file