blob: 9c9b5322331ac7ec7721b09468a5873420f1b6c3 [file]
<!--
Copyright 2021 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<script>
function logValue(key, value) {
const d = document.createElement('div');
d.append(key + '=');
const s = document.createElement('span');
s.id = key;
s.append(value);
d.appendChild(s);
document.body.appendChild(d);
}
function dump() {
logValue('res-ua', navigator.userAgent);
logValue('res-mobile', navigator.userAgentData.mobile);
logValue('res-num-brands', navigator.userAgentData.brands.length);
for (let i = 0; i < navigator.userAgentData.brands.length; ++i) {
logValue('res-brand-' + i + '-name', navigator.userAgentData.brands[i].brand);
logValue('res-brand-' + i + '-version', navigator.userAgentData.brands[i].version);
}
navigator.userAgentData.getHighEntropyValues(['platform', 'platformVersion', 'architecture', 'model', 'uaFullVersion', 'fullVersionList', 'formFactors']).then(finishDump);
}
function finishDump(uaDataValues) {
logValue('res-platform', uaDataValues.platform);
logValue('res-platform-version', uaDataValues.platformVersion);
logValue('res-architecture', uaDataValues.architecture);
logValue('res-model', uaDataValues.model);
logValue('res-ua-full-version', uaDataValues.uaFullVersion);
logValue('res-num-full-version-list', uaDataValues.fullVersionList.length);
for (let i = 0; i < uaDataValues.fullVersionList.length; ++i) {
logValue('res-full-version-list-' + i + '-name', uaDataValues.fullVersionList[i].brand);
logValue('res-full-version-list-' + i + '-version', uaDataValues.fullVersionList[i].version);
}
logValue('res-num-form-factors', uaDataValues.formFactors.length);
for (let i = 0; i < uaDataValues.formFactors.length; ++i) {
logValue('res-form-factors-' + i, uaDataValues.formFactors[i]);
}
logValue('res-dump-done', true);
}
</script>
<body onload='dump()'>