-
-
Notifications
You must be signed in to change notification settings - Fork 201
-
Would love to see native Safari profile support. Apple exposes no API for it, but there's a workaround I already use: Safari allows to choose a profile for a domain, so route through per-profile subdomains:
- You need N subdomains serving redirect pages, e.g.
work.example.com,personal.example.com. Each page just redirects to#fragmentin url, e.g. when opened withwork.example.com/#{encodedTargetUrl}JS just redirects to target URL. One wildcard subdomain is even better - In Safari settings, manually select a profile for each subdomain (
work.example.com-> Work,personal.example.com-> Personal). - Finicky rewrites a match to that subdomain -> Safari opens it in the right profile -> page redirects to the real URL.
Finicky config example:
const route = (profile) => (url) => `https://${profile}.example.com/#${encodeURIComponent(url.href)}`; const ghRepo = (name) => (url) => url.host === "github.com" && url.pathname.split("/")[1] === name; export default { defaultBrowser: "Safari", rewrite: [ { match: ghRepo("workstuff"), url: route("work") }, { match: ghRepo("fun"), url: route("personal") }, ], };
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment