Fixes https://github.com/microsoft/playwright/issues/32288 --------- Signed-off-by: Max Schmitt <max@schmitt.mx> Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
27 lines
734 B
HTML
27 lines
734 B
HTML
<script src='modernizr.js'></script>
|
|
<body></body>
|
|
<script>
|
|
function serialize(value) {
|
|
if (typeof value !== 'object')
|
|
return value;
|
|
const copy = {};
|
|
for (const key in value) {
|
|
if (typeof value[key] === 'function')
|
|
continue;
|
|
if (key.startsWith('_'))
|
|
continue;
|
|
copy[key] = serialize(value[key]);
|
|
}
|
|
return copy;
|
|
}
|
|
const report = serialize(Modernizr);
|
|
|
|
report['devicemotion2'] = 'ondevicemotion' in window;
|
|
report['deviceorientation2'] = 'orientation' in window;
|
|
report['deviceorientation3'] = 'ondeviceorientation' in window;
|
|
|
|
document.body.style.whiteSpace = 'pre';
|
|
document.body.textContent = JSON.stringify(report, undefined, 2);
|
|
window.report = JSON.parse(document.body.textContent);
|
|
</script>
|