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

feat: added support for Arc browser #36

Open
wants to merge 2 commits into
base: main
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ browser. By default, it will pick your default URL handler in MacOS. It supports
| `com.google.chrome` | Chrome | Opens a new private browsing window for the session. This allows for multiple profiles to be open simultaneously. |
| `com.brave.Browser` | Brave | Opens a new private browsing window for the session. This allows for multiple profiles to be open simultaneously. |
| `com.vivaldi.browser` | Vivaldi | Opens a new private browsing window for the session. This allows for multiple profiles to be open simultaneously. |
| `company.thebrowser.browser` | Arc (OSX only) | Opens a new private browsing window for the session. This allows for multiple profiles to be open simultaneously. |

You can pass arbitrary parameters when launching the browser by setting the optional `AWS_VAULT_PL_BROWSER_LAUNCH_OPTS`
environment variable. For example, if you wanted to start new `avli` browser windows maximized, you can set
Expand Down
15 changes: 15 additions & 0 deletions zsh-aws-vault.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ function avli() {
com.vivaldi.browser)
echo "${login_url}" | xargs -t nohup /Applications/Vivaldi.app/Contents/MacOS/Vivaldi %U $AWS_VAULT_PL_BROWSER_LAUNCH_OPTS --no-first-run --new-window --disk-cache-dir=$(mktemp -d /tmp/vivaldi.XXXXXX) --user-data-dir=$(mktemp -d /tmp/vivaldi.XXXXXX) > /dev/null 2>&1 &
;;
company.thebrowser.Browser | company.thebrowser.browser | arc) # Arc Browser
_open_arc_incog_window "${login_url}" 2>&1 &>/dev/null
;;
*)
# NOTE PRs welcome to add your browser
echo "Sorry, I don't know how to launch your default browser ($browser) :-("
Expand Down Expand Up @@ -167,3 +170,15 @@ function _find_browser() {
# TODO - other platforms
fi
}

function _open_arc_incog_window(){
url=$1
osascript -e "
tell application \"Arc\"
make new window with properties {incognito:true}
activate
delay(0.5) # wait for window to open
tell front window to make new tab with properties {URL:\"$url\"}
end tell
"
}