-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.py
executable file
·28 lines (21 loc) · 757 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
import os
import json
from lib.chromium import get_chromium_profiles
from lib.firefox import get_firefox_profiles
from lib.helpers import get_browsers
home = os.path.expanduser("~")
supported_browsers = get_browsers()
profiles = []
for browser in supported_browsers['chromium']:
if os.path.exists(browser['app']):
path = "{}/{}".format(home, browser['path'])
prof = get_chromium_profiles(browser, path)
profiles += prof
for browser in supported_browsers['firefox']:
if os.path.exists(browser['app']):
path = "{}/{}".format(home, browser['path'])
prof = get_firefox_profiles(browser, path)
profiles += prof
result = json.dumps({"items": profiles}, indent=2)
print(result)