1
0
Fork 0
firefox/testing/web-platform/tests/worklets/resources/addmodule-window.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

27 lines
784 B
HTML

<!DOCTYPE html>
<html>
<head>
<title>Worklet: Referrer</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="worklet-test-utils.js"></script>
</head>
<body>
<script>
// Calls addModule() on a given worklet type with a script url.
//
// [Message Format]
// - type: 'paint' (worklet types defined in get_worklet())
// - script_url: 'worklet-script.js'
window.onmessage = e => {
const worklet_type = e.data.type;
const script_url = e.data.script_url;
get_worklet(worklet_type).addModule(script_url)
.then(() => window.opener.postMessage('RESOLVED', '*'))
.catch(e => window.opener.postMessage('REJECTED', '*'));
};
window.opener.postMessage('LOADED', '*');
</script>
</body>
</html>