chromium/third_party/blink/web_tests/wpt_internal/digital-goods/resources/permissions-policy-helper.html

<!DOCTYPE html>
<html>
<body>
  <script type="module">
    import './mock-digital-goods-service.js';

    window.addEventListener('load', async () => {
      try {
        await window.getDigitalGoodsService('https://example.com/billing');
        window.parent.postMessage({ type: 'availability-result', enabled: true }, '*');
      } catch (error) {
        window.parent.postMessage({ type: 'availability-result', enabled: false }, '*');
      }
    }, { once: true });
  </script>
</body>
</html>