Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.2.0 #11

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@

## Supported Browsers
* Chrome
* Chrome Canary
* Chromium
* Brave
* Edge
* Edge Canary
* Firefox
* Firefox Developer Edition

## Screenshot
![Workflow Screenshot](screenshot.png)
2 changes: 1 addition & 1 deletion browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
{
"app": "/Applications/Chromium.app",
"name": "chromium",
"name": "CHROMIUM",
"title": "Chromium",
"path": "/Library/Application Support/Chromium",
"icon": "chromium.icns"
Expand Down
Binary file added icons/chromium.icns
Binary file not shown.
15 changes: 9 additions & 6 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -142,22 +145,22 @@ https://www.iconfinder.com/icons/4263528/browser_site_staging_website_window_ico
<key>35B0D4F6-552C-48E6-B893-714093B535CE</key>
<dict>
<key>xpos</key>
<integer>400</integer>
<real>400</real>
<key>ypos</key>
<integer>95</integer>
<real>95</real>
</dict>
<key>89DDAF9B-84D4-40E8-A98B-32FCF1472372</key>
<dict>
<key>xpos</key>
<integer>80</integer>
<real>80</real>
<key>ypos</key>
<integer>95</integer>
<real>95</real>
</dict>
</dict>
<key>variablesdontexport</key>
<key>userconfigurationconfig</key>
<array/>
<key>version</key>
<string>2.1.0</string>
<string>2.2.0</string>
<key>webaddress</key>
<string>https://github.com/skydiver/</string>
</dict>
Expand Down
24 changes: 23 additions & 1 deletion lib/chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from lib.helpers import get_browsers_titles


################################################################################
# Browse trough Chromium based browser profiles

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo "through"

################################################################################
def get_chromium_profiles(browser, path):
browser_titles = get_browsers_titles('chromium')

Expand All @@ -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": {
Expand All @@ -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