chromium/third_party/blink/web_tests/http/tests/security/resources/postmessage-document-origin.html

<script>
    // Respond to any message by sending the messenger back with the document's
    // origin.
    window.addEventListener('message', function (e) {
        event.source.postMessage({
            'origin': self.origin,
            'id': e.data.id
        }, e.origin);
    });
</script>