> detect if the client is a browser
User agents are like journalists: there's no such thing as pretending to be one.
If someone writes their own client and says, "This is a browser", then it is one.