<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>
