Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Safari profiles support #531

zodo started this conversation in General
Discussion options

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:

  1. You need N subdomains serving redirect pages, e.g. work.example.com, personal.example.com. Each page just redirects to #fragment in url, e.g. when opened with work.example.com/#{encodedTargetUrl} JS just redirects to target URL. One wildcard subdomain is even better
  2. In Safari settings, manually select a profile for each subdomain (work.example.com -> Work, personal.example.com -> Personal).
  3. 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") },
 ],
};
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /