mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 07:58:45 +03:00
Add more test log
This commit is contained in:
parent
6095c4c370
commit
eba73ed6bb
@ -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);
|
||||
});
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user