Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

As some people might know, the default behavior for external links of Google Chrome is quite bad. I'm using Spaces, and opening a link in some application outside of Google Chrome while being on a different Space than the last used window of Chrome results in Chrome switching to the last focused window.

This behavior is just bad.

I want to change this behavior. On Windows, this is possible: How can you configure Chrome to open new browser instances in new windows rather than in a tab?

Sadly, I don't think this is possible on OS X Snow Leopard.

I'm already using a tool called RCDefaultApps. This is a system-control panel where I can specify default applications for different protocols. It just lacks the feature to specify additional command line arguments for the default application.

Can anyone help me there? Every hacks (aside from creating a custom Chromium build) are acceptable.

share|improve this question

4 Answers 4

up vote 7 down vote accepted

You can try using the AppleScript found on this page.

I just tried it out and it perfectly works fine in Chrome 12.0.742.122.

It's extremely easy to set up:

  • download the Bundle archive
  • double click it to unpack it
  • double click on OpenUrlInNewChromeWindow
  • open Safari and set the new "Browser" as the default browser in the Preferences.

new default browser

share|improve this answer
    
This seems to introduce a (very short) delay before opening the window, but it's exactly what I was searching for. Thanks! –  the-kenny Aug 2 '11 at 16:19
    
This applescript works wonderfully. –  Nelson Sep 7 '11 at 16:06
    
looks great, but the links to the script are now broken. Is it available elsewhere? –  Mike Eng Jan 7 at 19:06

I've been unable to make it work too.

What I was trying to do was to use the following command:

open Google\ Chrome.app/ --new --args new-window www.google.com

But that opens a new Chrome that instantly closes (if Chrome is already open). I was planning on wrapping the above command within a bash script and then let it have arguments (for the URL).

But since the above command failed to work, I'm still thinking about this. So far I believe it's not "possible" without some modification to Chromium, but I might be overlooking something. It's early and I haven't had coffee yet. ;)

share|improve this answer
    
Yup, I tried that too. (with "google.com"; instead of "Google Chrome.app") Both version don't work. –  the-kenny Mar 3 '11 at 16:38

This works on Mavericks:

open /Applications/Google\ Chrome.app --new --args --new-window https\://www.google.ca

followed by:

osascript -e 'activate application "Google Chrome"'

Tested in sh, bash and zsh.

For some reason, if I try to put them on the same line like so:

/usr/bin/open /Applications/Google\ Chrome.app --new --args --new-window www.google.ca; /usr/bin/osascript -e 'activate application "Google Chrome"'

...the second part doesn't complete. I assume that's because it's too close on the heels of the first command. So try this:

/usr/bin/open /Applications/Google\ Chrome.app --new --args --new-window www.google.ca; sleep 1; /usr/bin/osascript -e 'activate application "Google Chrome"'

Note that you don't need to specify the http:// part of the url at the end for it to work, but if you do, you need to escape the colon (:).

To make this script my default browser, I created an applescript and exported it as an application and then opened Safari Preferences and set the application as my default browser. Here's the Applescript code:

on open location theURL
  do shell script "/Users/[myusername]/bin/openUrlInNewChromeWindow.sh " & theURL
end open location

Replace [myusername] with your actual username.

share|improve this answer
    
The reason I prefer this solution to the one by mwidmann is that this one will close after opening the URL, whereas the the other one seemed to need to stay open in order to work. This meant that OpenUrlInNewChromeWindow was always in the CMD-Tab list of running apps, and every time I opened a URL, I had to tab twice to get back to the previous app. –  Dave Nov 4 at 4:36

The --new-window command option did it for me. ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window https://www.google.com)

share|improve this answer
    
This is for Windows — please edit to refer to OS X. –  grgarside Jan 13 at 19:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.