summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/feature-policy/resources/feature-policy-generic-sensor.html
blob: 59652e2e7ae0056a6cc4be7f004b6d0151fb9d44 (plain)
1
2
3
4
5
6
7
8
9
10
11
<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>