Jump to content

'Open URL' in specific Google Chrome user profile


Recommended Posts

I use various Google Chrome user profiles ("People", per Chrome's parlance) to keep my personal and work browser environments separate. This means that if I open a Google Docs link tied to work on my personal Chrome user profile, then it will say "You don't have access". I therefore have to always make sure my active Chrome window is of the profile for which I'm logged into an account of.

 

At the same time, I have many simple Keyword --> Open URL workflows. How can I have an 'Open URL' action open not just in a specific browser, but a specific user profile of that browser? Is there a way to accomplish this?

Link to comment
4 minutes ago, Pennyworth said:

Is there a way to accomplish this?

 

Instead of using Alfred's Open URL action, you use a Run Script with Language = "/bin/bash" and put whatever command-line command is necessary to open a URL in your preferred profile.

Link to comment
2 minutes ago, deanishe said:

What does "noticeably slower" mean? It is, of course, slower. If it's a lot slower, then you may have misconfigured your shell.

 

"Noticeably" is probably an overstatement, but there's definitely a 1-2 second lag when opening URLs via /bin/bash instead of Alfred's native URL Opener (basically instantaneous).

Edited by Pennyworth
Link to comment
3 minutes ago, deanishe said:

Is it much faster if you use /usr/bin/open URL or leave off the --profile-directory argument?

 

I tried removing the '--profile-directory' argument from the bash script and it still lags by 2 seconds more than Alfred's Open URL action.

Link to comment
4 hours ago, Pennyworth said:

Yes, seems that way. Makes me wonder how Alfred's workflow action can get the job done faster than the system.

 

I suspect it’s because Alfred already has a persistent connection to the shared NSWorkspace, whereas your command/script needs to establish a new one every time it's run.

 

I don’t understand much about the way the whole macOS application runtime works, but when scripting applications, establishing the initial connection typically takes quite a long time, and the subsequent commands execute very quickly in comparison.

 

Perhaps @Andrew could explain it better/correct me if I'm wrong.

Link to comment
  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...