How to control the right browser based on used workspace?

My default browser is Chromium. I tend to use different browsers and assign them to a Space. So for example Chromium is space 1 along with an item, Firefox in space 2 with terminal, Safari 3 with virtualbox, and so on. Browser plus terminal, for me gives a functional workspace. So far, so good.

However, I would like to have a different default browser in each space. So when I click on a link from some other app, it opens in the default browser in the current space, not only Chromium.

Also acceptable would be "open in the browser based on space number" or similar.

How can I make this happen?


You could try Choosy.


Perhaps involving less low-level coding than my other suggestion...

Another possible approach would be to create your own browser and set that as the default, and your browser passes URLs off to other browsers depending on what space is the active space.

If you can create an Automator app or AppleScript that accepts HTML files in such a way that you can set it to be the default browser, then this solution becomes fairly easy.

Your app can detect the current space using AppleScript. Then, just hard-code which browser the request should be forwarded to.