ua-parser-js/test/index.html
2024-12-17 07:17:03 +07:00

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.withFeatureCheck(), 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>