WebKit team shares development techniques on Safari profiles API.
An essential requirement to implement profiles is to have separate containers for website data. In WebKit, this means the client needs to have different data stores. Before macOS 14 and iOS 17, WebKit clients could have multiple non-persistent data stores, but only one persistent data store — the default one. Non-persistent data stores do not store data to disk, so they cannot be retained across sessions.
In macOS 14 and iOS 17, we’ve introduced a new set of APIs to let clients create and manage multiple persistent data stores. Let’s take a look at how to use them to build a “profiles” feature for your app.WebKit Blog
WebKit Blog: Building Profiles with new WebKit API