@ratushniak-tenexti/ua-hints
v1.0.7
Published
Generate Client Hints (Sec-CH-UA) HTTP headers that match a given browser User-Agent string.
Maintainers
Readme
ua-hints
It generates Sec-CH-UA-* headers for the provided
'user-agent'.
Install
$ npm install ua-hints --saveUsage
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': '"Not_A Brand";v="8", "Chromium";v="120", "Google 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': '"Not_A Brand";v="8.0.0.0", "Chromium";v="120.0.6099.109", "Google Chrome";v="120.0.6099.109"',
// 'Sec-CH-UA-WoW64': '?1',
// 'Sec-CH-UA-Form-Factors': '["Desktop"]'
// }The library implements Chromium's GREASEing strategy (¹)(²) includes intentionally incorrect data to prevent ossification attacks.
License
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
