Skip to content

Commit

Permalink
Add more test log
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Dec 17, 2024
1 parent 6095c4c commit eba73ed
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down
27 changes: 24 additions & 3 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -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);
}
Expand Down

0 comments on commit eba73ed

Please sign in to comment.