app.loshadki

OpenIn 4.1

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

Safari Profiles! Woo-hoo! I have been using macOS Sonoma since Developer Beta 1. And I am one hundred percent free from Chromium-based browsers. Sorry, no judgment here. If you love Arc, Chrome, Edge, or Brave browsers, OpenIn will continue to support them. I don’t use a lot of extensions, so Safari has 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 working with Safari Profiles a week after Apple released macOS Sonoma DB1, but I spent the rest of the time polishing and trying to figure out how to make it easier to work with Profiles.

How to configure OpenIn with Safari Profiles

In Safari, I have just two Profiles. One is the default one, which is called Personal, and the 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 has supported it for a while.

OpenIn Browsers

And the two others are Safari instances with specified profiles.

OpenIn Safari Personal

You will need to fill in two things about the 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, has always been 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, similar to Chromium browsers. So, instead, I am heavily relying on macOS Automation and scripting to automate all of that.

In my case, I have rules configured so that by default OpenIn opens links in the Personal Profile, and when I hold the ⌘ 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, which has the 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, the order of Rules is important. The Cmd rule should be before the Default rule, as they try 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 the 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 as ~/Applications/Reddit.app (in your user folder, not /Applications).

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

  • Go to OpenIn Settings.
  • Go to the Browsers tab.
  • Click on Add application…
  • Click on Browse… to find ~/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 OpenIn Settings.
  • Go to the Rules 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 will already be added to the top, so it will be handled before the Cmd and Default rules.

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 the domain *.twitter.com and select the Twitter app.

OpenIn Widgets

I was never big on widgets that you could place on the notification screen. But now with Sonoma, you can place them on the Desktop. OpenIn now comes 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 decided to make a helper that will help me open the correct profile all the time.

Using the 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 comparing 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

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

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

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