summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/permissions-policy/resources/permissions-policy-battery.html
blob: 643d6a4ef5e3e9b4994a57e236fa5eae7ffc6581 (plain)
1
2
3
4
5
6
7
8
9
<script>
'use strict';

Promise.resolve().then(() => navigator.getBattery()).then(battery => {
  window.parent.postMessage({ type: 'availability-result', enabled: true }, '*');
}, error => {
  window.parent.postMessage({ type: 'availability-result', enabled: false }, '*');
});
</script>