mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-28 00:18:45 +03:00
31 lines
1.2 KiB
HTML
31 lines
1.2 KiB
HTML
<script src="../js/ua-parser.js"></script>
|
|
<script>
|
|
try {
|
|
UAParser().withClientHints().then(function (result) {
|
|
var uap = JSON.stringify(result, null, "\t");
|
|
document.write("<p><pre>UAParser.js:\n" + uap + "</pre></p>");
|
|
console.log('UAParser.js result: ', uap);
|
|
if (navigator.userAgentData) {
|
|
navigator.userAgentData
|
|
.getHighEntropyValues([
|
|
"brands",
|
|
"mobile",
|
|
"platform",
|
|
"architecture",
|
|
"bitness",
|
|
"formFactors",
|
|
"model",
|
|
"platformVersion",
|
|
"fullVersionList",
|
|
"wow64"
|
|
])
|
|
.then(function (values) {
|
|
document.write("<pre>Client Hints:\n" + JSON.stringify(values, null, "\t") + "</pre>");
|
|
console.log('Client Hints result: ', values);
|
|
});
|
|
};
|
|
});
|
|
} catch (e) {
|
|
document.write("Error: " + e);
|
|
}
|
|
</script> |