https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 8aa53dd361f53703c6c67c4b007a472832a855a2 authored by Marcos Cáceres on 22 November 2018, 02:14:30 UTC
fix: copy pasta
Tip revision: 8aa53dd
addmodule-window.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>
back to top