It generates Sec-CH-UA-* headers for the provided
'user-agent'
.
$ npm install ua-hints --save
Giving an user agent as input, such as:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.6099.109 Safari/537.36
This library returns The User-Agent Client Hints detected:
const uaHints = require('ua-hints')
uaHint('Mozilla/5.0 (Windows NT 10.0; Win64; x64; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.6099.109 Safari/537.36')
// {
// 'sec-ch-ua': '"Chrome";v="120"',
// 'sec-ch-ua-mobile': '?0',
// 'sec-ch-ua-platform': '"Windows"',
// 'sec-ch-ua-platform-version': '"10"',
// 'sec-ch-ua-arch': '"x86"',
// 'sec-ch-ua-bitness': '"64"',
// 'sec-ch-ua-full-version': '"120.0.6099.109"',
// 'sec-ch-ua-full-version-list': '"Chrome";v="120.0.6099.109"',
// 'sec-ch-ua-wow64': '?1',
// 'sec-ch-ua-form-factors': '["Desktop"]'
// }
The library implementing Chromium GREASE(¹)(²) includes intentionally incorrect data to prevent ossification attacks.
ua-hints © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.
kikobeats.com · GitHub Kiko Beats · Twitter @kikobeats