puppeteer/test/assets/worker/worker.html
Joel Einbinder 93fe2b57d6 feat(Page): introduce workers (#2560)
This adds `page.workers()`, and two events `workercreated` and `workerdestroyed`. It also forwards logs from a worker into the page `console` event.

Only dedicated workers are supported for now, ServiceWorkers will probably work differently because they aren't necessarily associated with a single page.

Fixes #2350.
2018-05-21 14:31:11 -07:00

14 lines
259 B
HTML

<!DOCTYPE html>
<html>
<head>
<title>Worker test</title>
</head>
<body>
<script>
var worker = new Worker('worker.js');
worker.onmessage = function(message) {
console.log(message.data);
};
</script>
</body>
</html>