running browser with specific flags
i'm trying to open links using Choosy in a browser with specific flags/arguments e.g. to use a specific browser profile.
unfortunately, Choosy only allows you to pick a browser .app -- it would be nice if you could enter a path to a binary and specify flags that way.
to get around this limitation, i tried making a bash script wrapper bundled as an app.
this app has the following file structure (simplest possible app):
chrometest.app/Contents/MacOS/chrometest
this bash script contains the following:
!/usr/bin/env bash
capture args passed for testing purposes
echo "$@" >> /Users/synth/chrometestoutput.txt
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --incognito --profile-directory="Profile 2" "$@"
the following command works as expected: open ./chrometest.app --args www.google.com
it opens google in the specified profile in incognito mode.
however, it doesn't work when i set chrometest.app as my browser of choice in Choosy.
for example, making a link to www.google.com in Microsoft Word and clicking it with Choosy enabled launches the desired profile but opens a blank page instead of going to google.
the URL doesn't seem to be properly passed to chrometest.app, and this is verified by inspecting chrometestoutput.txt -- only the process serial number (PSN) argument seems to get passed.
do you have any hints for me?
thanks
I’m working on features for launching Google Chrome in Incognito mode, or with a specific profile. I expect those to be in the next release.
For other flags you want to pass to your browser, you can follow these instructions to create a custom app that can handle URL requests: https://gist.github.com/georgebrock/9ab3d83bf160b7c1c2b0
There are other requests on the forum for Incognito and profiles, so I’m marking this one as declined to avoid duplicates.
Thanks for the feedback!
-
Jason Gill commented
FWIW I still think this would be a great idea. I'm not looking for another way to solve this, I'm looking for a convenient way to solve this, and since I already bought an app (Choosy) it would be nice if it were integrated.
-
bic boi commented
i don't have a good understanding of how links are passed to an app, but somehow i got it working.
by making an actual app for my script with an Info.plist specifying a bundle identifier etc, it seems ok.i made my bash script as above and used this to quickly make an app out of it:
http://www.sveinbjorn.org/platypus
here are the settings i used:
https://i.imgur.com/orgcyKz.pngperhaps this will help someone