servo/tests/wpt/web-platform-tests/feature-policy/resources/feature-policy-generic-sensor.html

11 lines
255 B
HTML

<script>
"use strict";
try {
const sensorName = location.hash.substring(1);
const sensor = new window[sensorName]();
window.parent.postMessage({ enabled: true }, "*");
} catch (e) {
window.parent.postMessage({ enabled: false }, "*");
}
</script>