Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /webmessaging/global-postMessage.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Using the global postMessage() to post a message to oneself</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
async_test(t => {
onmessage = t.step_func_done(e => {
assert_equals(e.data, "Hello");
});
postMessage("Hello", "*");
});
</script>