Russia has attacked Ukraine. We stand with Ukraine.
Partial income from our applications goes to support Ukraine.

app.loshadki

OpenIn 4.1

    • openin
    • sonoma
    • safari profiles
  • modified:
  • reading: 5 minutes

Safari Profiles! Woo-hoo! I have been using macOS Sonoma since the Developer Beta 1. And I am a hundred percent free from Chromium-based browsers. Sorry, no judgment here. If you love Arc, Chrome, Edge, Brave browsers, OpenIn will continue to support them. I don’t use a lot of extensions, so Safari always served me well.

Since Developer Beta 1, I have been working on supporting Safari Profiles with OpenIn. It was not easy, but I feel like I finally have something to share with you. Please read this post, and at the end you can find a link to TestFlight to try OpenIn 4.1 with Safari Profiles support.

I probably had a prototype of working with Safari Profiles a week after Apple released macOS Sonoma DB1, but spent the rest of the time polishing and trying to figure out how to make it easier to work with the Profiles.

How to configure OpenIn with Safari Profiles

In Safari, I have just two Profiles. One is a Default one, which is called Personal, and second is named OS.

Safari Profiles

In OpenIn I have added Safari 3 times as a browser. To configure each instance for various purposes. One is Safari Private, which is not new, and OpenIn supported it for a while.

OpenIn Browsers

And two others are Safari instances with specified profiles.

OpenIn Safari Personal

You will need to fill two things about Safari Profile. The Profile Number (an order, starting from 0), and the second one is the Profile Name, as you call it in Safari.

In my case, I have two profiles:

  • Personal with Number 0
  • OS with Number 1

I also use various Icon overlays to visually identify them.

Why is that so complicated? Safari, unfortunately, always was pretty bad about exporting APIs for extensions and developers. And there is no way to actually tell Safari to open a link in a specific profile, similarly to Chromium browser. So, instead, I am heavily relying on macOS Automation and scripting to automate all of that.

In my case, I have rules configured in the way that by default OpenIn opens links in Personal Profile, and when I hold ⌘ key, it will show me a browser selection from Safari (which is Personal), Safari Private and Safari (OS) (my work profile).

For that, I have two rules Cmd, that have selected Key Modifier ⌘, and Use applications -> Selected -> Safari, Safari Private, and Safari (OS)

OpenIn Cmd rule

And the second rule is Default, which does not have any conditions selected, and has only one application selected Safari

OpenIn Default rule

Keep in mind, order of Rules is important. The Cmd rule should be before of Default rule, as they are trying to get matched in order.

OpenIn Rules

After you start testing it, you will see that OpenIn Helper might ask for Automation permissions and Safari Automation Permissions.

Another new feature in Safari is Web Apps. You can create a Twitter or Reddit application. Let’s take a look at how to create a Reddit Web App, and open all reddit links in this application.

Open https://reddit.com in Safari (in profile you want). And from the Main Menu, click on File->Add to Dock…

Create Reddit app

You don’t have to keep the Web App in the Dock all the time, you can just right-click on it and unselect Keep in Dock. The app will be saved us ~/Applications/Reddit.app (in your user folder, not the /Applications).

In the OpenIn we will add this application as a Browser application as well.

  • Go to the OpenIn Settings.
  • Go to the Browsers tab.
  • Click on Add application…
  • Click on Browse… to find a ~/Applications/Reddit.app and add it to the list.

After that, we want to add a new Rule for Reddit links. And similarly to Apollo.app (🪦), we need just a small configuration to handle links received from Reddit in emails.

  • Go to the OpenIn Settings.
  • Go to the Browsers tab.
  • Click on Add rule…
  • Name it Reddit
  • Add two domains *.reddit.com and *.redditmail.com
  • Use applications Selected and select Reddit
  • Select Use custom scripts and click on Edit script, in the script window input the following
if (ctx.url.hostname.endsWith('redditmail.com')) {
    ctx.url.href = decodeURIComponent(ctx.url.pathname.split("/", 3)[2])
}
  • Save the rule.

OpenIn Reddit Rule

This rule already will be added to the top, so it will handle before Cmd and Default rule.

In the case of Twitter, it is a little bit easier, as you don’t need any custom scripts to catch links from emails, so you can only match domain *.twitter.com and select Twitter app.

OpenIn Widgets

I was never big on widgets that you could place on notification screen. But now with Sonoma, you can place them on Desktop. OpenIn comes now with two widgets, one is the browser selection widget, and the second one is the history.

OpenIn Widgets

Browser Launcher helper

Another annoying thing for me with Safari Profiles was that when you click Safari from the Dock, it will open a window with the last used Profile. So I have decided to make a helper that will help me to open a correct profile all the time.

Using OpenIn Menu Bar Menu select Browser Launcher…

OpenIn Menu Bar

You will see this app for the first time

OpenIn Browser Launcher

In the Dock, you can right-click and select Keep In Dock

Keep Browser Launcher in Dock

Now you can use this Helper application to always launch Safari with a specific profile.

Known issues

There are small bug fixes here and there as well, but also some known issues.

  • Locales. Considering that I am using Automation, and compare strings in a lot of places, I am not sure how well it will work with other locales. I am positive it might not work well with right-to-left languages. Please contact me, if you are affected by that.

How to install OpenIn 4.1

OpenIn 4.1 has been submitted to the App Store and SetApp.

How to submit a bug report or feedback

  • Preferable r/openin, so we can all be part of the conversation
  • If there is some personal information, question, please support@loshadki.app

Both application OpenIn Helper and OpenIn have the ability to export logs now.

  • In the case of OpenIn Helper, open the application from Launcher, until you see OpenIn Helper window. And you will see Export logs… button in the window.
  • In the case of OpenIn you can go to the About window and find Export logs… button.