Add more test log

This commit is contained in:
Faisal Salman 2024-12-17 07:17:03 +07:00
parent 6095c4c370
commit eba73ed6bb
2 changed files with 25 additions and 4 deletions

View File

@ -99,7 +99,7 @@ $(document)
$('#demo-result').get(0).scrollIntoView();
updateDemo(UAParser(qs));
} else {
UAParser().withClientHints().then(function(result) {
(UAParser().withFeatureCheck()).withClientHints().then(function(result) {
updateDemo(result);
});
}

View File

@ -1,9 +1,30 @@
<script src="../js/ua-parser.js"></script>
<script>
try {
var result = JSON.stringify(UAParser(), null, "\t");
document.write("<pre>" + result + "</pre>");
console.log(result);
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);
}