chromium/third_party/blink/web_tests/external/wpt/permissions-policy/resources/permissions-policy-generic-sensor.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>