diff --git a/README.md b/README.md index c35d487..6e0ddf1 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,13 @@ ## Supported Browsers * Chrome +* Chrome Canary * Chromium * Brave * Edge +* Edge Canary * Firefox +* Firefox Developer Edition ## Screenshot ![Workflow Screenshot](screenshot.png) diff --git a/browsers.json b/browsers.json index 6aed295..77d6555 100644 --- a/browsers.json +++ b/browsers.json @@ -16,7 +16,7 @@ }, { "app": "/Applications/Chromium.app", - "name": "chromium", + "name": "CHROMIUM", "title": "Chromium", "path": "/Library/Application Support/Chromium", "icon": "chromium.icns" diff --git a/icons/chromium.icns b/icons/chromium.icns new file mode 100644 index 0000000..d2d7296 Binary files /dev/null and b/icons/chromium.icns differ diff --git a/info.plist b/info.plist index 60eb377..f52c3b2 100644 --- a/info.plist +++ b/info.plist @@ -100,6 +100,9 @@ if [[ "$browser" == "CHROME_CANARY" ]]; then elif [[ "$browser" == "BRAVE" ]]; then open -n -a "Brave Browser" --args --profile-directory="$profile" +elif [[ "$browser" == "CHROMIUM" ]]; then + open -n -a "Chromium" --args --profile-directory="$profile" + elif [[ "$browser" == "CHROME" ]]; then open -n -a "Google Chrome" --args --profile-directory="$profile" @@ -142,22 +145,22 @@ https://www.iconfinder.com/icons/4263528/browser_site_staging_website_window_ico 35B0D4F6-552C-48E6-B893-714093B535CE xpos - 400 + 400 ypos - 95 + 95 89DDAF9B-84D4-40E8-A98B-32FCF1472372 xpos - 80 + 80 ypos - 95 + 95 - variablesdontexport + userconfigurationconfig version - 2.1.0 + 2.2.0 webaddress https://github.com/skydiver/ diff --git a/lib/chromium.py b/lib/chromium.py index 910f429..1ad6788 100644 --- a/lib/chromium.py +++ b/lib/chromium.py @@ -3,6 +3,9 @@ from lib.helpers import get_browsers_titles +################################################################################ +# Browse trough Chromium based browser profiles +################################################################################ def get_chromium_profiles(browser, path): browser_titles = get_browsers_titles('chromium') @@ -22,7 +25,12 @@ def get_chromium_profiles(browser, path): if folder != 'System Profile' and os.path.isfile(file): with open(file) as f: data = json.load(f) - browser_profile = data['profile']['name'] + + if browser['name'] == 'CHROMIUM': + chromium_profile = get_profile_name(path, folder) + browser_profile = chromium_profile if chromium_profile is not None else data['profile']['name'] + else: + browser_profile = data['profile']['name'] profiles.append({ "icon": { @@ -34,3 +42,17 @@ def get_chromium_profiles(browser, path): }) return profiles + + +################################################################################ +# Chromium stores the profile name in Local State file +################################################################################ +def get_profile_name(path, folder): + local_state_file = "{}/Local State".format(path) + + with open(local_state_file) as f: + data = json.load(f) + if folder in data['profile']['info_cache']: + return data['profile']['info_cache'][folder]['name'] + + return None