So, looks like you didn’t actually try it in Safari? Still needs the resolver hack. However with a modified proxy.pac served from caddy (Safari needs SOCKS, does not respect SOCKS5), I could get it working without privoxy, thank you for that!
cat /opt/homebrew/etc/Caddyfile
{
admin off
http_port 2019
auto_https off
}
http://localhost:2019
header /proxy.pac Content-Type application/x-ns-proxy-autoconfig
respond /proxy.pac 200 {
body `function FindProxyForURL(url, host) { if (shExpMatch(host, "*.onion"))
{ return "SOCKS5 127.0.0.1:9050;SOCKS 127.0.0.1:9050"; } return "DIRECT"; }
`
close
}