Closed marcelo-qrplus closed 1 year ago
Hi @marcelo-qrplus We already have implemented User Agent Client Hint. Try to do something like this to set the CH from your request into your code:
DeviceDetector.SetVersionTruncation(VersionTruncation.VERSION_TRUNCATION_NONE);
ar userAgent = Request.Headers["User-Agent"]; // change this to the useragent you want to parse
var headers = Request.Headers.ToDictionary(a => a.Key, a => a.Value.ToArray().FirstOrDefault());
var clientHints = ClientHints.Factory(headers); // client hints are optional
var dd = new DeviceDetector(userAgent,clientHints);
//var result = DeviceDetector.GetInfoFromUserAgent(userAgent, clientHints);
Nice tip!! Worked...sorry, I didn't know that!! Tks @totpero
Since Octuber-2022, Chrome has been reducing User-Agent string and now on May-2023 change it dramaticaly, causing undetectable device using this lib.
Source: https://developer.chrome.com/blog/user-agent-reduction-oct-2022-updates/
I will try to fix, but if anyone already know this lib and can do it faster, it would be great.
Tks, MC