https://github.com/web-platform-tests/wpt
Raw File
Tip revision: d667dfe87079b7acf0d9ec69afd1158e5f7fde8a authored by Rob Buis on 12 April 2018, 16:14:10 UTC
Fix regression allowing text value for -webkit-background-origin
Tip revision: d667dfe
data-url-shared-window.html
<!DOCTYPE html>
<head>
<title>data URL shared worker</title>
</head>
<body>
<script>
onmessage = event => {
  const port = event.ports[0];
  // This shared worker counts the total number of connected documents and
  // notifies the connector of it.
  const kScript =
      "onconnect = e => {" +
      "  if (self.count === undefined)" +
      "    self.count = 0;" +
      "  self.count++;" +
      "  e.ports[0].postMessage(self.count);" +
      "};";
  const worker = new SharedWorker('data:application/javascript,' + kScript);
  worker.port.onmessage = e => port.postMessage(e.data);
};

window.opener.postMessage('LOADED', '*');
</script>
</body>
</html>
back to top